Skip to content

Commit 79e7bb5

Browse files
committed
wasm prebuilt/cython install fixes
1 parent 8243d76 commit 79e7bb5

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

python-wasm-sdk.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ do
6464
./scripts/emsdk-fetch.sh
6565

6666
echo " ------------ building cpython wasm ${PYBUILD} ${CIVER} ----------------" 1>&2
67+
6768
if ./scripts/cpython-build-emsdk.sh > /dev/null
6869
then
6970
echo " ---------- building cpython wasm plus ${PYBUILD} ${CIVER} -----------" 1>&2

scripts/cpython-build-emsdk-prebuilt.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ CYTHON_WHL=${CYTHON:-Cython-${CYTHON_REL}-py2.py3-none-any.whl}
77

88
$HPY -m pip install --upgrade pip
99

10-
pushd src
10+
pushd build
1111
wget -q -c https://github.com/cython/cython/releases/download/${CYTHON_REL}/${CYTHON_WHL}
1212
$HPY install --upgrade $CYTHON_WHL
13-
podp
13+
popd
1414

1515

16-
PIP="$(realpath python3-wasm) -m pip"
16+
PIP="${SDKROOT}/python3-wasm -m pip"
1717

1818
echo "
1919
* cpython-build-emsdk-prebuilt pip==$PIP *
@@ -39,21 +39,14 @@ do
3939
done
4040

4141

42-
pushd src
43-
$PIP install $CYTHON
44-
45-
46-
47-
48-
49-
50-
51-
42+
$PIP install build/$CYTHON_WHL
5243

5344

5445

46+
pushd src
5547

5648

49+
# TODO
5750

5851

5952

scripts/cpython-build-emsdk.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ else
6161
#TODO: check if export PATH=${HOST_PREFIX}/bin:$PATH is really set to avoid system python with different bytecode
6262
#and no loder lib-dynload in the way.
6363

64-
export EMCC_CFLAGS="-O0 -g0 -fPIC"
65-
66-
CFLAGS="-O0 -g0 -fPIC" \
67-
emconfigure $ROOT/src/libffi/configure --host=wasm32-tot-linux\
64+
EMCC_CFLAGS="-O0 -g0 -fPIC" CFLAGS="-O0 -g0 -fPIC" CC=${SDKROOT}/emsdk/upstream/emscripten/emcc \
65+
emconfigure $ROOT/src/libffi/configure --host=wasm32-mvp-emscripten\
6866
--prefix=$PREFIX --enable-static --disable-shared --disable-dependency-tracking\
6967
--disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs
7068

@@ -281,6 +279,18 @@ IS_SHARED=false
281279
for arg do
282280
shift
283281
282+
if [ "\$arg" = "-v" ]
283+
then
284+
\$SYS_PYTHON -E \$0.py -v
285+
exit 0
286+
fi
287+
288+
if [ "\$arg" = "--version" ]
289+
then
290+
\$SYS_PYTHON -E \$0.py --version
291+
exit 0
292+
fi
293+
284294
# that is for some very bad setup.py behaviour regarding cross compiling. should not be needed ..
285295
[ "\$arg" = "-I/usr/include" ] && continue
286296
[ "\$arg" = "-I/usr/include/SDL2" ] && continue

scripts/emsdk-fetch.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ for arg do
102102
exit 0
103103
fi
104104
105+
if [ "\$arg" = "--version" ]
106+
then
107+
\$EMSDK_PYTHON -E \$0.py --version
108+
exit 0
109+
fi
110+
105111
# that is for some very bad setup.py behaviour regarding cross compiling. should not be needed ..
106112
[ "\$arg" = "-I/usr/include" ] && continue
107113
[ "\$arg" = "-I/usr/include/SDL2" ] && continue

0 commit comments

Comments
 (0)