mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-04 14:40:16 +00:00
- 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.
18 lines
440 B
Bash
18 lines
440 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 prebuild.py
|
|
|
|
rm -rf web/lib
|
|
mkdir web/lib
|
|
|
|
SRC=$(find src/ -name "*.c")
|
|
|
|
emcc $SRC -Iinclude/ -s -Os \
|
|
-sEXPORTED_FUNCTIONS=_py_initialize,_py_exec,_py_finalize,_py_printexc,_py_clearexc \
|
|
-sEXPORTED_RUNTIME_METHODS=ccall \
|
|
-sALLOW_MEMORY_GROWTH=1 \
|
|
-o web/lib/pocketpy.js
|