summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-17 09:53:37 +0200
committerMichał Górny <mgorny@gentoo.org>2020-05-17 09:53:37 +0200
commitc5f442f59afc84a329aa908047c3072ed28886e6 (patch)
treec07a64f47c7323287428365ff08153b821317b02 /dev-python
parentdev-python/pytools: Remove x86 keywords, the package is broken (diff)
downloadgentoo-c5f442f59afc84a329aa908047c3072ed28886e6.tar.gz
gentoo-c5f442f59afc84a329aa908047c3072ed28886e6.tar.bz2
gentoo-c5f442f59afc84a329aa908047c3072ed28886e6.zip
dev-python/zstandard: Fix compiler init, modernize
Closes: https://bugs.gentoo.org/720784 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/zstandard/files/zstandard-0.13.0-compiler.patch26
-rw-r--r--dev-python/zstandard/zstandard-0.13.0.ebuild16
2 files changed, 34 insertions, 8 deletions
diff --git a/dev-python/zstandard/files/zstandard-0.13.0-compiler.patch b/dev-python/zstandard/files/zstandard-0.13.0-compiler.patch
new file mode 100644
index 000000000000..fdaa4aa03922
--- /dev/null
+++ b/dev-python/zstandard/files/zstandard-0.13.0-compiler.patch
@@ -0,0 +1,26 @@
+diff --git a/make_cffi.py b/make_cffi.py
+index 0db4f71..4fe9cc4 100644
+--- a/make_cffi.py
++++ b/make_cffi.py
+@@ -8,6 +8,7 @@ from __future__ import absolute_import
+
+ import cffi
+ import distutils.ccompiler
++import distutils.sysconfig
+ import os
+ import re
+ import subprocess
+@@ -75,10 +76,12 @@ compiler = distutils.ccompiler.new_compiler()
+ if hasattr(compiler, "initialize"):
+ compiler.initialize()
+
++distutils.sysconfig.customize_compiler(compiler)
++
+ # Distutils doesn't set compiler.preprocessor, so invoke the preprocessor
+ # manually.
+ if compiler.compiler_type == "unix":
+- args = list(compiler.executables["compiler"])
++ args = compiler.compiler
+ args.extend(
+ ["-E", "-DZSTD_STATIC_LINKING_ONLY", "-DZDICT_STATIC_LINKING_ONLY",]
+ )
diff --git a/dev-python/zstandard/zstandard-0.13.0.ebuild b/dev-python/zstandard/zstandard-0.13.0.ebuild
index 2b6a5215994b..59d51ed70dcc 100644
--- a/dev-python/zstandard/zstandard-0.13.0.ebuild
+++ b/dev-python/zstandard/zstandard-0.13.0.ebuild
@@ -14,19 +14,19 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="BSD"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="test"
-RESTRICT="!test? ( test )"
RDEPEND="dev-python/cffi:=[${PYTHON_USEDEP}]"
-DEPEND="${RDEPEND}
- dev-python/setuptools[${PYTHON_USEDEP}]
+BDEPEND="
test? ( dev-python/hypothesis[${PYTHON_USEDEP}] )"
+distutils_enable_tests setup.py
+
+PATCHES=(
+ # https://github.com/indygreg/python-zstandard/issues/103
+ "${FILESDIR}"/zstandard-0.13.0-compiler.patch
+)
+
python_compile() {
local MAKEOPTS=-j1
distutils-r1_python_compile
}
-
-python_test() {
- esetup.py test
-}