Fix mac python by avoiding linking libintl
Fixes: #980
diff --git a/emsdk_manifest.json b/emsdk_manifest.json
index d3e0692..0a6a139 100644
--- a/emsdk_manifest.json
+++ b/emsdk_manifest.json
@@ -434,7 +434,7 @@
"version": "3.9.2",
"bitness": 64,
"arch": "x86_64",
- "macos_url": "python-3.9.2-2-macos-x86_64.tar.gz",
+ "macos_url": "python-3.9.2-3-macos-x86_64.tar.gz",
"activated_cfg": "PYTHON='%installation_dir%/bin/python3'",
"activated_env": "EMSDK_PYTHON=%installation_dir%/bin/python3;SSL_CERT_FILE=%installation_dir%/lib/python3.9/site-packages/certifi/cacert.pem"
},
diff --git a/scripts/update_python.py b/scripts/update_python.py
index 1ddf76c..f598954 100755
--- a/scripts/update_python.py
+++ b/scripts/update_python.py
@@ -34,7 +34,7 @@
version = '3.9.2'
major_minor_version = '.'.join(version.split('.')[:2]) # e.g. '3.9.2' -> '3.9'
base = 'https://www.python.org/ftp/python/%s/' % version
-revision = '2'
+revision = '3'
pywin32_version = '227'
pywin32_base = 'https://github.com/mhammond/pywin32/releases/download/b%s/' % pywin32_version
@@ -103,8 +103,9 @@
def build_python():
if sys.platform.startswith('darwin'):
+ # Take some rather drastic steps to link openssl and liblzma statically
+ # and avoid linking libintl completely.
osname = 'macos'
- # Take some rather drastic steps to link openssl statically
check_call(['brew', 'install', 'openssl', 'xz', 'pkg-config'])
if platform.machine() == 'x86_64':
prefix = '/usr/local'
@@ -117,12 +118,13 @@
# this for Linux too, move this below?)
osname += '-' + platform.machine()
- try:
- os.remove(os.path.join(prefix, 'opt', 'openssl', 'lib', 'libssl.dylib'))
- os.remove(os.path.join(prefix, 'opt', 'openssl', 'lib', 'libcrypto.dylib'))
- os.remove(os.path.join(prefix, 'opt', 'xz', 'lib', 'liblzma.dylib'))
- except Exception:
- pass
+ for f in [os.path.join(prefix, 'lib', 'libintl.dylib'),
+ os.path.join(prefix, 'include', 'libintl.h'),
+ os.path.join(prefix, 'opt', 'xz', 'lib', 'liblzma.dylib'),
+ os.path.join(prefix, 'opt', 'openssl', 'lib', 'libssl.dylib'),
+ os.path.join(prefix, 'opt', 'openssl', 'lib', 'libcrypto.dylib')]:
+ if os.path.exists(f):
+ os.remove(f)
os.environ['PKG_CONFIG_PATH'] = os.path.join(prefix, 'opt', 'openssl', 'lib', 'pkgconfig')
else:
osname = 'linux'