Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 465630 | Differences between
and this patch

Collapse All | Expand All

(-)mercurial-9999.ebuild (-46 / +51 lines)
Lines 1-14 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
3
# $Header: $
4
4
5
EAPI=3
5
EAPI=5
6
PYTHON_DEPEND="2"
7
PYTHON_USE_WITH="threads"
8
SUPPORT_PYTHON_ABIS="1"
9
RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
10
6
11
inherit bash-completion-r1 elisp-common eutils distutils mercurial
7
PYTHON_COMPAT=( python{2_5,2_6,2_7} )
8
PYTHON_REQ_USE="threads"
9
10
inherit bash-completion-r1 elisp-common eutils distutils-r1 mercurial flag-o-matic
12
11
13
DESCRIPTION="Scalable distributed SCM"
12
DESCRIPTION="Scalable distributed SCM"
14
HOMEPAGE="http://mercurial.selenic.com/"
13
HOMEPAGE="http://mercurial.selenic.com/"
Lines 20-105 Link Here
20
KEYWORDS=""
19
KEYWORDS=""
21
IUSE="bugzilla emacs gpg test tk zsh-completion"
20
IUSE="bugzilla emacs gpg test tk zsh-completion"
22
21
23
RDEPEND="bugzilla? ( dev-python/mysql-python )
22
RDEPEND="bugzilla? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
24
	gpg? ( app-crypt/gnupg )
23
	gpg? ( app-crypt/gnupg )
25
	tk? ( dev-lang/tk )
24
	tk? ( dev-lang/tk )
26
	zsh-completion? ( app-shells/zsh )
25
	zsh-completion? ( app-shells/zsh )
27
	app-misc/ca-certificates"
26
	app-misc/ca-certificates"
28
DEPEND="emacs? ( virtual/emacs )
27
DEPEND="emacs? ( virtual/emacs )
29
	test? ( app-arch/unzip
28
	test? ( app-arch/unzip
30
		dev-python/pygments )
29
		dev-python/pygments[${PYTHON_USEDEP}] )"
31
	app-text/asciidoc
32
	dev-python/docutils"
33
34
PYTHON_CFLAGS=(
35
	"2.* + -fno-strict-aliasing"
36
	"* - -ftracer -ftree-vectorize"
37
)
38
30
39
PYTHON_MODNAME="${PN} hgext"
40
SITEFILE="70${PN}-gentoo.el"
31
SITEFILE="70${PN}-gentoo.el"
41
32
42
src_prepare() {
33
python_prepare_all() {
43
	distutils_src_prepare
44
	# fix up logic that won't work in Gentoo Prefix (also won't outside in
34
	# fix up logic that won't work in Gentoo Prefix (also won't outside in
45
	# certain cases), bug #362891
35
	# certain cases), bug #362891
46
	sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
36
	sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
37
38
	distutils-r1_python_prepare_all
39
}
40
41
python_configure_all() {
42
	strip-flags -ftracer -ftree-vectorize
43
	# Note: make it impl-conditional if py3 is supported
44
	append-flags -fno-strict-aliasing
45
46
	"${PYTHON}" setup.py build_mo || die
47
}
47
}
48
48
49
src_compile() {
49
python_compile_all() {
50
	distutils_src_compile
50
	rm -r contrib/{win32,macosx} || die
51
	make doc || die
51
	emake doc
52
	if use emacs; then
52
	if use emacs; then
53
		cd "${S}"/contrib || die
53
		cd contrib || die
54
		elisp-compile mercurial.el || die "elisp-compile failed!"
54
		elisp-compile mercurial.el || die "elisp-compile failed!"
55
	fi
55
	fi
56
	rm -rf contrib/{win32,macosx} || die
57
}
56
}
58
57
59
src_install() {
58
python_install_all() {
60
	distutils_src_install
59
	distutils-r1_python_install_all
61
	python_convert_shebangs 2 contrib/hg-ssh
62
60
63
	newbashcomp contrib/bash_completion ${PN} || die
61
	newbashcomp contrib/bash_completion ${PN}
64
62
65
	if use zsh-completion ; then
63
	if use zsh-completion ; then
66
		insinto /usr/share/zsh/site-functions
64
		insinto /usr/share/zsh/site-functions
67
		newins contrib/zsh_completion _hg || die
65
		newins contrib/zsh_completion _hg
68
	fi
66
	fi
69
67
70
	rm -f doc/*.?.txt || die
68
	rm -f doc/*.?.txt || die
71
	dodoc CONTRIBUTORS README doc/*.txt || die
69
	dodoc CONTRIBUTORS doc/*.txt
72
	cp hgweb*.cgi "${ED}"/usr/share/doc/${PF}/ || die
70
	cp hgweb*.cgi "${ED}"/usr/share/doc/${PF}/ || die
73
71
72
	dobin hgeditor
73
	dobin contrib/hgk
74
	python_foreach_impl python_doscript contrib/hg-ssh
75
74
	if use emacs; then
76
	if use emacs; then
75
		elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!"
77
		elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!"
76
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
78
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
77
	fi
79
	fi
78
80
79
	dobin hgeditor || die
80
	dobin contrib/hgk || die
81
	dobin contrib/hg-ssh || die
82
83
	local RM_CONTRIB=(hgk hg-ssh bash_completion zsh_completion wix buildrpm plan9
81
	local RM_CONTRIB=(hgk hg-ssh bash_completion zsh_completion wix buildrpm plan9
84
		              *.el mercurial.spec)
82
	                  *.el mercurial.spec)
85
	for f in ${RM_CONTRIB[@]}; do
83
	for f in ${RM_CONTRIB[@]}; do
86
		rm -rf contrib/$f || die
84
		rm -rf contrib/$f || die
87
	done
85
	done
88
86
89
	cp -r contrib "${ED}"/usr/share/doc/${PF}/ || die
87
	dodoc -r contrib
90
	doman doc/*.? || die
88
	docompress -x /usr/share/doc/${PF}/contrib
89
	doman doc/*.?
91
90
92
	cat > "${T}/80mercurial" <<-EOF
91
	cat > "${T}/80mercurial" <<-EOF
93
HG="${EPREFIX}/usr/bin/hg"
92
HG="${EPREFIX}/usr/bin/hg"
94
EOF
93
EOF
95
	doenvd "${T}/80mercurial" || die
94
	doenvd "${T}/80mercurial"
96
95
97
	insinto /etc/mercurial/hgrc.d
96
	insinto /etc/mercurial/hgrc.d
98
	doins "${FILESDIR}/cacerts.rc"
97
	doins "${FILESDIR}/cacerts.rc"
99
}
98
}
100
99
101
src_test() {
100
src_test() {
102
	cd "${S}/tests/" || die
101
	cd tests || die
103
	rm -rf *svn* || die					# Subversion tests fail with 1.5
102
	rm -rf *svn* || die					# Subversion tests fail with 1.5
104
	rm -f test-archive* || die			# Fails due to verbose tar output changes
103
	rm -f test-archive* || die			# Fails due to verbose tar output changes
105
	rm -f test-convert-baz* || die		# GNU Arch baz
104
	rm -f test-convert-baz* || die		# GNU Arch baz
Lines 122-137 Link Here
122
		rm -f test-repair-strip* || die
121
		rm -f test-repair-strip* || die
123
	fi
122
	fi
124
123
125
	testing() {
124
	cd .. || die
126
		local testdir="${T}/tests-${PYTHON_ABI}"
125
	distutils-r1_src_test
127
		rm -rf "${testdir}" || die
126
}
128
		"$(PYTHON)" run-tests.py --tmpdir="${testdir}"
127
129
	}
128
python_test() {
130
	python_execute_function testing
129
	local TEST_DIR
130
131
	rm -rf "${TMPDIR}"/test
132
	distutils_install_for_testing
133
	cd tests || die
134
	"${PYTHON}" run-tests.py --verbose \
135
		--tmpdir="${TMPDIR}"/test \
136
		--with-hg="${TEST_DIR}"/scripts/hg \
137
		|| die "Tests fail with ${EPYTHON}"
131
}
138
}
132
139
133
pkg_postinst() {
140
pkg_postinst() {
134
	distutils_pkg_postinst
135
	use emacs && elisp-site-regen
141
	use emacs && elisp-site-regen
136
142
137
	elog "If you want to convert repositories from other tools using convert"
143
	elog "If you want to convert repositories from other tools using convert"
Lines 144-149 Link Here
144
}
150
}
145
151
146
pkg_postrm() {
152
pkg_postrm() {
147
	distutils_pkg_postrm
148
	use emacs && elisp-site-regen
153
	use emacs && elisp-site-regen
149
}
154
}

Return to bug 465630