From 2099ff9b640e648be67527e29760263a7c6274e5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 28 Apr 2023 05:11:40 +0100 Subject: gentoo auto-resync : 28:04:2023 - 05:11:40 --- .../files/pysimdjson-5.0.2-system-lib.patch | 72 ++++++++++++++++++++++ .../pysimdjson/files/pysimdjson-5.0.2-tests.patch | 13 ++++ 2 files changed, 85 insertions(+) create mode 100644 dev-python/pysimdjson/files/pysimdjson-5.0.2-system-lib.patch create mode 100644 dev-python/pysimdjson/files/pysimdjson-5.0.2-tests.patch (limited to 'dev-python/pysimdjson/files') diff --git a/dev-python/pysimdjson/files/pysimdjson-5.0.2-system-lib.patch b/dev-python/pysimdjson/files/pysimdjson-5.0.2-system-lib.patch new file mode 100644 index 000000000000..0a419e5dbc40 --- /dev/null +++ b/dev-python/pysimdjson/files/pysimdjson-5.0.2-system-lib.patch @@ -0,0 +1,72 @@ +diff --git a/setup.py b/setup.py +index 865544d..24fdc36 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,5 +1,6 @@ + import os.path + import platform ++import itertools + + from setuptools import setup, find_packages, Extension + +@@ -17,11 +18,18 @@ with open(os.path.join(root, 'README.md'), 'rb') as readme: + + system = platform.system() + ++libraries = [] ++extra_sources = [] + extra_compile_args = [] + + if system == 'Darwin': + extra_compile_args.append('-std=c++11') + ++if os.getenv('BUILD_WITH_SYSTEM_LIB'): ++ libraries.append('simdjson') ++else: ++ extra_sources.append('simdjson/simdjson.cpp') ++ + if os.getenv('BUILD_WITH_CYTHON') and not CYTHON_AVAILABLE: + print( + 'BUILD_WITH_CYTHON environment variable is set, but cython' +@@ -49,12 +57,15 @@ if os.getenv('BUILD_WITH_CYTHON') and CYTHON_AVAILABLE: + extensions = cythonize([ + Extension( + 'csimdjson', +- [ +- 'simdjson/simdjson.cpp', +- 'simdjson/util.cpp', +- 'simdjson/csimdjson.pyx' +- ], ++ list(itertools.chain( ++ [ ++ 'simdjson/util.cpp', ++ 'simdjson/csimdjson.pyx' ++ ], ++ extra_sources ++ )), + define_macros=macros, ++ libraries=libraries, + extra_compile_args=extra_compile_args + ) + ], compiler_directives=compiler_directives, force=force) +@@ -62,12 +73,15 @@ else: + extensions = [ + Extension( + 'csimdjson', +- [ +- 'simdjson/simdjson.cpp', +- 'simdjson/util.cpp', +- 'simdjson/csimdjson.cpp' +- ], ++ list(itertools.chain( ++ [ ++ 'simdjson/util.cpp', ++ 'simdjson/csimdjson.cpp' ++ ], ++ extra_sources ++ )), + extra_compile_args=extra_compile_args, ++ libraries=libraries, + language='c++' + ) + ] diff --git a/dev-python/pysimdjson/files/pysimdjson-5.0.2-tests.patch b/dev-python/pysimdjson/files/pysimdjson-5.0.2-tests.patch new file mode 100644 index 000000000000..a70143b134f6 --- /dev/null +++ b/dev-python/pysimdjson/files/pysimdjson-5.0.2-tests.patch @@ -0,0 +1,13 @@ +diff --git a/simdjson/csimdjson.pyx b/simdjson/csimdjson.pyx +index 57c5f35..91182fc 100644 +--- a/simdjson/csimdjson.pyx ++++ b/simdjson/csimdjson.pyx +@@ -480,7 +480,7 @@ cdef class Parser: + # a stride in the next step will cause a (potentially + # confusing) IndexError. This isn't a very good error message, + # but it's identical to the one simdjson would have raised. +- raise ValueError('Empty: no JSON found') ++ raise ValueError('EMPTY: no JSON found') + + return element_to_primitive( + self, -- cgit v1.2.3