quickjs/release.sh

159 lines
3.3 KiB
Bash
Raw Normal View History

2020-09-07 00:53:08 +08:00
#!/bin/sh
# Release the QuickJS source code
set -e
version=`cat VERSION`
if [ "$1" = "-h" ] ; then
2020-11-08 21:30:56 +08:00
echo "release.sh [release_list]"
2020-09-07 00:53:08 +08:00
echo ""
2020-11-08 21:30:56 +08:00
echo "release_list: extras binary win_binary quickjs"
2024-02-10 23:18:11 +08:00
2020-09-07 00:53:08 +08:00
exit 1
fi
2020-11-08 21:30:56 +08:00
release_list="extras binary win_binary quickjs"
if [ "$1" != "" ] ; then
release_list="$1"
2020-09-07 00:53:08 +08:00
fi
#################################################"
# extras
2020-11-08 21:30:56 +08:00
if echo $release_list | grep -w -q extras ; then
2020-09-07 00:53:08 +08:00
d="quickjs-${version}"
name="quickjs-extras-${version}"
outdir="/tmp/${d}"
rm -rf $outdir
2024-02-10 23:18:11 +08:00
mkdir -p $outdir $outdir/unicode $outdir/tests
2020-09-07 00:53:08 +08:00
cp unicode/* $outdir/unicode
cp -a tests/bench-v8 $outdir/tests
( cd /tmp && tar Jcvf /tmp/${name}.tar.xz ${d} )
fi
#################################################"
2020-11-08 21:30:56 +08:00
# Windows binary release
if echo $release_list | grep -w -q win_binary ; then
# win64
dlldir=/usr/x86_64-w64-mingw32/sys-root/mingw/bin
cross_prefix="x86_64-w64-mingw32-"
d="quickjs-win-x86_64-${version}"
outdir="/tmp/${d}"
rm -rf $outdir
mkdir -p $outdir
make CONFIG_WIN32=y qjs.exe
cp qjs.exe $outdir
${cross_prefix}strip $outdir/qjs.exe
cp $dlldir/libwinpthread-1.dll $outdir
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
make CONFIG_WIN32=y clean
# win32
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
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
fi
2024-02-10 23:18:11 +08:00
2020-11-08 21:30:56 +08:00
#################################################"
# Linux binary release
2020-09-07 00:53:08 +08:00
2020-11-08 21:30:56 +08:00
if echo $release_list | grep -w -q binary ; then
2020-09-07 00:53:08 +08:00
2020-11-08 21:30:56 +08:00
make clean
make CONFIG_WIN32=y clean
2020-09-07 01:02:03 +08:00
make -j4 qjs run-test262
make -j4 CONFIG_M32=y qjs32 run-test262-32
strip qjs run-test262 qjs32 run-test262-32
2020-09-07 00:53:08 +08:00
d="quickjs-linux-x86_64-${version}"
outdir="/tmp/${d}"
rm -rf $outdir
mkdir -p $outdir
2020-09-07 01:02:03 +08:00
cp qjs run-test262 $outdir
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
d="quickjs-linux-i686-${version}"
outdir="/tmp/${d}"
2020-09-07 00:53:08 +08:00
2020-09-07 01:02:03 +08:00
rm -rf $outdir
mkdir -p $outdir
2020-09-07 00:53:08 +08:00
2020-09-07 01:02:03 +08:00
cp qjs32 $outdir/qjs
cp run-test262-32 $outdir/run-test262
2020-09-07 00:53:08 +08:00
2020-09-07 01:02:03 +08:00
( cd /tmp/$d && rm -f ../${d}.zip && zip -r ../${d}.zip . )
2020-09-07 00:53:08 +08:00
fi
#################################################"
# quickjs
2020-11-08 21:30:56 +08:00
if echo $release_list | grep -w -q quickjs ; then
2020-09-07 00:53:08 +08:00
make build_doc
d="quickjs-${version}"
outdir="/tmp/${d}"
rm -rf $outdir
mkdir -p $outdir $outdir/doc $outdir/tests $outdir/examples
2021-03-27 18:17:31 +08:00
cp Makefile VERSION TODO Changelog readme.txt LICENSE \
release.sh unicode_download.sh \
2020-09-07 00:53:08 +08:00
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 \
2020-11-08 21:30:56 +08:00
unicode_gen.c unicode_gen_def.h \
2020-09-07 00:53:08 +08:00
run-test262.c test262o.conf test262.conf \
test262o_errors.txt test262_errors.txt \
$outdir
cp tests/*.js tests/*.patch tests/bjson.c $outdir/tests
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 \
2024-02-10 23:18:11 +08:00
$outdir/doc
2020-09-07 00:53:08 +08:00
( cd /tmp && tar Jcvf /tmp/${d}.tar.xz ${d} )
fi