lbry-android-sdk/p4a/pythonforandroid/recipes/numpy/patches/python-fixes.patch
Akinwale Ariwodola 8b2694efb7
New build (#508)
* fix build for openssl 1.1.1b required for sdk
(cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977)

* use js code from master

* fix openssl recipe and tweak build
(cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e)

* remove unused build recipes
(cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
2019-03-30 21:58:45 +01:00

69 lines
2.3 KiB
Diff

diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index c70f852..695efd5 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -852,3 +852,12 @@ _may_have_objects(PyArray_Descr *dtype)
return (PyDataType_HASFIELDS(base) ||
PyDataType_FLAGCHK(base, NPY_ITEM_HASOBJECT) );
}
+
+/*
+ * Dummy to fix android NDK problem with missing reference.
+ */
+void *
+__emutls_get_address(struct __emutls_object *obj)
+{
+ return NULL;
+}
diff --git a/numpy/distutils/exec_command.py b/numpy/distutils/exec_command.py
index 8118e2f..b586442 100644
--- a/numpy/distutils/exec_command.py
+++ b/numpy/distutils/exec_command.py
@@ -260,7 +260,7 @@ def _exec_command(command, use_shell=None, use_tee = None, **env):
return 127, ''
text, err = proc.communicate()
- text = text.decode(locale.getpreferredencoding(False),
+ text = text.decode('UTF-8',
errors='replace')
text = text.replace('\r\n', '\n')
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
index f2d677a..758b1ed 100644
--- a/numpy/distutils/misc_util.py
+++ b/numpy/distutils/misc_util.py
@@ -9,7 +9,6 @@ import atexit
import tempfile
import subprocess
import shutil
-import multiprocessing
import distutils
from distutils.errors import DistutilsError
@@ -93,10 +92,7 @@ def get_num_build_jobs():
"""
from numpy.distutils.core import get_distribution
- try:
- cpu_count = len(os.sched_getaffinity(0))
- except AttributeError:
- cpu_count = multiprocessing.cpu_count()
+ cpu_count = 1
envjobs = int(os.environ.get("NPY_NUM_BUILD_JOBS", cpu_count))
dist = get_distribution()
# may be None during configuration
diff --git a/setup.py b/setup.py
index fed178e..b0266eb 100755
--- a/setup.py
+++ b/setup.py
@@ -377,9 +377,8 @@ def setup_package():
# Raise errors for unsupported commands, improve help output, etc.
run_build = parse_setuppy_commands()
- from setuptools import setup
+ from numpy.distutils.core import setup
if run_build:
- from numpy.distutils.core import setup
cwd = os.path.abspath(os.path.dirname(__file__))
if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
# Generate Cython sources, unless building from source release