44
55. scripts/emsdk-fetch.sh
66
7-
8- cd ${ROOT} /src
9-
107# --disable-database --enable-termcap
118
129NCOPTS=" --enable-ext-colors --enable-ext-mouse --prefix=$PREFIX --disable-echo --without-pthread \
@@ -17,53 +14,30 @@ NCOPTS="--enable-ext-colors --enable-ext-mouse --prefix=$PREFIX --disable-echo -
1714
1815
1916export NCURSES=${NCURSES:- " ncurses-6.1" }
20- export URL_NCURSES=${URL_NCURSES:- " URL https://ftp.NCURSES.org/source/$NCURSES .tar.gz" }
21- export HASH_NCURSES=${HASH_NCURSES:- " URL_HASH SHA256=aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17" }
22-
23-
17+ export URL_NCURSES=${URL_NCURSES:- " https://invisible-mirror.net/archives/ncurses/$NCURSES .tar.gz" }
2418
25- if true
19+ if cd ${ROOT} /src
2620then
2721
28- wget -q -c $URL_NCURSES && tar xfz $NCURSES .tar.gz
29-
30- pushd $NCURSES
31- [ -f $NCURSES .done ] || patch -p1 < $ROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten.patch
32- touch $NCURSES .done
33- popd
34-
35-
36- cd $ROOT
22+ wget -c $URL_NCURSES && tar xfz $NCURSES .tar.gz
3723
38- if [ -f devices/emsdk/usr/lib/libncursesw.a ]
24+ if cd ${ROOT} /src/ $NCURSES
3925 then
40- echo "
41- * ncursesw already built
42- " 1>&2
43- else
44- mkdir -p build/ncurses/
45-
46- # build wide char
47- rm -rf build/ncurses/*
48-
49- pushd build/ncurses
50- make clean
51- CC=clang CFLAGS=" -fpic -Wno-unused-command-line-argument" $ROOT /src/ncurses-6.1/configure \
52- $NCOPTS --enable-widec && make && make install
53-
54- popd
26+ [ -f $NCURSES .done ] || patch -p1 < $SDKROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten.patch
27+ touch $NCURSES .done
5528 fi
5629
30+ cd $ROOT
31+ mkdir -p ${ROOT} /build/ncurses/
5732
58-
59- if false # [ -f ../devices/emsdk/usr/lib/libncurses.a ]
33+ if [ -f ../devices/emsdk/usr/lib/libncurses.a ]
6034 then
6135 echo "
6236 * skiping [ncurses] or already built
6337 " 1>&2
6438 else
65- rm -rf .. /build/ncurses/*
66- pushd .. /build/ncurses
39+ rm -rf ${ROOT} /build/ncurses/*
40+ cd ${ROOT} /build/ncurses
6741
6842 CC=clang CFLAGS=" -fpic -Wno-unused-command-line-argument" $ROOT /src/ncurses-6.1/configure \
6943 $NCOPTS && make && make install
7246 $ROOT /src/ncurses-6.1/configure \
7347 $NCOPTS
7448
75- if patch -p1 < $ROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten_make.patch
49+ if patch -p1 < $SDKROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten_make.patch
7650 then
7751 emmake make clean
7852 if emmake make
7953 then
8054 emmake make install
8155 fi
8256 fi
83- popd
8457 fi
8558
59+ cd $ROOT
60+ mkdir -p ${ROOT} /build/ncurses/
8661
87- if [ -f ../ devices/emsdk/usr/lib/libncursesw.a ]
62+ if [ -f devices/emsdk/usr/lib/libncursesw.a ]
8863 then
8964 echo "
9065 * ncursesw already built
9166 " 1>&2
9267 else
9368 # build wide char
94- pushd ../build/ncurses
69+ rm -rf ${ROOT} /build/ncurses/*
70+
71+ cd ${ROOT} /build/ncurses
72+
73+ CC=clang CFLAGS=" -fpic -Wno-unused-command-line-argument" $ROOT /src/ncurses-6.1/configure \
74+ $NCOPTS --enable-widec && make && make install
9575
9676 CFLAGS=" -fpic -Wno-unused-command-line-argument" emconfigure \
9777 $ROOT /src/ncurses-6.1/configure $NCOPTS --enable-widec
9878
99- if patch -p1 < $SDKROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten_makew.patch
79+ cp ncurses/Makefile ncurses/Makefile.makew
80+
81+ if patch -p0 < $SDKROOT /support/__EMSCRIPTEN__.deps/ncurses-6.1_emscripten_makew.patch
10082 then
10183 emmake make clean
10284 if emmake make
10385 then
10486 emmake make install
10587 fi
10688 fi
107- popd
10889 fi
10990
11091fi
0 commit comments