Skip to content

Commit a6d81df

Browse files
committed
0.0.5
1 parent e4bf8a9 commit a6d81df

File tree

4 files changed

+76
-6
lines changed

4 files changed

+76
-6
lines changed

config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
export LC_ALL=C
33
export PYTHONDONTWRITEBYTECODE=1
44
export REBUILD=${REBUILD:-false}
5-
export ROOT=${ROOT:-$(pwd)}
5+
export ROOT=/opt/python-wasm-sdk
6+
mkdir -p /opt/python-wasm-sdk/build/pycache
67
export HOST_PREFIX=${HOST_PREFIX:-$ROOT/devices/$(arch)/usr}
78
export PREFIX=${PREFIX:-${ROOT}/devices/emsdk/usr}
89
export PYTHONPYCACHEPREFIX=$(realpath ${ROOT}/build/pycache)
910

1011
export HPY=$(echo -n ${HOST_PREFIX}/bin/python3.1?)
1112
export PIP=$(echo -n ${HOST_PREFIX}/bin/pip3.$(echo $HPY|cut -d. -f2))
1213

13-
1414
export CI=${CI:-false}
1515

1616
# cpython build opts

python-wasm-build.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
$@

python-wasm-sdk.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ then
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

scripts/cpython-fetch.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ then
3838

3939
else
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
4448
fi
4549

4650
popd

0 commit comments

Comments
 (0)