[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - external/python3

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 24 09:12:27 UTC 2020


 external/python3/UnpackedTarball_python3.mk |    1 
 external/python3/macos-11.patch.0           |   59 ++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

New commits:
commit e9e55666ed4e3f3a6fa0a76947a3288d30909bfd
Author:     Tor Lillqvist <tml at iki.fi>
AuthorDate: Sun Nov 15 13:30:34 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 24 10:11:50 2020 +0100

    Make python3 build on macOS 11, including for arm64
    
    A combination of what is two separate commits in master.
    
    Change-Id: I92ac0c500388730eca0be4766f07b1af2d2808e0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106471
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index d04868b93a44..fb693e70de7e 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -24,6 +24,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..d3dbbf605639
--- /dev/null
+++ b/external/python3/macos-11.patch.0
@@ -0,0 +1,59 @@
+-*- Mode: diff -*-
+--- configure
++++ configure
+@@ -3374,7 +3374,7 @@
+   # has no effect, don't bother defining them
+   Darwin/[6789].*)
+     define_xopen_source=no;;
+-  Darwin/1[0-9].*)
++  Darwin/[12][0-9].*)
+     define_xopen_source=no;;
+   # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
+   # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
+@@ -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 host_platform == 'darwin':
++            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
+--- Modules/_decimal/libmpdec/mpdecimal.h
++++ Modules/_decimal/libmpdec/mpdecimal.h
+@@ -135,6 +135,9 @@
+   #elif defined(__x86_64__)
+     #define CONFIG_64
+     #define ASM
++  #elif defined(__arm64__)
++    #define CONFIG_64
++    #define ANSI
+   #else
+     #error "unknown architecture for universal build."
+   #endif


More information about the Libreoffice-commits mailing list