summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2020-11-15 13:30:34 +0000
committerTor Lillqvist <tml@collabora.com>2020-11-15 16:54:02 +0100
commit0b95a5f9d50db5ac6c09ce5dbfb49b76e292b96f (patch)
tree7ebde34c5fb890198a017df12100c34903340037 /external
parent0c14e5154c8931d96b2dfe1c1ab00c97d993f094 (diff)
Make python3 build on macOS 11, including for arm64
There is no /usr/lib/libz.dylib any longer in macOS 11. No idea whether it works (especially on arm64), but that is another issue. Change-Id: I92ac0c500388730eca0be4766f07b1af2d2808e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105897 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/python3/UnpackedTarball_python3.mk1
-rw-r--r--external/python3/macos-11.patch.038
2 files changed, 39 insertions, 0 deletions
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index 94950537386c..ea54b630f752 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/ubsan.patch.0 \
external/python3/python-3.5.tweak.strip.soabi.patch \
external/python3/darwin.patch.0 \
+ external/python3/macos-11.patch.0 \
))
ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0
new file mode 100644
index 000000000000..d6bc4e539d12
--- /dev/null
+++ b/external/python3/macos-11.patch.0
@@ -0,0 +1,38 @@
+-*- Mode: diff -*-
+--- configure
++++ configure
+@@ -9372,6 +9275,9 @@
+ esac
+ else
+ case `/usr/bin/arch` in
++ arm64)
++ MACOSX_DEFAULT_ARCH="arm64"
++ ;;
+ i386)
+ MACOSX_DEFAULT_ARCH="x86_64"
+ ;;
+--- Mac/Tools/pythonw.c
++++ Mac/Tools/pythonw.c
+@@ -121,6 +121,8 @@
+ cpu_types[0] = CPU_TYPE_POWERPC;
+ #elif defined(__i386__)
+ cpu_types[0] = CPU_TYPE_X86;
++#elif defined(__arm64__)
++ cpu_types[0] = CPU_TYPE_ARM64;
+ #else
+ # error "Unknown CPU"
+ #endif
+--- setup.py
++++ setup.py
+@@ -670,7 +670,10 @@
+ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
++ if MACOS:
++ system_lib_dirs = ['/usr/lib', macosx_sdk_root()+'/usr/lib']
++ else:
++ system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
+ system_include_dirs = ['/usr/include']
+ # lib_dirs and inc_dirs are used to search for files;
+ # if a file is found in one of those directories, it can