cutter/scripts/prepare_python_macos.sh

26 lines
864 B
Bash
Raw Normal View History

2018-04-14 09:39:44 +00:00
#!/bin/bash
2018-12-08 11:43:40 +00:00
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
2018-04-14 09:39:44 +00:00
mkdir python && cd python
wget "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz" || exit 1
tar -xf Python-3.9.1.tar.xz || exit 1
2018-04-14 09:39:44 +00:00
export PYTHON_FRAMEWORK_DIR="`pwd`/framework"
cd Python-3.9.1 || exit 1
2018-04-14 09:39:44 +00:00
CPPFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" ./configure --enable-framework=$PYTHON_FRAMEWORK_DIR || exit 1
# Patch for https://github.com/rizinorg/cutter/issues/424
sed -i ".original" "s/#define HAVE_GETENTROPY 1/#define HAVE_GETENTROPY 0/" pyconfig.h
2018-04-14 09:39:44 +00:00
make -j4 || exit 1
make frameworkinstallframework > /dev/null || exit 1
PYTHONHOME=$PYTHON_FRAMEWORK_DIR/Python.framework/Versions/Current \
2018-12-08 11:43:40 +00:00
$PYTHON_FRAMEWORK_DIR/Python.framework/Versions/Current/bin/pip3 install -r "$SCRIPTPATH/pip_requirements.txt" || exit 1
2018-04-14 09:39:44 +00:00
cd ../..