|
3 | 3 | . ${CONFIG:-config} |
4 | 4 |
|
5 | 5 | echo " |
6 | | - *cpython-fetch* |
| 6 | + *cpython-fetch $PYBUILD* |
7 | 7 | " |
8 | 8 |
|
9 | 9 |
|
10 | 10 | pushd src 2>&1 >/dev/null |
11 | 11 |
|
12 | | - |
13 | 12 | NOPATCH=false |
| 13 | +[ -L cpython ] && rm cpython |
14 | 14 |
|
15 | | -if false |
| 15 | +if echo $PYBUILD |grep -q 12$ |
16 | 16 | then |
17 | | - |
18 | | - # same goal as "python-wasm/fetch-python.sh" |
19 | | - # get python from git ( actually the only one supporting emsdk without patches) |
20 | | - |
21 | | - if [ -d cpython ] |
| 17 | + if [ -d cpython-git ] |
22 | 18 | then |
23 | | - pushd cpython 2>&1 >/dev/null |
| 19 | + pushd cpython-git 2>&1 >/dev/null |
24 | 20 | # put the tree back to original state so we can pull |
25 | 21 | # Programs/python.c Modules/readline.c |
26 | 22 | git restore . |
|
35 | 31 | #cat $ROOT/support/compilenone.py > ./Lib/compileall.py |
36 | 32 | popd |
37 | 33 | else |
38 | | - git clone https://github.com/python/cpython.git |
| 34 | + git clone --depth 1 https://github.com/python/cpython.git cpython-git |
39 | 35 | export REBUILD=true |
40 | 36 | fi |
41 | 37 |
|
42 | | -else |
43 | | - if [ -L cpython ] |
44 | | - then |
45 | | - echo " |
46 | | - * cpython source tree already linked $(file cpython)" |
47 | | - NOPATCH=true |
48 | | - else |
49 | | - wget -q -c https://www.python.org/ftp/python/3.11.0/Python-3.11.0b3.tgz |
50 | | - tar xf Python-3.11.0b3.tgz |
51 | | - ln -s Python-3.11.0b3 cpython |
52 | | - fi |
| 38 | + ln -s cpython-git cpython |
| 39 | + |
53 | 40 | fi |
54 | 41 |
|
| 42 | +if echo $PYBUILD | grep -q 11$ |
| 43 | +then |
| 44 | + #wget -q -c https://www.python.org/ftp/python/3.11.0/Python-3.11.0b3.tgz |
| 45 | + wget -q https://www.python.org/ftp/python/3.11.0/Python-3.11.0b4.tar.xz |
| 46 | + |
| 47 | + #tar xf Python-3.11.0b3.tgz |
| 48 | + tar xf Python-3.11.0b4.tar.xz |
| 49 | + #ln -s Python-3.11.0b3 cpython |
| 50 | + ln -s Python-3.11.0b4 cpython |
| 51 | + export REBUILD=true |
| 52 | +fi |
| 53 | + |
| 54 | +if echo $PYBUILD | grep -q 10$ |
| 55 | +then |
| 56 | + tar xfj /data/git/python-wasm-sdk/src/Python-3.10.5-pydk.tar.bz2 |
| 57 | + ln -s Python-3.10.5-pydk cpython |
| 58 | + NOPATCH=true |
| 59 | + export REBUILD=true |
| 60 | +fi |
| 61 | + |
| 62 | + |
55 | 63 | popd |
56 | 64 |
|
| 65 | + |
57 | 66 | if $NOPATCH |
58 | 67 | then |
59 | 68 | echo " |
60 | 69 | * assuming cpython tree already patched, press <enter> |
61 | 70 | " |
62 | | - |
63 | | - |
64 | 71 | else |
65 | 72 | # do some patching |
66 | 73 | pushd src/cpython 2>&1 >/dev/null |
67 | 74 | patch -p1 < ../../support/__EMSCRIPTEN__.embed/cpython.diff |
68 | 75 | popd |
69 | 76 | fi |
70 | 77 |
|
| 78 | + |
71 | 79 | echo " |
72 | 80 | * fetched cpython source, status is : |
73 | 81 | REBUILD=${REBUILD} |
74 | 82 | " |
75 | 83 |
|
| 84 | +[ -d build/cpython-host ] && rm -rf build/cpython-host |
| 85 | +[ -d build/cpython-wasm ] && rm -rf build/cpython-wasm |
0 commit comments