diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2021-02-23 06:04:33 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2021-02-23 06:04:33 +0300 |
commit | 9fe53bd4a1ac0eaa63fcf1ebd151fe4db0411b49 (patch) | |
tree | fe165c397b1d4f5bd42a351b1388d38794a9abd6 /build_files/build_environment/patches/python_unix.diff | |
parent | d447bd3e4a9a793364b5f4951ad280fe0293d79e (diff) |
Build Environment/macOS/Python: link against zlib statically
rBc70eb30240f8b5d5a8f2ac509f0eb585936142b5 added patch to use static
zlib on Linux. But also added flags to use the zlib in LIBDIR for
Python on macOS. That causes some shared libraries (binascii for one)
to link against libz.1.dylib which will not be there on users' systems.
Reuse the said patch for macOS also to avoid rpath issues.
Fix T85648.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10479
Diffstat (limited to 'build_files/build_environment/patches/python_unix.diff')
-rw-r--r-- | build_files/build_environment/patches/python_unix.diff | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/build_files/build_environment/patches/python_unix.diff b/build_files/build_environment/patches/python_unix.diff new file mode 100644 index 00000000000..a9baae8ce32 --- /dev/null +++ b/build_files/build_environment/patches/python_unix.diff @@ -0,0 +1,38 @@ +diff --git a/setup.py.orig b/setup.py +index a97a755..07ce853 100644 +--- a/setup.py.orig ++++ b/setup.py +@@ -1603,13 +1603,13 @@ + version = line.split()[2] + break + if version >= version_req: +- if (self.compiler.find_library_file(self.lib_dirs, 'z')): ++ if (self.compiler.find_library_file(self.lib_dirs, 'z_pic')): + if MACOS: + zlib_extra_link_args = ('-Wl,-search_paths_first',) + else: + zlib_extra_link_args = () + self.add(Extension('zlib', ['zlibmodule.c'], +- libraries=['z'], ++ libraries=['z_pic'], + extra_link_args=zlib_extra_link_args)) + have_zlib = True + else: +@@ -1623,7 +1623,7 @@ + # crc32 if we have it. Otherwise binascii uses its own. + if have_zlib: + extra_compile_args = ['-DUSE_ZLIB_CRC32'] +- libraries = ['z'] ++ libraries = ['z_pic'] + extra_link_args = zlib_extra_link_args + else: + extra_compile_args = [] +@@ -2168,7 +2168,7 @@ + ffi_inc = None + print('Header file {} does not exist'.format(ffi_h)) + if ffi_lib is None and ffi_inc: +- for lib_name in ('ffi', 'ffi_pic'): ++ for lib_name in ('ffi_pic', ): + if (self.compiler.find_library_file(self.lib_dirs, lib_name)): + ffi_lib = lib_name + break |