pocketpy/build_darwin_libs.sh
Kanika Kapoor c7572c76ba Fix amalgamation script to work with python3-only environments (#444)
- Use sys.executable in Python scripts (amalgamate.py, cmake_build.py) instead of hardcoded 'python'
- Update shell scripts to prefer python3 over python with fallback
- Fix scripts/run_tests.py to detect python3 for CPython benchmarking

This fixes the issue where the amalgamation script fails on Linux systems
that only have python3 available and no 'python' symlink.
2025-12-27 00:42:53 +05:30

27 lines
549 B
Bash

set -e
# Use python3 if available, otherwise fall back to python
PYTHON=$(command -v python3 >/dev/null 2>&1 && echo python3 || echo python)
$PYTHON amalgamate.py
rm -rf build
mkdir build
cd build
FLAGS="-DPK_BUILD_STATIC_LIB=ON \
-DPK_ENABLE_OS=OFF \
-DPK_ENABLE_DETERMINISM=ON \
-DPK_BUILD_MODULE_LZ4=ON \
-DPK_BUILD_MODULE_CUTE_PNG=ON \
-DPK_BUILD_MODULE_MSGPACK=ON \
-DCMAKE_BUILD_TYPE=Release \
"
cmake -G Xcode $FLAGS ..
cmake --build . --config Release
cd ../
$PYTHON scripts/merge_built_libraries.py build