dev-python/zstandard: Fix compiler init, modernize
authorMichał Górny <mgorny@gentoo.org>
Sun, 17 May 2020 07:53:37 +0000 (09:53 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 17 May 2020 07:53:37 +0000 (09:53 +0200)
Closes: https://bugs.gentoo.org/720784
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/zstandard/files/zstandard-0.13.0-compiler.patch [new file with mode: 0644]
dev-python/zstandard/zstandard-0.13.0.ebuild

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 (file)
index 0000000..fdaa4aa
--- /dev/null
@@ -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",]
+     )
index 2b6a5215994bfdced98147bcf7adc07e66704e59..59d51ed70dcc64072d4dd62dba4056a235e89f94 100644 (file)
@@ -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
-}