From a4e0a27225c889bf3b2ddcc850374af00ac2a57d Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 17 Apr 2020 16:50:18 +0200 Subject: add some windows dist pieces --- dist/.gitignore | 2 ++ dist/build-win.sh | 60 ++++++++++++++++++++++++++++++++++++ dist/fix-lua-win.sh | 16 ++++++++++ dist/release | 89 ----------------------------------------------------- dist/release.sh | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 167 insertions(+), 89 deletions(-) create mode 100644 dist/.gitignore create mode 100755 dist/build-win.sh create mode 100755 dist/fix-lua-win.sh delete mode 100755 dist/release create mode 100755 dist/release.sh diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 0000000..7d0e917 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1,2 @@ +*.zip +deps diff --git a/dist/build-win.sh b/dist/build-win.sh new file mode 100755 index 0000000..bfa5de0 --- /dev/null +++ b/dist/build-win.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +VERSION="$1" +BUNDLE="alive-$VERSION-win" + +set -e + +if [ -d "dist/$BUNDLE.zip" ]; then + echo "dist/$BUNDLE.zip already exists!" + exit 2 +fi + +git archive "$VERSION:" -o "dist/$BUNDLE.zip" --prefix "$BUNDLE/alive/" + +cd dist +unzip "$BUNDLE.zip" +cd "$BUNDLE" + +cp -r ../docs . +mv alive/hello.alv . +rm -rf docs/*.md docs/*.ltp docs/gen +rm -rf alive/dist + +unzip ../lua-win.zip + +cat <copilot.bat +@echo off +setlocal +set PATH=%PATH%;%~dp0\lua\lua\bin +set LUA_PATH=%LUA_PATH%;%~dp0\alive\?.lua;%~dp0\alive\?\init.lua +moon %~dp0\alive\init.moon %* +exit /b %ERRORLEVEL% +EOF + +cat <README.txt +alivecoding $VERSION +==================== + +https://alive.s-ol.nu +https://github.com/s-ol/alivecoding + +License +------- +alive is licensed under the GPLv3 free and open-source license, a copy of which +you can find in the file `alive/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, while the packages can be +found within the `lua/lua` directory while their individual licensing +information may be viewed using `luarocks.bat`: + + cmd.exe> luarocks.bat list + cmd.exe> luarocks.bat show moonscript + cmd.exe> luarocks.bat show ... +EOF + +cd .. +rm "$BUNDLE.zip" +zip -rm "$BUNDLE.zip" "$BUNDLE" diff --git a/dist/fix-lua-win.sh b/dist/fix-lua-win.sh new file mode 100755 index 0000000..8bf352f --- /dev/null +++ b/dist/fix-lua-win.sh @@ -0,0 +1,16 @@ +#!/bin/sh +IN=$1 + +head -n 2 $IN + +cat <"alv/version.moon" ----- --- \`alive\` source code version information. --- --- @module version - ---- exports --- @table exports --- @tfield string tag the last versions git tag --- @tfield string web the repo web URL --- @tfield string repo the git repo URL --- @tfield string release the web URL of this release -{ - tag: "${VERSION}" - web: "https://github.com/s-ol/alivecoding" - repo: "https://github.com/s-ol/alivecoding.git" - release: "https://github.com/s-ol/alivecoding/releases/tag/${VERSION}" -} -EOF - - WHERE=" - tag = \"$VERSION\"," - VERSION="${VERSION#v}" - VERSION=$(echo "$VERSION" | tr -d -) -fi - -list_modules() { - find "$1" -type f -name '*.moon' -exec sh -c ' - MODULE=$(echo "$1" | sed -e "s/\.moon$//" -e "s/\//./g") - echo " [\"$MODULE\"] = \"$1\"," - ' sh {} \; -} - -cat <"dist/rockspecs/alive-$VERSION-$REVISION.rockspec" -package = "alive" -version = "$VERSION-$REVISION" - -source = { - url = "git://github.com/s-ol/alivecoding.git",$WHERE -} - -description = { - summary = "Experimental livecoding environment with persistent expressions", - detailed = [[ -This is an experimental livecoding language and environment, in which -expressions persist and update until they are removed from the source code, and -the interpreter keeps no state that you cannot manipulate directly in the -source. This yields a direct-manipulation like experience with a purely -text-based language and works without special editor support.]], - homepage = "https://alive.s-ol.nu", - license = "GPL-3", -} - -dependencies = { - "lua >= 5.3", - "moonscript >= 0.5.0", - "lpeg ~> 0.10", - "luafilesystem", - "luasystem", - "luasocket", - "osc", -} - -build = { - type = "builtin", - modules = {}, - copy_directories = { "docs" }, - install = { - lua = { -$(list_modules alv) - -$(list_modules alv-lib) - }, - bin = { - "bin/alv", - "bin/alv-copilot" - }, - }, -} -STOP diff --git a/dist/release.sh b/dist/release.sh new file mode 100755 index 0000000..e7b6923 --- /dev/null +++ b/dist/release.sh @@ -0,0 +1,89 @@ +#!/bin/sh +VERSION="${1:-scm}" +REVISION="${2:-1}" + +if [ "$VERSION" = scm ]; then + WHERE= +else + git tag "$VERSION" + + cat <"alv/version.moon" +---- +-- \`alive\` source code version information. +-- +-- @module version + +--- exports +-- @table exports +-- @tfield string tag the last versions git tag +-- @tfield string web the repo web URL +-- @tfield string repo the git repo URL +-- @tfield string release the web URL of this release +{ + tag: "${VERSION}" + web: "https://github.com/s-ol/alivecoding" + repo: "https://github.com/s-ol/alivecoding.git" + release: "https://github.com/s-ol/alivecoding/releases/tag/${VERSION}" +} +EOF + + WHERE=" + tag = \"$VERSION\"," + VERSION="${VERSION#v}" + VERSION=$(echo "$VERSION" | tr -d -) +fi + +list_modules() { + find "$1" -type f -name '*.moon' -exec sh -c ' + MODULE=$(echo "$1" | sed -e "s/\.moon$//" -e "s/\//./g") + echo " [\"$MODULE\"] = \"$1\"," + ' sh {} \; +} + +cat <"dist/rockspecs/alive-$VERSION-$REVISION.rockspec" +package = "alive" +version = "$VERSION-$REVISION" + +source = { + url = "git://github.com/s-ol/alivecoding.git",$WHERE +} + +description = { + summary = "Experimental livecoding environment with persistent expressions", + detailed = [[ +This is an experimental livecoding language and environment, in which +expressions persist and update until they are removed from the source code, and +the interpreter keeps no state that you cannot manipulate directly in the +source. This yields a direct-manipulation like experience with a purely +text-based language and works without special editor support.]], + homepage = "https://alive.s-ol.nu", + license = "GPL-3", +} + +dependencies = { + "lua >= 5.3", + "moonscript >= 0.5.0", + "lpeg ~> 0.10", + "luafilesystem", + "luasystem", + "luasocket", + "osc", +} + +build = { + type = "builtin", + modules = {}, + copy_directories = { "docs" }, + install = { + lua = { +$(list_modules alv) + +$(list_modules alv-lib) + }, + bin = { + "bin/alv", + "bin/alv-copilot" + }, + }, +} +STOP -- cgit v1.2.3