commit:     64ef96bc67f5033124d34df1329775cb09065203
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Wed May 12 20:35:29 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 30 09:52:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64ef96bc

dev-vcs/tortoisehg: 5.8 version bump; 9999.ebuild update

Since tarball from 'https://www.mercurial-scm.org/release/tortoisehg/targz/'
doesn't provide 'tests' directory the SRC_URI is replaced with url
for upstream repository 'https://foss.heptapod.net/mercurial/tortoisehg/'
like as for 9999.ebuild is curretly used.

This allows to add USE="test" both for 5.8 and 9999 ebuilds
with conditional DEPEND="dev-python/mock dev-python/pytest"
and appropriate calls for tests run in python_test() phase.

Additionally the QA issue is fixed:
"The ebuild is installing to one or more unexpected paths:
/usr/share/doc/tortoisehg
Please fix the ebuild to use correct FHS/Gentoo policy paths."
for "COPYING.txt" file installation by patching 'setup.py'
within python_prepare_all() phase.

New runtime dependency 'dev-python/pygit2' for the core git extension support
is added via optfeature call.

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
Closes: https://github.com/gentoo/gentoo/pull/20788
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-vcs/tortoisehg/Manifest                        |  1 +
 ...ortoisehg-9999.ebuild => tortoisehg-5.8.ebuild} | 32 +++++++++++++++++-----
 dev-vcs/tortoisehg/tortoisehg-9999.ebuild          | 32 +++++++++++++++++-----
 3 files changed, 51 insertions(+), 14 deletions(-)

diff --git a/dev-vcs/tortoisehg/Manifest b/dev-vcs/tortoisehg/Manifest
index e9ead221698..2c89d8773a5 100644
--- a/dev-vcs/tortoisehg/Manifest
+++ b/dev-vcs/tortoisehg/Manifest
@@ -1 +1,2 @@
 DIST tortoisehg-5.7.tar.gz 8910721 BLAKE2B 
ebca9526fc39c94c26f28db6dd70527c528308d9003fca0d9cfb61f984a9a5d80f910d68d0d1449221bbb4e040d2919ed34fec1e0aee4d9f5ed55cbcdb8ba714
 SHA512 
d143c9e83d3b0771ffd4a3bd9cd50e8bc169e5d29e33a0681c3234898a7566427f070ff3ad8668709b5e4d63be92fd700211dee03e98ff16c7c23fc0870c9e4c
+DIST tortoisehg-5.8.tar.gz 8636455 BLAKE2B 
1f4171ca4eb465aabacaf53b97785c5f05fc501a11329af008695f706d8d2cb9c5eee5e64bb5a60fdf7234f33ed6a937dfacce49cb36ac9e9b8505be271b4f35
 SHA512 
b9fe80a98cfafe0dbc90be5fe6f83b466fe596b4ec135d0eacc5618e39c0249a3a352bed640a7cecb99d53eaf60908d60d7748009492cbd8202fc191ef428278

diff --git a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild 
b/dev-vcs/tortoisehg/tortoisehg-5.8.ebuild
similarity index 62%
copy from dev-vcs/tortoisehg/tortoisehg-9999.ebuild
copy to dev-vcs/tortoisehg/tortoisehg-5.8.ebuild
index 439a13c2c81..f54b981fe3d 100644
--- a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
+++ b/dev-vcs/tortoisehg/tortoisehg-5.8.ebuild
@@ -6,18 +6,19 @@ PYTHON_COMPAT=( python3_{7..9} )
 
 DISTUTILS_USE_SETUPTOOLS=no
 
-inherit desktop distutils-r1 xdg-utils
+inherit desktop distutils-r1 optfeature xdg-utils
 
 if [[ ${PV} != *9999* ]]; then
        KEYWORDS="~amd64 ~arm64 ~x86"
-       
SRC_URI="https://www.mercurial-scm.org/release/tortoisehg/targz/${P}.tar.gz";
-       HG_DEPEND=">=dev-vcs/mercurial-5.6[${PYTHON_USEDEP}]
-               <dev-vcs/mercurial-5.8[${PYTHON_USEDEP}]"
+       
SRC_URI="https://foss.heptapod.net/mercurial/${PN}/thg/-/archive/${PV}/thg-${PV}.tar.gz
 -> ${P}.tar.gz"
+       HG_DEPEND=">=dev-vcs/mercurial-5.7[${PYTHON_USEDEP}]
+               <dev-vcs/mercurial-5.9[${PYTHON_USEDEP}]"
+       S="${WORKDIR}/thg-${PV}"
 else
        inherit mercurial
-       EHG_REPO_URI="https://foss.heptapod.net/mercurial/tortoisehg/thg";
+       EHG_REPO_URI="https://foss.heptapod.net/mercurial/${PN}/thg";
        EHG_REVISION="stable"
-       HG_DEPEND=">=dev-vcs/mercurial-5.6[${PYTHON_USEDEP}]"
+       HG_DEPEND=">=dev-vcs/mercurial-5.7[${PYTHON_USEDEP}]"
 fi
 
 DESCRIPTION="Set of graphical tools for Mercurial"
@@ -25,6 +26,8 @@ HOMEPAGE="https://tortoisehg.bitbucket.io/";
 
 LICENSE="GPL-2"
 SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        ${HG_DEPEND}
@@ -33,16 +36,29 @@ RDEPEND="
        dev-python/PyQt5[network,svg,${PYTHON_USEDEP}]
        >=dev-python/qscintilla-python-2.9.4[qt5(+),${PYTHON_USEDEP}]
 "
-DEPEND="${RDEPEND}"
+DEPEND="
+       ${RDEPEND}
+       test? (
+               dev-python/mock
+               dev-python/pytest
+       )
+"
 
 distutils_enable_sphinx doc/source
 
 python_prepare_all() {
        # Remove file that collides with >=mercurial-4.0 (bug #599266).
        rm "${S}"/hgext3rd/__init__.py || die "can't remove 
/hgext3rd/__init__.py"
+
+       sed -i -e 's:share/doc/tortoisehg:share/doc/'"${PF}"':' setup.py || die
        distutils-r1_python_prepare_all
 }
 
+python_test() {
+       ${EPYTHON} tests/run-tests.py -m 'not largefiles' --doctest-modules 
tests || die
+       ${EPYTHON} tests/run-tests.py -m largefiles tests || die
+}
+
 python_install_all() {
        distutils-r1_python_install_all
        dodoc doc/ReadMe*.txt doc/TODO contrib/mergetools.rc
@@ -55,6 +71,8 @@ pkg_postinst() {
        elog "When startup of ${PN} fails with an API version mismatch error"
        elog "between dev-python/sip and dev-python/PyQt5 please rebuild"
        elog "dev-python/qscintilla-python."
+
+       optfeature "the core git extension support" dev-python/pygit2
 }
 
 pkg_postrm() {

diff --git a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild 
b/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
index 439a13c2c81..f54b981fe3d 100644
--- a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
+++ b/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
@@ -6,18 +6,19 @@ PYTHON_COMPAT=( python3_{7..9} )
 
 DISTUTILS_USE_SETUPTOOLS=no
 
-inherit desktop distutils-r1 xdg-utils
+inherit desktop distutils-r1 optfeature xdg-utils
 
 if [[ ${PV} != *9999* ]]; then
        KEYWORDS="~amd64 ~arm64 ~x86"
-       
SRC_URI="https://www.mercurial-scm.org/release/tortoisehg/targz/${P}.tar.gz";
-       HG_DEPEND=">=dev-vcs/mercurial-5.6[${PYTHON_USEDEP}]
-               <dev-vcs/mercurial-5.8[${PYTHON_USEDEP}]"
+       
SRC_URI="https://foss.heptapod.net/mercurial/${PN}/thg/-/archive/${PV}/thg-${PV}.tar.gz
 -> ${P}.tar.gz"
+       HG_DEPEND=">=dev-vcs/mercurial-5.7[${PYTHON_USEDEP}]
+               <dev-vcs/mercurial-5.9[${PYTHON_USEDEP}]"
+       S="${WORKDIR}/thg-${PV}"
 else
        inherit mercurial
-       EHG_REPO_URI="https://foss.heptapod.net/mercurial/tortoisehg/thg";
+       EHG_REPO_URI="https://foss.heptapod.net/mercurial/${PN}/thg";
        EHG_REVISION="stable"
-       HG_DEPEND=">=dev-vcs/mercurial-5.6[${PYTHON_USEDEP}]"
+       HG_DEPEND=">=dev-vcs/mercurial-5.7[${PYTHON_USEDEP}]"
 fi
 
 DESCRIPTION="Set of graphical tools for Mercurial"
@@ -25,6 +26,8 @@ HOMEPAGE="https://tortoisehg.bitbucket.io/";
 
 LICENSE="GPL-2"
 SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        ${HG_DEPEND}
@@ -33,16 +36,29 @@ RDEPEND="
        dev-python/PyQt5[network,svg,${PYTHON_USEDEP}]
        >=dev-python/qscintilla-python-2.9.4[qt5(+),${PYTHON_USEDEP}]
 "
-DEPEND="${RDEPEND}"
+DEPEND="
+       ${RDEPEND}
+       test? (
+               dev-python/mock
+               dev-python/pytest
+       )
+"
 
 distutils_enable_sphinx doc/source
 
 python_prepare_all() {
        # Remove file that collides with >=mercurial-4.0 (bug #599266).
        rm "${S}"/hgext3rd/__init__.py || die "can't remove 
/hgext3rd/__init__.py"
+
+       sed -i -e 's:share/doc/tortoisehg:share/doc/'"${PF}"':' setup.py || die
        distutils-r1_python_prepare_all
 }
 
+python_test() {
+       ${EPYTHON} tests/run-tests.py -m 'not largefiles' --doctest-modules 
tests || die
+       ${EPYTHON} tests/run-tests.py -m largefiles tests || die
+}
+
 python_install_all() {
        distutils-r1_python_install_all
        dodoc doc/ReadMe*.txt doc/TODO contrib/mergetools.rc
@@ -55,6 +71,8 @@ pkg_postinst() {
        elog "When startup of ${PN} fails with an API version mismatch error"
        elog "between dev-python/sip and dev-python/PyQt5 please rebuild"
        elog "dev-python/qscintilla-python."
+
+       optfeature "the core git extension support" dev-python/pygit2
 }
 
 pkg_postrm() {

Reply via email to