mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/pysimdjson: Add python@ as co-maint.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
95
dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
Normal file
95
dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
Normal file
@@ -0,0 +1,95 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f1de675..4c23028 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -27,53 +27,59 @@ if system == 'Darwin':
|
||||
os.environ.setdefault('MACOSX_DEPLOYMENT_TARGET', '10.14')
|
||||
extra_compile_args.append('-std=c++11')
|
||||
|
||||
-if os.getenv('BUILD_WITH_CYTHON') and not CYTHON_AVAILABLE:
|
||||
+build_with_cython = os.getenv('BUILD_WITH_CYTHON')
|
||||
+if build_with_cython and not CYTHON_AVAILABLE:
|
||||
print(
|
||||
'BUILD_WITH_CYTHON environment variable is set, but cython'
|
||||
' is not available. Falling back to pre-cythonized version if'
|
||||
' available.'
|
||||
)
|
||||
+ build_with_cython = False
|
||||
|
||||
-if os.getenv('BUILD_WITH_CYTHON') and CYTHON_AVAILABLE:
|
||||
- macros = []
|
||||
- compiler_directives = {
|
||||
- 'embedsignature': True
|
||||
- }
|
||||
+build_with_system_lib = os.getenv('BUILD_WITH_SYSTEM_LIB')
|
||||
+
|
||||
+macros = []
|
||||
+compiler_directives = {}
|
||||
+libraries = []
|
||||
+sources = [
|
||||
+ 'simdjson/errors.cpp',
|
||||
+]
|
||||
+
|
||||
+if build_with_system_lib:
|
||||
+ libraries.append('simdjson')
|
||||
+else:
|
||||
+ sources.append('simdjson/simdjson.cpp')
|
||||
+
|
||||
+if build_with_cython:
|
||||
+ compiler_directives['embedsignature'] = True
|
||||
|
||||
if os.getenv('BUILD_FOR_DEBUG'):
|
||||
# Enable line tracing, which also enables support for coverage
|
||||
# reporting.
|
||||
- macros = [
|
||||
+ macros += [
|
||||
('CYTHON_TRACE', 1),
|
||||
('CYTHON_TRACE_NOGIL', 1)
|
||||
]
|
||||
compiler_directives['linetrace'] = True
|
||||
|
||||
- extensions = cythonize([
|
||||
- Extension(
|
||||
- 'csimdjson',
|
||||
- [
|
||||
- 'simdjson/simdjson.cpp',
|
||||
- 'simdjson/errors.cpp',
|
||||
- 'simdjson/csimdjson.pyx'
|
||||
- ],
|
||||
- define_macros=macros,
|
||||
- extra_compile_args=extra_compile_args
|
||||
- )
|
||||
- ], compiler_directives=compiler_directives)
|
||||
+ sources.append('simdjson/csimdjson.pyx')
|
||||
else:
|
||||
- extensions = [
|
||||
- Extension(
|
||||
- 'csimdjson',
|
||||
- [
|
||||
- 'simdjson/simdjson.cpp',
|
||||
- 'simdjson/errors.cpp',
|
||||
- 'simdjson/csimdjson.cpp'
|
||||
- ],
|
||||
- extra_compile_args=extra_compile_args,
|
||||
- language='c++'
|
||||
- )
|
||||
- ]
|
||||
+ sources.append('simdjson/csimdjson.cpp')
|
||||
+
|
||||
+
|
||||
+extensions = [
|
||||
+ Extension(
|
||||
+ 'csimdjson',
|
||||
+ sources,
|
||||
+ define_macros=macros,
|
||||
+ extra_compile_args=extra_compile_args,
|
||||
+ libraries=libraries,
|
||||
+ language='c++',
|
||||
+ )
|
||||
+]
|
||||
+
|
||||
+if build_with_cython:
|
||||
+ extensions = cythonize(extensions, compiler_directives=compiler_directives)
|
||||
|
||||
setup(
|
||||
name='pysimdjson',
|
||||
@@ -5,6 +5,10 @@
|
||||
<email>chutzpah@gentoo.org</email>
|
||||
<name>Patrick McLean</name>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>python@gentoo.org</email>
|
||||
<name>Python</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="pypi">pysimdjson</remote-id>
|
||||
</upstream>
|
||||
|
||||
@@ -23,13 +23,20 @@ BDEPEND="
|
||||
"
|
||||
distutils_enable_tests pytest
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-unbundle.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
# benchmarks aren't run
|
||||
sed -i -e 's:pytest-benchmark::' setup.cfg || die
|
||||
# force regen
|
||||
# rm simdjson/csimdjson.cpp || die
|
||||
rm simdjson/csimdjson.cpp || die
|
||||
# bundled lib :-(
|
||||
rm simdjson/simdjson.{cpp,h} || die
|
||||
|
||||
distutils-r1_src_prepare
|
||||
|
||||
export BUILD_WITH_CYTHON=1
|
||||
export BUILD_WITH_SYSTEM_LIB=1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user