aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-14 13:57:02 +0000
committers-ol <s-ol@users.noreply.github.com>2020-05-14 13:57:02 +0000
commita4307ab7c015a52835751737bfb16d56fb972ddd (patch)
treeae63891af802ddb836aaa20cd1f0824860e9a0bd
parentdocs/guide: luraocks install + alv-fltk info (diff)
downloadalive-a4307ab7c015a52835751737bfb16d56fb972ddd.tar.gz
alive-a4307ab7c015a52835751737bfb16d56fb972ddd.zip
new windows bundling with fltk
-rw-r--r--dist/.gitignore1
-rwxr-xr-xdist/fix-lua-win.sh2
-rwxr-xr-xdist/pack-win.sh26
-rwxr-xr-xdist/release.sh27
4 files changed, 39 insertions, 17 deletions
diff --git a/dist/.gitignore b/dist/.gitignore
index 3c1c642..b6c0f93 100644
--- a/dist/.gitignore
+++ b/dist/.gitignore
@@ -1,3 +1,4 @@
*.zip
*.rock
*.rock.asc
+alive-test-999.*
diff --git a/dist/fix-lua-win.sh b/dist/fix-lua-win.sh
index 8bf352f..d7f0c39 100755
--- a/dist/fix-lua-win.sh
+++ b/dist/fix-lua-win.sh
@@ -4,7 +4,7 @@ IN=$1
head -n 2 $IN
cat <<EOF
-set PR=%~dp0..\\..\\
+set PR=%~dp0..\\
set PP=%PR:\\=/%
EOF
diff --git a/dist/pack-win.sh b/dist/pack-win.sh
index c2dee87..bfa3a58 100755
--- a/dist/pack-win.sh
+++ b/dist/pack-win.sh
@@ -23,17 +23,31 @@ mkdir -p "dist/$BUNDLE"
cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
unzip dist/lua-win.zip -d "dist/$BUNDLE/"
-luarocks --tree "dist/$BUNDLE/lua/lua" install --deps-mode none "dist/rocks/$ROCK"
+luarocks --tree "dist/$BUNDLE/lua" install --deps-mode none "dist/rocks/$ROCK"
-cat <<EOF >"dist/$BUNDLE/copilot.bat"
+cat <<EOF >"dist/$BUNDLE/alv.bat"
@echo off
setlocal
-set PATH=%PATH%;%~dp0\\lua\\lua\\bin
+set PATH=%PATH%;%~dp0\\lua\\bin
set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
-moon "%~dp0\\lua\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
+moon "%~dp0\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
exit /b %ERRORLEVEL%
EOF
+cat <<EOF >"dist/$BUNDLE/alv-fltk.bat"
+@echo off
+setlocal
+set PATH=%PATH%;%~dp0\\lua\\bin
+set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
+moon "%~dp0\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv-fltk" %*
+exit /b %ERRORLEVEL%
+EOF
+
+for script in "dist/$BUNDLE/lua/bin/"*.bat; do
+ dist/fix-lua-win.sh "$script" > "$script.nu"
+ mv "$script.nu" "$script"
+done
+
mkdir "dist/$BUNDLE/alv-lib"
cat <<EOF >"dist/$BUNDLE/alv-lib/README.txt"
You can use this directory to add extensions to alv.
@@ -57,8 +71,8 @@ you can find in the file \`LICENSE\`.
This binary distribution of alive contains the Lua interpreter, LuaRocks package
manager, and a number of Lua modules licensed under various terms. Lua and
LuaRocks are both licensed under the MIT license. The packages can be found
-within the \`lua/lua\` directory while their individual licensing information
-may be viewed using \`luarocks.bat\`:
+within the \`lua\` directory while their individual licensing information may be
+viewed using \`luarocks.bat\`:
cmd.exe> luarocks.bat list
cmd.exe> luarocks.bat show moonscript
diff --git a/dist/release.sh b/dist/release.sh
index a67b84f..59568d2 100755
--- a/dist/release.sh
+++ b/dist/release.sh
@@ -3,11 +3,15 @@ set -e
TAG="${1:-scm}"
REVISION="${2:-1}"
+ROCK_OPTS=""
+WHERE=""
-if [ "$TAG" = scm ]; then
- WHERE=""
+if [ "$TAG" = "scm" ]; then
TAG=""
VERSION="scm"
+elif [ "$TAG" = "test" ]; then
+ VERSION="test"
+ REVISION=999
else
VERSION="${TAG#v}"
VERSION=$(echo "$VERSION" | tr -d -)
@@ -41,6 +45,8 @@ EOF
WHERE="
tag = \"$TAG\","
+
+ ROCK_OPTS="--sign"
fi
list_modules() {
@@ -99,17 +105,18 @@ $(list_modules alv-lib)
}
STOP
-if [ -n "$TAG" ]; then
+if [ -n "$TAG" -a "$TAG" != "test" ]; then
git add "alv/version.moon" "dist/rocks/alive-$VERSION-$REVISION.rockspec"
git commit -m "release $TAG"
git tag -am "version $TAG" "$TAG"
- luarocks pack "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
- --sign
- mv "alive-$VERSION-$REVISION.src.rock" "alive-$VERSION-$REVISION.src.rock.asc" dist/rocks
- luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
- --pack-binary-rock \
- --sign
- mv "alive-$VERSION-$REVISION.all.rock" "alive-$VERSION-$REVISION.all.rock.asc" dist/rocks
+ luarocks pack "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS
+ mv "alive-$VERSION-$REVISION.src.rock"* dist/rocks
+fi
+
+if [ -n "$TAG" ]; then
+ luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS \
+ --deps-mode none --pack-binary-rock
+ mv "alive-$VERSION-$REVISION.all.rock"* dist/rocks
dist/pack-win.sh "$TAG" "$VERSION-$REVISION"
fi