2019-06-13 00:55:29 +02:00
|
|
|
#!/bin/sh
|
2019-08-27 14:02:50 -07:00
|
|
|
# Copyright 2019 The Emscripten Authors. All rights reserved.
|
|
|
|
|
# Emscripten is available under two separate licenses, the MIT license and the
|
|
|
|
|
# University of Illinois/NCSA Open Source License. Both these licenses can be
|
|
|
|
|
# found in the LICENSE file.
|
2013-09-05 16:42:27 +03:00
|
|
|
|
2019-08-27 14:02:50 -07:00
|
|
|
# Wrapper script that runs emsdk.py
|
2019-04-29 15:39:20 -07:00
|
|
|
|
2021-03-12 17:29:56 +02:00
|
|
|
# First look for python bundled in Emsdk
|
2020-07-21 10:21:02 -07:00
|
|
|
if [ -z "$EMSDK_PYTHON" ]; then
|
2021-03-12 17:29:56 +02:00
|
|
|
PYTHON3=$(dirname $0)/python/3.9.2-1_64bit/bin/python3
|
|
|
|
|
PYTHON3_CERT_FILE=$(dirname $0)/python/3.9.2-1_64bit/lib/python3.9/site-packages/certifi/cacert.pem
|
|
|
|
|
if [ ! -f $PYTHON3 ]; then
|
|
|
|
|
PYTHON3=$(dirname $0)/python/3.7.4-2_64bit/bin/python3
|
|
|
|
|
PYTHON3_CERT_FILE=$(dirname $0)/python/3.7.4-2_64bit/lib/python3.7/site-packages/certifi/cacert.pem
|
|
|
|
|
fi
|
|
|
|
|
if [ -f $PYTHON3 ]; then
|
2020-09-17 15:38:54 -07:00
|
|
|
EMSDK_PYTHON=$PYTHON3
|
2020-10-24 10:01:10 -07:00
|
|
|
|
2020-09-17 15:38:54 -07:00
|
|
|
# When using our bundled python we never want the users
|
|
|
|
|
# PYTHONHOME or PYTHONPATH
|
|
|
|
|
# https://github.com/emscripten-core/emsdk/issues/598
|
|
|
|
|
unset PYTHONHOME
|
|
|
|
|
unset PYTHONPATH
|
2020-10-24 10:01:10 -07:00
|
|
|
|
|
|
|
|
# This is needed for MacOS. Without this, the urlopen
|
|
|
|
|
# code will try to use /usr/local/etc/openssl/cert.pem
|
|
|
|
|
# which may or may not exist on the system.
|
2021-03-12 17:29:56 +02:00
|
|
|
export SSL_CERT_FILE=$PYTHON3_CERT_FILE
|
2020-07-21 10:21:02 -07:00
|
|
|
fi
|
2019-08-27 14:02:50 -07:00
|
|
|
fi
|
2013-09-05 16:42:27 +03:00
|
|
|
|
2021-03-12 17:29:56 +02:00
|
|
|
# If bundled python is not found, look for `python3` in PATH. This is especially important on macOS (See:
|
2020-09-17 15:38:54 -07:00
|
|
|
# https://github.com/emscripten-core/emsdk/pull/273)
|
|
|
|
|
if [ -z "$EMSDK_PYTHON" ]; then
|
|
|
|
|
PYTHON3=$(which python3 2> /dev/null)
|
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
|
EMSDK_PYTHON=$PYTHON3
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Finally fall back to just looking for `python` in PATH
|
|
|
|
|
if [ -z "$EMSDK_PYTHON" ]; then
|
|
|
|
|
EMSDK_PYTHON=python
|
|
|
|
|
fi
|
|
|
|
|
|
2020-07-21 10:21:02 -07:00
|
|
|
exec "$EMSDK_PYTHON" "$0.py" "$@"
|