git.s-ol.nu alive / a4307ab
new windows bundling with fltk s-ol 1 year, 1 month ago
4 changed file(s) with 39 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
00 *.zip
11 *.rock
22 *.rock.asc
3 alive-test-999.*
33 head -n 2 $IN
44
55 cat <<EOF
6 set PR=%~dp0..\\..\\
6 set PR=%~dp0..\\
77 set PP=%PR:\\=/%
88 EOF
99
2222 cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
2323 rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
2424 unzip dist/lua-win.zip -d "dist/$BUNDLE/"
25 luarocks --tree "dist/$BUNDLE/lua/lua" install --deps-mode none "dist/rocks/$ROCK"
25 luarocks --tree "dist/$BUNDLE/lua" install --deps-mode none "dist/rocks/$ROCK"
2626
27 cat <<EOF >"dist/$BUNDLE/copilot.bat"
27 cat <<EOF >"dist/$BUNDLE/alv.bat"
2828 @echo off
2929 setlocal
30 set PATH=%PATH%;%~dp0\\lua\\lua\\bin
30 set PATH=%PATH%;%~dp0\\lua\\bin
3131 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
32 moon "%~dp0\\lua\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
32 moon "%~dp0\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
3333 exit /b %ERRORLEVEL%
3434 EOF
35
36 cat <<EOF >"dist/$BUNDLE/alv-fltk.bat"
37 @echo off
38 setlocal
39 set PATH=%PATH%;%~dp0\\lua\\bin
40 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
41 moon "%~dp0\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv-fltk" %*
42 exit /b %ERRORLEVEL%
43 EOF
44
45 for script in "dist/$BUNDLE/lua/bin/"*.bat; do
46 dist/fix-lua-win.sh "$script" > "$script.nu"
47 mv "$script.nu" "$script"
48 done
3549
3650 mkdir "dist/$BUNDLE/alv-lib"
3751 cat <<EOF >"dist/$BUNDLE/alv-lib/README.txt"
5670 This binary distribution of alive contains the Lua interpreter, LuaRocks package
5771 manager, and a number of Lua modules licensed under various terms. Lua and
5872 LuaRocks are both licensed under the MIT license. The packages can be found
59 within the \`lua/lua\` directory while their individual licensing information
60 may be viewed using \`luarocks.bat\`:
73 within the \`lua\` directory while their individual licensing information may be
74 viewed using \`luarocks.bat\`:
6175
6276 cmd.exe> luarocks.bat list
6377 cmd.exe> luarocks.bat show moonscript
22
33 TAG="${1:-scm}"
44 REVISION="${2:-1}"
5 ROCK_OPTS=""
6 WHERE=""
57
6 if [ "$TAG" = scm ]; then
7 WHERE=""
8 if [ "$TAG" = "scm" ]; then
89 TAG=""
910 VERSION="scm"
11 elif [ "$TAG" = "test" ]; then
12 VERSION="test"
13 REVISION=999
1014 else
1115 VERSION="${TAG#v}"
1216 VERSION=$(echo "$VERSION" | tr -d -)
4044
4145 WHERE="
4246 tag = \"$TAG\","
47
48 ROCK_OPTS="--sign"
4349 fi
4450
4551 list_modules() {
98104 }
99105 STOP
100106
101 if [ -n "$TAG" ]; then
107 if [ -n "$TAG" -a "$TAG" != "test" ]; then
102108 git add "alv/version.moon" "dist/rocks/alive-$VERSION-$REVISION.rockspec"
103109 git commit -m "release $TAG"
104110 git tag -am "version $TAG" "$TAG"
105111
106 luarocks pack "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
107 --sign
108 mv "alive-$VERSION-$REVISION.src.rock" "alive-$VERSION-$REVISION.src.rock.asc" dist/rocks
109 luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
110 --pack-binary-rock \
111 --sign
112 mv "alive-$VERSION-$REVISION.all.rock" "alive-$VERSION-$REVISION.all.rock.asc" dist/rocks
112 luarocks pack "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS
113 mv "alive-$VERSION-$REVISION.src.rock"* dist/rocks
114 fi
115
116 if [ -n "$TAG" ]; then
117 luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS \
118 --deps-mode none --pack-binary-rock
119 mv "alive-$VERSION-$REVISION.all.rock"* dist/rocks
113120 dist/pack-win.sh "$TAG" "$VERSION-$REVISION"
114121 fi