From 7bfa37c9bb0d06643ac7abf31ecadaa68edf6e11 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Dec 2021 20:58:56 +0530 Subject: [PATCH] Fix for Apple's cheap ass freeloading on libxml2 Trillion dollar company that cant write its own XML parser. And libxml2 is currently going begging for a lack of maintainers. Silicon valley really makes my blood boil. Fucking armpit of the universe. --- bypy/macos/__main__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bypy/macos/__main__.py b/bypy/macos/__main__.py index 9bd9f8ec22..92bbb0f47e 100644 --- a/bypy/macos/__main__.py +++ b/bypy/macos/__main__.py @@ -65,7 +65,13 @@ def compile_launcher_lib(contents_dir, gcc, base, pyver, inc_dir): [f'-DENV_VARS={env}', f'-DENV_VAR_VALS={env_vals}'] + \ ['-I%s/python/Python.framework/Versions/Current/Headers' % PREFIX] + \ '-current_version 1.0 -compatibility_version 1.0'.split() + \ - '-fvisibility=hidden -o'.split() + [dest] + \ + '-fvisibility=hidden -o'.split() + [dest] + # We need libxml2.dylib linked because Apple's system frameworks link + # against a system version. And libxml2 uses global variables so we get + # crashes if the system libxml2 is loaded. Loading plugins like the Qt + # ones or usbobserver causes it to be loaded. So pre-load our libxml2 + # to avoid it. + cmd += ['-L', f'{PREFIX}/lib', '-l', 'xml2'] + \ ['-install_name', '@executable_path/../Frameworks/' + os.path.basename(dest)] + \ [('-F%s/python' % PREFIX), '-framework', 'Python', '-framework', 'CoreFoundation', '-headerpad_max_install_names']