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 / +52 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
30
	dev-python/docutils[${PYTHON_USEDEP}]"
32
	dev-python/docutils"
33
34
PYTHON_CFLAGS=(
35
	"2.* + -fno-strict-aliasing"
36
	"* - -ftracer -ftree-vectorize"
37
)
38
31
39
PYTHON_MODNAME="${PN} hgext"
40
SITEFILE="70${PN}-gentoo.el"
32
SITEFILE="70${PN}-gentoo.el"
41
33
42
src_prepare() {
34
python_prepare_all() {
43
	distutils_src_prepare
44
	# fix up logic that won't work in Gentoo Prefix (also won't outside in
35
	# fix up logic that won't work in Gentoo Prefix (also won't outside in
45
	# certain cases), bug #362891
36
	# certain cases), bug #362891
46
	sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
37
	sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
38
39
	distutils-r1_python_prepare_all
40
}
41
42
python_configure_all() {
43
	strip-flags -ftracer -ftree-vectorize
44
	# Note: make it impl-conditional if py3 is supported
45
	append-flags -fno-strict-aliasing
46
47
	"${PYTHON}" setup.py build_mo || die
47
}
48
}
48
49
49
src_compile() {
50
python_compile_all() {
50
	distutils_src_compile
51
	rm -r contrib/{win32,macosx} || die
51
	make doc || die
52
	emake doc
52
	if use emacs; then
53
	if use emacs; then
53
		cd "${S}"/contrib || die
54
		cd contrib || die
54
		elisp-compile mercurial.el || die "elisp-compile failed!"
55
		elisp-compile mercurial.el || die "elisp-compile failed!"
55
	fi
56
	fi
56
	rm -rf contrib/{win32,macosx} || die
57
}
57
}
58
58
59
src_install() {
59
python_install_all() {
60
	distutils_src_install
60
	distutils-r1_python_install_all
61
	python_convert_shebangs 2 contrib/hg-ssh
62
61
63
	newbashcomp contrib/bash_completion ${PN} || die
62
	newbashcomp contrib/bash_completion ${PN}
64
63
65
	if use zsh-completion ; then
64
	if use zsh-completion ; then
66
		insinto /usr/share/zsh/site-functions
65
		insinto /usr/share/zsh/site-functions
67
		newins contrib/zsh_completion _hg || die
66
		newins contrib/zsh_completion _hg
68
	fi
67
	fi
69
68
70
	rm -f doc/*.?.txt || die
69
	rm -f doc/*.?.txt || die
71
	dodoc CONTRIBUTORS README doc/*.txt || die
70
	dodoc CONTRIBUTORS doc/*.txt
72
	cp hgweb*.cgi "${ED}"/usr/share/doc/${PF}/ || die
71
	cp hgweb*.cgi "${ED}"/usr/share/doc/${PF}/ || die
73
72
73
	dobin hgeditor
74
	dobin contrib/hgk
75
	python_foreach_impl python_doscript contrib/hg-ssh
76
74
	if use emacs; then
77
	if use emacs; then
75
		elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!"
78
		elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!"
76
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
79
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
77
	fi
80
	fi
78
81
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
82
	local RM_CONTRIB=(hgk hg-ssh bash_completion zsh_completion wix buildrpm plan9
84
		              *.el mercurial.spec)
83
	                  *.el mercurial.spec)
85
	for f in ${RM_CONTRIB[@]}; do
84
	for f in ${RM_CONTRIB[@]}; do
86
		rm -rf contrib/$f || die
85
		rm -rf contrib/$f || die
87
	done
86
	done
88
87
89
	cp -r contrib "${ED}"/usr/share/doc/${PF}/ || die
88
	dodoc -r contrib
90
	doman doc/*.? || die
89
	docompress -x /usr/share/doc/${PF}/contrib
90
	doman doc/*.?
91
91
92
	cat > "${T}/80mercurial" <<-EOF
92
	cat > "${T}/80mercurial" <<-EOF
93
HG="${EPREFIX}/usr/bin/hg"
93
HG="${EPREFIX}/usr/bin/hg"
94
EOF
94
EOF
95
	doenvd "${T}/80mercurial" || die
95
	doenvd "${T}/80mercurial"
96
96
97
	insinto /etc/mercurial/hgrc.d
97
	insinto /etc/mercurial/hgrc.d
98
	doins "${FILESDIR}/cacerts.rc"
98
	doins "${FILESDIR}/cacerts.rc"
99
}
99
}
100
100
101
src_test() {
101
src_test() {
102
	cd "${S}/tests/" || die
102
	cd tests || die
103
	rm -rf *svn* || die					# Subversion tests fail with 1.5
103
	rm -rf *svn* || die					# Subversion tests fail with 1.5
104
	rm -f test-archive* || die			# Fails due to verbose tar output changes
104
	rm -f test-archive* || die			# Fails due to verbose tar output changes
105
	rm -f test-convert-baz* || die		# GNU Arch baz
105
	rm -f test-convert-baz* || die		# GNU Arch baz
Lines 122-137 Link Here
122
		rm -f test-repair-strip* || die
122
		rm -f test-repair-strip* || die
123
	fi
123
	fi
124
124
125
	testing() {
125
	cd .. || die
126
		local testdir="${T}/tests-${PYTHON_ABI}"
126
	distutils-r1_src_test
127
		rm -rf "${testdir}" || die
127
}
128
		"$(PYTHON)" run-tests.py --tmpdir="${testdir}"
128
129
	}
129
python_test() {
130
	python_execute_function testing
130
	local TEST_DIR
131
132
	rm -rf "${TMPDIR}"/test
133
	distutils_install_for_testing
134
	cd tests || die
135
	"${PYTHON}" run-tests.py --verbose \
136
		--tmpdir="${TMPDIR}"/test \
137
		--with-hg="${TEST_DIR}"/scripts/hg \
138
		|| die "Tests fail with ${EPYTHON}"
131
}
139
}
132
140
133
pkg_postinst() {
141
pkg_postinst() {
134
	distutils_pkg_postinst
135
	use emacs && elisp-site-regen
142
	use emacs && elisp-site-regen
136
143
137
	elog "If you want to convert repositories from other tools using convert"
144
	elog "If you want to convert repositories from other tools using convert"
Lines 144-149 Link Here
144
}
151
}
145
152
146
pkg_postrm() {
153
pkg_postrm() {
147
	distutils_pkg_postrm
148
	use emacs && elisp-site-regen
154
	use emacs && elisp-site-regen
149
}
155
}

Return to bug 465630