2019-10-06 18:19:08 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# Release the QuickJS source code
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
version=`cat VERSION`
|
|
|
|
|
|
|
|
if [ "$1" = "-h" ] ; then
|
2021-01-02 13:10:00 -05:00
|
|
|
echo "release.sh [release_list]"
|
2019-10-06 18:19:08 -04:00
|
|
|
echo ""
|
2021-01-02 13:10:00 -05:00
|
|
|
echo "release_list: extras binary win_binary quickjs"
|
|
|
|
|
2019-10-06 18:19:08 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
release_list="extras binary win_binary quickjs"
|
|
|
|
|
|
|
|
if [ "$1" != "" ] ; then
|
|
|
|
release_list="$1"
|
2019-10-06 18:19:08 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
#################################################"
|
2021-01-02 13:10:00 -05:00
|
|
|
# extras
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
if echo $release_list | grep -w -q extras ; then
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
d="quickjs-${version}"
|
2021-01-02 13:10:00 -05:00
|
|
|
name="quickjs-extras-${version}"
|
2019-10-06 18:19:08 -04:00
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
2021-01-02 13:10:00 -05:00
|
|
|
mkdir -p $outdir $outdir/unicode $outdir/tests
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
cp unicode/* $outdir/unicode
|
2021-01-02 13:10:00 -05:00
|
|
|
cp -a tests/bench-v8 $outdir/tests
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
( cd /tmp && tar Jcvf /tmp/${name}.tar.xz ${d} )
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
#################################################"
|
2021-01-02 13:10:00 -05:00
|
|
|
# Windows binary release
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
if echo $release_list | grep -w -q win_binary ; then
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
# win64
|
|
|
|
|
|
|
|
dlldir=/usr/x86_64-w64-mingw32/sys-root/mingw/bin
|
|
|
|
cross_prefix="x86_64-w64-mingw32-"
|
|
|
|
d="quickjs-win-x86_64-${version}"
|
2019-10-06 18:19:08 -04:00
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
2021-01-02 13:10:00 -05:00
|
|
|
mkdir -p $outdir
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
make CONFIG_WIN32=y qjs.exe
|
|
|
|
cp qjs.exe $outdir
|
|
|
|
${cross_prefix}strip $outdir/qjs.exe
|
|
|
|
cp $dlldir/libwinpthread-1.dll $outdir
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
make CONFIG_WIN32=y clean
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
# win32
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
dlldir=/usr/i686-w64-mingw32/sys-root/mingw/bin
|
|
|
|
cross_prefix="i686-w64-mingw32-"
|
|
|
|
d="quickjs-win-i686-${version}"
|
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
|
|
|
mkdir -p $outdir
|
|
|
|
|
|
|
|
make clean
|
|
|
|
make CONFIG_WIN32=y clean
|
|
|
|
|
|
|
|
make CONFIG_WIN32=y CONFIG_M32=y qjs.exe
|
|
|
|
cp qjs.exe $outdir
|
|
|
|
${cross_prefix}strip $outdir/qjs.exe
|
|
|
|
cp $dlldir/libwinpthread-1.dll $outdir
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
2019-10-06 18:19:08 -04:00
|
|
|
#################################################"
|
2021-01-02 13:10:00 -05:00
|
|
|
# Linux binary release
|
|
|
|
|
|
|
|
if echo $release_list | grep -w -q binary ; then
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
make clean
|
|
|
|
make CONFIG_WIN32=y clean
|
|
|
|
make -j4 qjs run-test262
|
|
|
|
make -j4 CONFIG_M32=y qjs32 run-test262-32
|
|
|
|
strip qjs run-test262 qjs32 run-test262-32
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
d="quickjs-linux-x86_64-${version}"
|
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
|
|
|
mkdir -p $outdir
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
cp qjs run-test262 $outdir
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
|
|
|
|
|
|
|
|
d="quickjs-linux-i686-${version}"
|
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
|
|
|
mkdir -p $outdir
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
cp qjs32 $outdir/qjs
|
|
|
|
cp run-test262-32 $outdir/run-test262
|
2019-10-06 18:19:08 -04:00
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
#################################################"
|
|
|
|
# quickjs
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
if echo $release_list | grep -w -q quickjs ; then
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
make build_doc
|
|
|
|
|
|
|
|
d="quickjs-${version}"
|
|
|
|
outdir="/tmp/${d}"
|
|
|
|
|
|
|
|
rm -rf $outdir
|
|
|
|
mkdir -p $outdir $outdir/doc $outdir/tests $outdir/examples
|
|
|
|
|
|
|
|
cp Makefile VERSION TODO Changelog readme.txt release.sh unicode_download.sh \
|
|
|
|
qjs.c qjsc.c qjscalc.js repl.js \
|
|
|
|
quickjs.c quickjs.h quickjs-atom.h \
|
|
|
|
quickjs-libc.c quickjs-libc.h quickjs-opcode.h \
|
|
|
|
cutils.c cutils.h list.h \
|
|
|
|
libregexp.c libregexp.h libregexp-opcode.h \
|
|
|
|
libunicode.c libunicode.h libunicode-table.h \
|
|
|
|
libbf.c libbf.h \
|
2021-01-02 13:10:00 -05:00
|
|
|
unicode_gen.c unicode_gen_def.h \
|
|
|
|
run-test262.c test262o.conf test262.conf \
|
|
|
|
test262o_errors.txt test262_errors.txt \
|
2019-10-06 18:19:08 -04:00
|
|
|
$outdir
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
cp tests/*.js tests/*.patch tests/bjson.c $outdir/tests
|
2019-10-06 18:19:08 -04:00
|
|
|
|
|
|
|
cp examples/*.js examples/*.c $outdir/examples
|
|
|
|
|
|
|
|
cp doc/quickjs.texi doc/quickjs.pdf doc/quickjs.html \
|
|
|
|
doc/jsbignum.texi doc/jsbignum.html doc/jsbignum.pdf \
|
|
|
|
$outdir/doc
|
|
|
|
|
|
|
|
( cd /tmp && tar Jcvf /tmp/${d}.tar.xz ${d} )
|
|
|
|
|
|
|
|
fi
|