git.s-ol.nu alive / c391b14
update windows release logic s-ol 1 year, 1 month ago
4 changed file(s) with 59 addition(s) and 37 deletion(s). Raw diff Collapse all Expand all
0 #!/bin/bash
1 IN=$1
2 MODE=$2
3
4 head -n 2 $IN
5
6 cat <<EOF
7 set PR=%~dp0..\\
8 set PP=%PR:\\=/%
9 EOF
10
11 PP="D:/alive_pkg/lua/"
12 PR=${PP//\//\\\\}\\\\?
13
14 if [ "$MODE" = wlua ]; then
15 tail -n 2 $IN | \
16 sed -r "s|${PR}|%PR%|g" | \
17 sed "s|${PP}|%PP%|g" | \
18 sed 's|"%PR%bin\\lua5.3.exe"|start "Lua" "%PR%bin\\wlua5.3.exe"|'
19 else
20 tail -n 2 $IN | \
21 sed -r "s|${PR}|%PR%|g" | \
22 sed "s|${PP}|%PP%|g"
23 fi
+0
-16
dist/fix-lua-win.sh less more
0 #!/bin/sh
1 IN=$1
2
3 head -n 2 $IN
4
5 cat <<EOF
6 set PR=%~dp0..\\
7 set PP=%PR:\\=/%
8 EOF
9
10 PP="D:/alive_pkg/lua/"
11 PR=${PP//\//\\\\}\\\\?
12
13 tail -n 2 $IN | \
14 sed -r "s|${PR}|%PR%|g" | \
15 sed "s|${PP}|%PP%|g"
11
22 TAG="$1"
33 ROCKVER="$2"
4 LUA_WIN="$3"
5 if [ -z "$LUA_WIN" ]; then
6 LUA_WIN="/mnt/d/alive_pkg/lua"
7 fi
48
59 BUNDLE="alive-$TAG-win"
610 ROCK="alive-$ROCKVER.all.rock"
711
812 set -e
13
14 if [ "$TAG" = "test" ]; then
15 rm -rf "dist/$BUNDLE" "dist/$BUNDLE.zip"
16 fi
917
1018 if [ -e "dist/$BUNDLE.zip" ]; then
1119 echo "dist/$BUNDLE.zip already exists!"
2129
2230 cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
2331 rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
24 unzip dist/lua-win.zip -d "dist/$BUNDLE/"
25 luarocks --tree "dist/$BUNDLE/lua" install --deps-mode none "dist/rocks/$ROCK"
32 cp -r "$LUA_WIN" "dist/$BUNDLE/"
2633
2734 cat <<EOF >"dist/$BUNDLE/alv.bat"
2835 @echo off
29 setlocal
30 set PATH=%PATH%;%~dp0\\lua\\bin
31 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
32 moon "%~dp0\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
36 %~dp0lua\bin\alv.bat --nocolor %*
3337 exit /b %ERRORLEVEL%
3438 EOF
3539
3640 cat <<EOF >"dist/$BUNDLE/alv-fltk.bat"
3741 @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 %~dp0lua\bin\alv-fltk.bat %*
4243 exit /b %ERRORLEVEL%
4344 EOF
4445
4546 for script in "dist/$BUNDLE/lua/bin/"*.bat; do
46 dist/fix-lua-win.sh "$script" > "$script.nu"
47 case "$(basename "$script" .bat)" in
48 alv-fltk|alv-wx) mode="wlua" ;;
49 *) mode= ;;
50 esac
51 dist/fix-bat-script.sh "$script" $mode > "$script.nu"
4752 mv "$script.nu" "$script"
4853 done
4954
55 ROCK_OPTS=""
66 WHERE=""
77
8 list_modules() {
9 for FILE in $(git ls-files "$1" | grep '\.moon$'); do
10 MODULE=$(echo "$FILE" | sed -e "s/\.moon$//" -e "s/\//./g")
11 echo " [\"$MODULE\"] = \"$FILE\","
12 done
13 }
14
815 if [ "$TAG" = "scm" ]; then
916 TAG=""
1017 VERSION="scm"
1118 elif [ "$TAG" = "test" ]; then
1219 VERSION="test"
1320 REVISION=999
21
22 list_modules() {
23 for FILE in $(find alv alv-lib -type f | grep '\.moon$'); do
24 MODULE=$(echo "$FILE" | sed -e "s/\.moon$//" -e "s/\//./g")
25 echo " [\"$MODULE\"] = \"$FILE\","
26 done
27 }
28
1429 else
1530 VERSION="${TAG#v}"
1631 VERSION=$(echo "$VERSION" | tr -d -)
4863 ROCK_OPTS="--sign"
4964 fi
5065
51 list_modules() {
52 for FILE in $(git ls-files "$1" | grep '\.moon$'); do
53 MODULE=$(echo "$FILE" | sed -e "s/\.moon$//" -e "s/\//./g")
54 echo " [\"$MODULE\"] = \"$FILE\","
55 done
56 }
57
5866 cat <<STOP >"dist/rocks/alive-$VERSION-$REVISION.rockspec"
5967 package = "alive"
6068 version = "$VERSION-$REVISION"
7886 dependencies = {
7987 "lua",
8088 "moonscript >= 0.5.0",
81 "lpeg ~> 0.10",
89 "lpeg",
8290 "luafilesystem",
8391 "luasystem",
8492 "luasocket",
104112 }
105113 STOP
106114
107 if [ -n "$TAG" -a "$TAG" != "test" ]; then
115 if [ -n "$TAG" ] && [ "$TAG" != "test" ]; then
108116 git add "alv/version.moon" "dist/rocks/alive-$VERSION-$REVISION.rockspec"
109117 git commit -m "release $TAG"
110118 git tag -am "version $TAG" "$TAG"
117125 luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS \
118126 --deps-mode none --pack-binary-rock
119127 mv "alive-$VERSION-$REVISION.all.rock"* dist/rocks
120 dist/pack-win.sh "$TAG" "$VERSION-$REVISION"
128 echo "now install 'alive-$VERSION-$REVISION.all.rock' on windows and run"
129 echo dist/pack-win.sh "$TAG" "$VERSION-$REVISION"
121130 fi