File tree Expand file tree Collapse file tree 4 files changed +76
-6
lines changed Expand file tree Collapse file tree 4 files changed +76
-6
lines changed Original file line number Diff line number Diff line change 22export LC_ALL=C
33export PYTHONDONTWRITEBYTECODE=1
44export REBUILD=${REBUILD:- false}
5- export ROOT=${ROOT:- $(pwd)}
5+ export ROOT=/opt/python-wasm-sdk
6+ mkdir -p /opt/python-wasm-sdk/build/pycache
67export HOST_PREFIX=${HOST_PREFIX:- $ROOT / devices/ $(arch)/ usr}
78export PREFIX=${PREFIX:- ${ROOT} / devices/ emsdk/ usr}
89export PYTHONPYCACHEPREFIX=$( realpath ${ROOT} /build/pycache)
910
1011export HPY=$( echo -n ${HOST_PREFIX} /bin/python3.1? )
1112export PIP=$( echo -n ${HOST_PREFIX} /bin/pip3.$( echo $HPY | cut -d. -f2) )
1213
13-
1414export CI=${CI:- false}
1515
1616# cpython build opts
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ export LC_ALL=C
3+ export PYTHONDONTWRITEBYTECODE=1
4+ export REBUILD=${REBUILD:- false}
5+ export ROOT=/opt/python-wasm-sdk
6+ mkdir -p /opt/python-wasm-sdk/build/pycache
7+ export HOST_PREFIX=${HOST_PREFIX:- $ROOT / devices/ $(arch)/ usr}
8+ export PREFIX=${PREFIX:- ${ROOT} / devices/ emsdk/ usr}
9+ export PYTHONPYCACHEPREFIX=$( realpath ${ROOT} /build/pycache)
10+
11+ export HPY=$( echo -n ${HOST_PREFIX} /bin/python3.1? )
12+ export PIP=$( echo -n ${HOST_PREFIX} /bin/pip3.$( echo $HPY | cut -d. -f2) )
13+
14+ export CI=${CI:- false}
15+
16+ # cpython build opts
17+ export CPOPTS=" -Os -g0 -fPIC"
18+ export CPPFLAGS=" -I$PREFIX /include"
19+ export LDFLAGS=" -L$PREFIX /lib"
20+
21+ # module build opts
22+ export CFLDPFX=" $CPPFLAGS $LDFLAGS -Wno-unused-command-line-argument"
23+
24+ if [ -f /opt/python-wasm-sdk/dev ]
25+ then
26+ export COPTS=" -O0 -g3 -fPIC"
27+ export VERBOSE=" "
28+ else
29+ export COPTS=" -Os -g0 -fPIC"
30+ export VERBOSE=" 2>&1 > $PYTHONPYCACHEPREFIX /.log"
31+ fi
32+
33+ # stable
34+ # EMFLAVOUR=latest
35+ # git
36+ EMFLAVOUR=tot
37+
38+ export PYDK_PYTHON_HOST_PLATFORM=wasm32-$EMFLAVOUR -emscripten
39+
40+ if echo $LD_LIBRARY_PATH | grep -q ${HOST} /lib
41+ then
42+ # config already set
43+ echo -n
44+ else
45+ # export LD_LIBRARY_PATH="${HOST_PREFIX}/lib:$LD_LIBRARY_PATH"
46+ export LD_LIBRARY_PATH=" ${HOST_PREFIX} /lib"
47+ fi
48+
49+ if [[ ! -z ${PYDK+z} ]]
50+ then
51+ # config already set
52+ echo -n
53+ else
54+ mkdir -p src
55+ export PKG_CONFIG_PATH=" ${PREFIX} /lib/pkgconfig"
56+ export PATH=" ${HOST_PREFIX} /bin:$PATH "
57+ export PYDK=minimal
58+ fi
59+
60+ $@
Original file line number Diff line number Diff line change 3535 cd /
3636 rm -rf ${SDKDIR} /emsdk/upstream/emscripten/cache
3737 mkdir -p ${SDKDIR} /sdk
38- tar -cpRj .${SDKDIR} /config .${SDKDIR} /emsdk .${SDKDIR} /devices/* .${SDKDIR} /prebuilt/* > ${SDKDIR} /sdk/python-wasm-sdk-stable.tar.bz2
38+ tar -cpRj \
39+ .${SDKDIR} /config \
40+ .${SDKDIR} /${PYDK_PYTHON_HOST_PLATFORM} -shell.sh \
41+ .${SDKDIR} /emsdk \
42+ .${SDKDIR} /devices/* \
43+ .${SDKDIR} /prebuilt/* \
44+ > ${SDKDIR} /sdk/python-wasm-sdk-stable.tar.bz2
3945 else
4046 echo " cpython-build-emsdk-deps failed"
4147 exit 2
Original file line number Diff line number Diff line change 3838
3939else
4040 rm cpython 2> /dev/null
41- wget -q -c https://www.python.org/ftp/python/3.11.0/Python-3.11.0b1.tar.xz
42- tar xf Python-3.11.0b1.tar.xz
43- ln -s Python-3.11.0b1 cpython
41+ # wget -q -c https://www.python.org/ftp/python/3.11.0/Python-3.11.0b1.tar.xz
42+ # tar xf Python-3.11.0b1.tar.xz
43+ # ln -s Python-3.11.0b1 cpython
44+
45+ wget -q -c https://www.python.org/ftp/python/3.11.0/Python-3.11.0b3.tar.xz
46+ tar xf Python-3.11.0b3.tar.xz
47+ ln -s Python-3.11.0b3 cpython
4448fi
4549
4650popd
You can’t perform that action at this time.
0 commit comments