dev-vcs/mercurial: Use absolute import for zstd
authorCédric Krier <cedk@gentoo.org>
Sun, 26 Jan 2020 11:55:06 +0000 (12:55 +0100)
committerCédric Krier <cedk@gentoo.org>
Sun, 26 Jan 2020 11:55:21 +0000 (12:55 +0100)
Fake zstd.py does not work on Python 2.7
And synchronize mercurial-9999

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Cédric Krier <cedk@gentoo.org>
dev-vcs/mercurial/files/zstd.py [deleted file]
dev-vcs/mercurial/mercurial-5.2.2-r1.ebuild [moved from dev-vcs/mercurial/mercurial-5.2.2.ebuild with 96% similarity]
dev-vcs/mercurial/mercurial-9999.ebuild

diff --git a/dev-vcs/mercurial/files/zstd.py b/dev-vcs/mercurial/files/zstd.py
deleted file mode 100644 (file)
index 29ae5ea..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-from zstd import *
-from zstd import __version__
similarity index 96%
rename from dev-vcs/mercurial/mercurial-5.2.2.ebuild
rename to dev-vcs/mercurial/mercurial-5.2.2-r1.ebuild
index e189226b04d1ddaa12619bbca2bddd0f0f53b4bf..7d67135fc8ab6001f8a1b64d2523dfdd3f4fa2bf 100644 (file)
@@ -46,7 +46,10 @@ 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
-       cp "${FILESDIR}/zstd.py" mercurial/
+       # Use absolute import for zstd
+       sed -i -e 's/from \.* import zstd/import zstd/' \
+               mercurial/utils/compression.py \
+               mercurial/wireprotoframing.py || die
 
        distutils-r1_python_prepare_all
 }
index 9c47a383e79ee54280a9d195aa2be0a2efd48eb4..8c12d545eb8702baed063de2a1755202d7cff6ff 100644 (file)
@@ -48,14 +48,17 @@ python_prepare_all() {
        # certain cases), bug #362891
        sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
        sed -i -e '/    hgenv =/a\' -e '    hgenv.pop("PYTHONPATH", None)' setup.py || die
-       cp "${FILESDIR}/zstd.py" mercurial/
+       # Use absolute import for zstd
+       sed -i -e 's/from \.* import zstd/import zstd/' \
+               mercurial/utils/compression.py \
+               mercurial/wireprotoframing.py || die
 
        distutils-r1_python_prepare_all
 }
 
 python_compile() {
        strip-flags -ftracer -ftree-vectorize
-       python_is_python3 || append-flags -fno-strict-aliasing
+       python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
        distutils-r1_python_compile build_ext --no-zstd
 }