summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-vcs/mercurial/mercurial-9999.ebuild')
-rw-r--r--dev-vcs/mercurial/mercurial-9999.ebuild171
1 files changed, 100 insertions, 71 deletions
diff --git a/dev-vcs/mercurial/mercurial-9999.ebuild b/dev-vcs/mercurial/mercurial-9999.ebuild
index 39b4c67502eb..a38cb9230332 100644
--- a/dev-vcs/mercurial/mercurial-9999.ebuild
+++ b/dev-vcs/mercurial/mercurial-9999.ebuild
@@ -1,152 +1,181 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=8
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE="threads"
+CARGO_OPTIONAL=1
+DISTUTILS_USE_PEP517="setuptools"
+DISTUTILS_EXT=1
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE="threads(+)"
-inherit bash-completion-r1 elisp-common eutils distutils-r1 mercurial flag-o-matic
+inherit bash-completion-r1 cargo elisp-common distutils-r1 mercurial flag-o-matic multiprocessing
DESCRIPTION="Scalable distributed SCM"
HOMEPAGE="https://www.mercurial-scm.org/"
-EHG_REPO_URI="http://selenic.com/repo/hg"
-EHG_REVISION="@"
+EHG_REPO_URI="https://www.mercurial-scm.org/repo/hg"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS=""
-IUSE="+chg bugzilla emacs gpg test tk zsh-completion"
+IUSE="+chg emacs gpg test tk rust"
-RDEPEND="bugzilla? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
+BDEPEND="
+ dev-python/docutils[${PYTHON_USEDEP}]
+ rust? ( ${RUST_DEPEND} )"
+
+RDEPEND="
+ app-misc/ca-certificates
gpg? ( app-crypt/gnupg )
- tk? ( dev-lang/tk )
- zsh-completion? ( app-shells/zsh )
- app-misc/ca-certificates"
-DEPEND="emacs? ( virtual/emacs )
- test? ( app-arch/unzip
- dev-python/pygments[${PYTHON_USEDEP}] )
- dev-python/docutils[${PYTHON_USEDEP}]"
+ tk? ( dev-lang/tk )"
+
+DEPEND="emacs? ( >=app-editors/emacs-23.1:* )
+ test? (
+ app-arch/unzip
+ dev-python/pygments[${PYTHON_USEDEP}]
+ )"
SITEFILE="70${PN}-gentoo.el"
-# Too many tests fail #608720
-RESTRICT="test"
+RESTRICT="!test? ( test )"
+
+src_unpack() {
+ mercurial_src_unpack
+ if use rust; then
+ local S="${S}/rust/hg-cpython"
+ cargo_live_src_unpack
+ fi
+}
python_prepare_all() {
# fix up logic that won't work in Gentoo Prefix (also won't outside in
# certain cases), bug #362891
sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
+ sed -i -e 's/__APPLE__/__NO_APPLE__/g' mercurial/cext/osutil.c || die
distutils-r1_python_prepare_all
}
-python_configure_all() {
- strip-flags -ftracer -ftree-vectorize
- # Note: make it impl-conditional if py3 is supported
- append-flags -fno-strict-aliasing
+src_compile() {
+ if use rust; then
+ pushd rust/hg-cpython || die
+ cargo_src_compile --no-default-features --jobs $(makeopts_jobs)
+ popd || die
+ fi
+ distutils-r1_src_compile
+}
- "${PYTHON}" setup.py build_mo || die
+python_compile() {
+ filter-flags -ftracer -ftree-vectorize
+ if use rust; then
+ local -x HGWITHRUSTEXT="cpython"
+ fi
+ distutils-r1_python_compile build_ext
}
python_compile_all() {
- rm -r contrib/{win32,macosx} || die
+ rm -r contrib/win32 || die
emake doc
if use chg; then
emake -C contrib/chg
fi
+ if use rust; then
+ pushd rust/rhg || die
+ cargo_src_compile --no-default-features --jobs $(makeopts_jobs)
+ popd || die
+ fi
if use emacs; then
cd contrib || die
elisp-compile mercurial.el || die "elisp-compile failed!"
fi
}
+src_install() {
+ distutils-r1_src_install
+}
+
+python_install() {
+ if use rust; then
+ local -x HGWITHRUSTEXT="cpython"
+ fi
+
+ distutils-r1_python_install build_ext
+ python_doscript contrib/hg-ssh
+}
+
python_install_all() {
distutils-r1_python_install_all
newbashcomp contrib/bash_completion hg
- if use zsh-completion ; then
- insinto /usr/share/zsh/site-functions
- newins contrib/zsh_completion _hg
- fi
-
- rm -f doc/*.?.txt || die
- dodoc CONTRIBUTORS doc/*.txt
- cp hgweb*.cgi "${ED}"/usr/share/doc/${PF}/ || die
+ insinto /usr/share/zsh/site-functions
+ newins contrib/zsh_completion _hg
dobin hgeditor
- dobin contrib/hgk
- python_foreach_impl python_doscript contrib/hg-ssh
+ if use tk; then
+ dobin contrib/hgk
+ fi
if use emacs; then
elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!"
- elisp-site-file-install "${FILESDIR}"/${SITEFILE}
+ elisp-make-site-file "${SITEFILE}"
fi
- local RM_CONTRIB=(hgk hg-ssh bash_completion zsh_completion wix buildrpm plan9
- *.el mercurial.spec)
+ local RM_CONTRIB=( hgk hg-ssh bash_completion zsh_completion plan9 *.el )
if use chg; then
dobin contrib/chg/chg
doman contrib/chg/chg.1
RM_CONTRIB+=( chg )
fi
+ if use rust; then
+ dobin rust/target/release/rhg
+ fi
for f in ${RM_CONTRIB[@]}; do
- rm -rf contrib/$f || die
+ rm -rf contrib/${f} || die
done
dodoc -r contrib
docompress -x /usr/share/doc/${PF}/contrib
doman doc/*.?
-
- cat > "${T}/80mercurial" <<-EOF
-HG="${EPREFIX}/usr/bin/hg"
-EOF
- doenvd "${T}/80mercurial"
+ dodoc CONTRIBUTORS hgweb.cgi
insinto /etc/mercurial/hgrc.d
doins "${FILESDIR}/cacerts.rc"
}
src_test() {
- cd tests || die
- rm -rf *svn* || die # Subversion tests fail with 1.5
- rm -f test-archive* || die # Fails due to verbose tar output changes
- rm -f test-convert-baz* || die # GNU Arch baz
- rm -f test-convert-cvs* || die # CVS
- rm -f test-convert-darcs* || die # Darcs
- rm -f test-convert-git* || die # git
- rm -f test-convert-mtn* || die # monotone
- rm -f test-convert-tla* || die # GNU Arch tla
- rm -f test-doctest* || die # doctest always fails with python 2.5.x
- rm -f test-largefiles* || die # tends to time out
+ pushd tests &>/dev/null || die
+ rm -rf *svn* # Subversion tests fail with 1.5
+ rm -f test-archive* # Fails due to verbose tar output changes
+ rm -f test-convert-baz* # GNU Arch baz
+ rm -f test-convert-cvs* # CVS
+ rm -f test-convert-darcs* # Darcs
+ rm -f test-convert-git* # git
+ rm -f test-convert-mtn* # monotone
+ rm -f test-convert-tla* # GNU Arch tla
+ rm -f test-largefiles* # tends to time out
+ rm -f test-https* # requires to support tls1.0
+ rm -rf test-removeemptydirs* # requires access to access parent directories
if [[ ${EUID} -eq 0 ]]; then
einfo "Removing tests which require user privileges to succeed"
- rm -f test-command-template* || die # Test is broken when run as root
- rm -f test-convert* || die # Test is broken when run as root
- rm -f test-lock-badness* || die # Test is broken when run as root
- rm -f test-permissions* || die # Test is broken when run as root
- rm -f test-pull-permission* || die # Test is broken when run as root
- rm -f test-clone-failure* || die
- rm -f test-journal-exists* || die
- rm -f test-repair-strip* || die
+ rm -f test-convert*
+ rm -f test-lock-badness*
+ rm -f test-permissions*
+ rm -f test-pull-permission*
+ rm -f test-journal-exists*
+ rm -f test-repair-strip*
fi
- cd .. || die
+ popd &>/dev/null || die
distutils-r1_src_test
}
python_test() {
- local TEST_DIR
-
- rm -rf "${TMPDIR}"/test
- distutils_install_for_testing
cd tests || die
- "${PYTHON}" run-tests.py --verbose \
- --tmpdir="${TMPDIR}"/test \
- --with-hg="${TEST_DIR}"/scripts/hg \
+ PYTHONWARNINGS=ignore "${PYTHON}" run-tests.py \
+ --jobs $(makeopts_jobs) \
+ --timeout 0 \
|| die "Tests fail with ${EPYTHON}"
}