| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Release the QuickJS source code |
| 3 | |
| 4 | set -e |
| 5 | |
| 6 | version=`catscip-shell system . . cat. VERSION` |
| 7 | |
| 8 | if [scip-shell system . . `[`. "$1" = "-h" ] ; then |
| 9 | echoscip-shell system . . echo. "release.sh [release_list]" |
| 10 | echoscip-shell system . . echo. "" |
| 11 | echoscip-shell system . . echo. "release_list: extras binary win_binary quickjs" |
| 12 | |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | release_list="extras binary win_binary quickjs" |
| 17 | |
| 18 | if [scip-shell system . . `[`. "$1" != "" ] ; then |
| 19 | release_list="$1" |
| 20 | fi |
| 21 | |
| 22 | #################################################" |
| 23 | # extras |
| 24 | |
| 25 | if echoscip-shell system . . echo. $release_list | grepscip-shell system . . grep. -w -q extras ; then |
| 26 | |
| 27 | d="quickjs-${version}" |
| 28 | name="quickjs-extras-${version}" |
| 29 | outdir="/tmp/${d}" |
| 30 | |
| 31 | rmscip-shell system . . rm. -rf $outdir |
| 32 | mkdirscip-shell system . . mkdir. -p $outdir $outdir/unicode $outdir/tests |
| 33 | |
| 34 | cpscip-shell system . . cp. unicode/* $outdir/unicode |
| 35 | cpscip-shell system . . cp. -a tests/bench-v8 $outdir/tests |
| 36 | |
| 37 | ( cd /tmpscip-shell filesystem . . `/tmp`. && tarscip-shell system . . tar. Jcvf /tmp/${name}.tar.xz ${d} ) |
| 38 | |
| 39 | fi |
| 40 | |
| 41 | #################################################" |
| 42 | # Windows binary release |
| 43 | |
| 44 | if echoscip-shell system . . echo. $release_list | grepscip-shell system . . grep. -w -q win_binary ; then |
| 45 | |
| 46 | # win64 |
| 47 | |
| 48 | dlldir=/usr/x86_64-w64-mingw32/sys-root/mingw/binscip-shell filesystem . . `/usr/x86_64-w64-mingw32/sys-root/mingw/bin`. |
| 49 | cross_prefix="x86_64-w64-mingw32-" |
| 50 | d="quickjs-win-x86_64-${version}" |
| 51 | outdir="/tmp/${d}" |
| 52 | |
| 53 | rmscip-shell system . . rm. -rf $outdir |
| 54 | mkdirscip-shell system . . mkdir. -p $outdir |
| 55 | |
| 56 | makescip-shell system . . make. CONFIG_WIN32=y qjs.exe |
| 57 | cpscip-shell system . . cp. qjs.exe $outdir |
| 58 | ${cross_prefix}strip $outdir/qjs.exe |
| 59 | cpscip-shell system . . cp. $dlldir/libwinpthread-1.dll $outdir |
| 60 | |
| 61 | ( cd /tmp/$d && rmscip-shell system . . rm. -f ../${d}.zip && zip -r ../${d}.zip . ) |
| 62 | |
| 63 | makescip-shell system . . make. CONFIG_WIN32=y clean |
| 64 | |
| 65 | # win32 |
| 66 | |
| 67 | dlldir=/usr/i686-w64-mingw32/sys-root/mingw/binscip-shell filesystem . . `/usr/i686-w64-mingw32/sys-root/mingw/bin`. |
| 68 | cross_prefix="i686-w64-mingw32-" |
| 69 | d="quickjs-win-i686-${version}" |
| 70 | outdir="/tmp/${d}" |
| 71 | |
| 72 | rmscip-shell system . . rm. -rf $outdir |
| 73 | mkdirscip-shell system . . mkdir. -p $outdir |
| 74 | |
| 75 | makescip-shell system . . make. clean |
| 76 | makescip-shell system . . make. CONFIG_WIN32=y clean |
| 77 | |
| 78 | makescip-shell system . . make. CONFIG_WIN32=y CONFIG_M32=y qjs.exe |
| 79 | cpscip-shell system . . cp. qjs.exe $outdir |
| 80 | ${cross_prefix}strip $outdir/qjs.exe |
| 81 | cpscip-shell system . . cp. $dlldir/libwinpthread-1.dll $outdir |
| 82 | |
| 83 | ( cd /tmp/$d && rmscip-shell system . . rm. -f ../${d}.zip && zip -r ../${d}.zip . ) |
| 84 | |
| 85 | fi |
| 86 | |
| 87 | #################################################" |
| 88 | # Linux binary release |
| 89 | |
| 90 | if echoscip-shell system . . echo. $release_list | grepscip-shell system . . grep. -w -q binary ; then |
| 91 | |
| 92 | makescip-shell system . . make. clean |
| 93 | makescip-shell system . . make. CONFIG_WIN32=y clean |
| 94 | makescip-shell system . . make. -j4 qjs run-test262 |
| 95 | makescip-shell system . . make. -j4 CONFIG_M32=y qjs32 run-test262-32 |
| 96 | stripscip-shell system . . strip. qjs run-test262 qjs32 run-test262-32 |
| 97 | |
| 98 | d="quickjs-linux-x86_64-${version}" |
| 99 | outdir="/tmp/${d}" |
| 100 | |
| 101 | rmscip-shell system . . rm. -rf $outdir |
| 102 | mkdirscip-shell system . . mkdir. -p $outdir |
| 103 | |
| 104 | cpscip-shell system . . cp. qjs run-test262 $outdir |
| 105 | |
| 106 | ( cd /tmp/$d && rmscip-shell system . . rm. -f ../${d}.zip && zip -r ../${d}.zip . ) |
| 107 | |
| 108 | d="quickjs-linux-i686-${version}" |
| 109 | outdir="/tmp/${d}" |
| 110 | |
| 111 | rmscip-shell system . . rm. -rf $outdir |
| 112 | mkdirscip-shell system . . mkdir. -p $outdir |
| 113 | |
| 114 | cpscip-shell system . . cp. qjs32 $outdir/qjs |
| 115 | cpscip-shell system . . cp. run-test262-32 $outdir/run-test262 |
| 116 | |
| 117 | ( cd /tmp/$d && rmscip-shell system . . rm. -f ../${d}.zip && zip -r ../${d}.zip . ) |
| 118 | |
| 119 | fi |
| 120 | |
| 121 | #################################################" |
| 122 | # quickjs |
| 123 | |
| 124 | if echoscip-shell system . . echo. $release_list | grepscip-shell system . . grep. -w -q quickjs ; then |
| 125 | |
| 126 | makescip-shell system . . make. build_doc |
| 127 | |
| 128 | d="quickjs-${version}" |
| 129 | outdir="/tmp/${d}" |
| 130 | |
| 131 | rmscip-shell system . . rm. -rf $outdir |
| 132 | mkdirscip-shell system . . mkdir. -p $outdir $outdir/doc $outdir/tests $outdir/examples |
| 133 | |
| 134 | cpscip-shell system . . cp. Makefile VERSION TODO Changelog readme.txt LICENSE \ |
| 135 | release.sh unicode_download.sh \ |
| 136 | qjs.c qjsc.c qjscalc.js repl.js \ |
| 137 | quickjs.c quickjs.h quickjs-atom.h \ |
| 138 | quickjs-libc.c quickjs-libc.h quickjs-opcode.h \ |
| 139 | cutils.c cutils.h list.h \ |
| 140 | libregexp.c libregexp.h libregexp-opcode.h \ |
| 141 | libunicode.c libunicode.h libunicode-table.h \ |
| 142 | libbf.c libbf.h \ |
| 143 | unicode_gen.c unicode_gen_def.h \ |
| 144 | run-test262.c test262o.conf test262.conf \ |
| 145 | test262o_errors.txt test262_errors.txt \ |
| 146 | $outdir |
| 147 | |
| 148 | cpscip-shell system . . cp. tests/*.js tests/*.patch tests/bjson.c $outdir/tests |
| 149 | |
| 150 | cpscip-shell system . . cp. examples/*.js examples/*.c $outdir/examples |
| 151 | |
| 152 | cpscip-shell system . . cp. doc/quickjs.texi doc/quickjs.pdf doc/quickjs.html \ |
| 153 | doc/jsbignum.texi doc/jsbignum.html doc/jsbignum.pdf \ |
| 154 | $outdir/doc |
| 155 | |
| 156 | ( cd /tmpscip-shell filesystem . . `/tmp`. && tarscip-shell system . . tar. Jcvf /tmp/${d}.tar.xz ${d} ) |
| 157 | |
| 158 | fi |