Skip to content

Commit e328668

Browse files
committed
remove conflicting symlinks in bin folder
1 parent e68e612 commit e328668

File tree

7 files changed

+72
-70
lines changed

7 files changed

+72
-70
lines changed

scripts/cpython-build-emsdk-deps.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@
44

55
. ./scripts/emsdk-fetch.sh
66

7-
# echo " ${PIMINOR}"|grep -q 11$
8-
if true
9-
then
10-
HPFX=./devices/x86_64/usr/lib/python${PYBUILD}
11-
rm ./devices/emsdk/usr/lib/python${PYBUILD}/ensurepip/_bundled/setuptools-*-py3-none-any.whl
12-
cp -Rf $HPFX/setuptool* ./devices/emsdk/usr/lib/python${PYBUILD}/
13-
cp -Rf $HPFX/_distutils* ./devices/emsdk/usr/lib/python${PYBUILD}/
14-
cp -Rf $HPFX/pkg_resources ./devices/emsdk/usr/lib/python${PYBUILD}/
15-
fi
7+
HPFX=./devices/x86_64/usr/lib/python${PYBUILD}
8+
9+
for moveit in setuptools distutils _distutils _distutils_hack pkg_resources
10+
do
11+
if [ -d $HPFX/site-packages/${moveit} ]
12+
then
13+
echo "
14+
* migrating ${moveit}
15+
"
16+
cp -rf $HPFX/site-packages/${moveit} $HPFX/
17+
cp -rf $HPFX/site-packages/${moveit}-* $HPFX/
18+
fi
19+
done
20+
21+
22+
1623

1724
# ../../devices/x86_64/usr/bin/python3-wasm -mpip install .
1825
# not working because python startup is skipped

scripts/cpython-build-emsdk.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ then
2828
REBUILD=true
2929
fi
3030

31+
# 3.10 is not wasm stable
32+
if [ -f support/__EMSCRIPTEN__.patches/${PYBUILD}.diff ]
33+
then
34+
pushd src/cpython 2>&1 >/dev/null
35+
patch -p1 < ../../support/__EMSCRIPTEN__.patches/${PYBUILD}.diff
36+
popd 2>&1 >/dev/null
37+
fi
3138

3239

3340
if [ -f $EMSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libffi.a ]

scripts/cpython-build-host-deps.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ $PIP install setuptools --upgrade
2121
HPFX=./devices/x86_64/usr/lib/python${PYBUILD}
2222
rm -rf $HPFX/ensurepip/_bundled/*-py3-none-any.whl
2323

24-
2524
for moveit in setuptools _distutils _distutils_hack pkg_resources
2625
do
2726
if [ -d $HPFX/site-packages/${moveit} ]
@@ -41,7 +40,6 @@ then
4140
fi
4241

4342

44-
4543
# https://github.com/aroberge/ideas, for code transformation
4644
$PIP install token-utils
4745

scripts/cpython-fetch.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ mkdir -p src
1111
pushd src 2>&1 >/dev/null
1212

1313
NOPATCH=false
14+
PYPATCH=true
15+
1416
[ -L cpython ] && rm cpython
1517

1618
[ -f $HPY ] || REBUILD=true
@@ -56,10 +58,15 @@ if echo $PYBUILD | grep -q 10$
5658
then
5759
wget -q -c https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tar.xz
5860
tar xf Python-3.10.5.tar.xz
59-
ln -s Python-3.10.5 cpython
6061

61-
#tar xfj /data/git/python-wasm-sdk/src/Python-3.10.5-pydk.tar.bz2
62-
#ln -s Python-3.10.5-pydk cpython
62+
if [ -d Python-3.10.5-pydk ]
63+
then
64+
PYPATCH=false
65+
ln -s Python-3.10.5 cpython
66+
else
67+
PYPATCH=true
68+
ln -s Python-3.10.5 cpython
69+
fi
6370

6471
NOPATCH=true
6572
export REBUILD=true
@@ -72,10 +79,11 @@ popd
7279
if [ -f support/__EMSCRIPTEN__.patches/${PYBUILD}.diff ]
7380
then
7481
pushd src/cpython 2>&1 >/dev/null
75-
patch -p1 < ../../support/__EMSCRIPTEN__.patches/${PYBUILD}.diff
82+
patch -p1 < ../../support/__EMSCRIPTEN__.patches/${PYBUILD}-host.diff
7683
popd 2>&1 >/dev/null
7784
fi
7885

86+
7987
# the sys._emscripten_info is actually not compatible with shared build
8088
# just move its stuff to main
8189

scripts/emsdk-fetch.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ IS_SHARED=false
8484
for arg do
8585
shift
8686
87+
if [ "\$arg" = "-v" ]
88+
then
89+
\$EMSDK_PYTHON -E \$0.py -v
90+
exit 0
91+
fi
92+
8793
# that is for some very bad setup.py behaviour regarding cross compiling. should not be needed ..
8894
[ "\$arg" = "-I/usr/include" ] && continue
8995
[ "\$arg" = "-I/usr/include/SDL2" ] && continue

0 commit comments

Comments
 (0)