aboutsummaryrefslogtreecommitdiffstats
path: root/dist/win
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-19 13:28:11 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commit9aa2ca76fa5b5b6454e93f0d596d684cbe969825 (patch)
tree1187930170de8e5112c7cb0a66a31603a8be32bc /dist/win
parentupdate featured video (diff)
downloadalive-9aa2ca76fa5b5b6454e93f0d596d684cbe969825.tar.gz
alive-9aa2ca76fa5b5b6454e93f0d596d684cbe969825.zip
once again, revamp windows distribution
Diffstat (limited to 'dist/win')
-rw-r--r--dist/win/README.md15
-rw-r--r--dist/win/build-lua.bat24
-rw-r--r--dist/win/deps/fltk4lua-0.1-1.rockspec127
-rw-r--r--dist/win/deps/osc-1.0.1-1.rockspec47
-rw-r--r--dist/win/deps/wlua.c16
-rw-r--r--dist/win/fix-paths.sh31
-rw-r--r--dist/win/gen-readme.sh23
-rw-r--r--dist/win/wrappers/alv-fltk.bat3
-rw-r--r--dist/win/wrappers/alv-lib/README.txt4
-rw-r--r--dist/win/wrappers/alv.bat3
-rw-r--r--dist/win/wrappers/lua/lua.bat7
-rw-r--r--dist/win/wrappers/lua/luarocks.bat5
-rw-r--r--dist/win/wrappers/lua/luarocks.config.lua0
13 files changed, 305 insertions, 0 deletions
diff --git a/dist/win/README.md b/dist/win/README.md
new file mode 100644
index 0000000..6b1e1e1
--- /dev/null
+++ b/dist/win/README.md
@@ -0,0 +1,15 @@
+Building & Packaging on Windows
+===============================
+
+1. download and build dependencies
+ - Lua:
+ - download `lua-5.3.5.tar.gz` and extract in `dist/win/deps`
+ - run `dist\\win\\build-lua.bat`
+ - luarocks:
+ - downlaod `luarocks-3.3.1-windows-64.zip` and extract in `dist/win/deps`
+ - FLTK:
+ - download `fltk-1.3.5-source.tar.gz` and extract in `dist/win/deps`
+ - compile the fltkdll project in `fltk-*/ide/VisualC2010/` in Release mode
+2. build or obtain an alive binary rock (`alive-VERSION-REVISION.all.rock`)
+3. run `dist\\release.bat VERSION path\to\alive-VERSION-REVISION.all.rock`
+4. zip `dist\alive-VERSION-win` and distribute
diff --git a/dist/win/build-lua.bat b/dist/win/build-lua.bat
new file mode 100644
index 0000000..ac89935
--- /dev/null
+++ b/dist/win/build-lua.bat
@@ -0,0 +1,24 @@
+cd %~dp0deps
+
+cd lua-5.3.5
+del /F /Q bin include
+mkdir bin
+mkdir include
+copy /Y ..\wlua.c src
+copy /Y src\lua*.h include
+copy /Y src\lua.hpp include
+copy /Y src\lauxlib.h include
+
+cd src
+del *.obj *.o *.lib
+cl /MD /O2 /c /DLUA_BUILD_AS_DLL *.c
+ren lua.obj lua.o
+ren luac.obj luac.o
+ren wlua.obj wlua.o
+link /DLL /IMPLIB:lua5.3.5.lib /OUT:../bin/lua5.3.dll *.obj
+copy lua5.3.5.lib ..\bin\lua5.3.lib
+link /OUT:../bin/lua5.3.exe /SUBSYSTEM:CONSOLE lua.o lua5.3.5.lib
+link /OUT:../bin/wlua5.3.exe /SUBSYSTEM:WINDOWS wlua.o lua.o lua5.3.5.lib
+lib /OUT:lua5.3.5-static.lib *.obj
+link /OUT:../bin/luac5.3.exe /SUBSYSTEM:CONSOLE luac.o lua5.3.5-static.lib
+cd ../.. \ No newline at end of file
diff --git a/dist/win/deps/fltk4lua-0.1-1.rockspec b/dist/win/deps/fltk4lua-0.1-1.rockspec
new file mode 100644
index 0000000..7161c4b
--- /dev/null
+++ b/dist/win/deps/fltk4lua-0.1-1.rockspec
@@ -0,0 +1,127 @@
+package = "fltk4lua"
+version = "0.1-1"
+source = {
+ url = "gitrec+https://github.com/siffiejoe/lua-fltk4lua.git",
+ tag = "v0.1"
+}
+description = {
+ summary = "Lua binding to FLTK, the Fast Light ToolKit",
+ detailed = [[
+ Lua binding to FLTK, a C++ GUI toolkit, which allows you to
+ create GUIs from within Lua programs.
+ ]],
+ homepage = "https://github.com/siffiejoe/lua-fltk4lua/",
+ license = "MIT+LGPL"
+}
+supported_platforms = { "unix", "windows" }
+dependencies = {
+ "lua >= 5.1, < 5.4",
+ "luarocks-fetch-gitrec",
+ "luarocks-build-cpp",
+}
+external_dependencies = {
+ platforms = {
+ windows = {
+ FLTK = {
+ header = "FL/Fl",
+ library = "fltk"
+ }
+ },
+ unix = {
+ FLTK = {
+ program = "fltk-config"
+ }
+ }
+ }
+}
+build = {
+ type = "make",
+ variables = {
+ DLL_INSTALL_DIR = "$(LIBDIR)",
+ LUA_INCDIR = "$(LUA_INCDIR)",
+ FLTK_CONFIG = "$(FLTK_BINDIR)/fltk-config",
+ CXX = "g++",
+ CFLAGS = "$(CFLAGS)",
+ LIBFLAG = "$(LIBFLAG)",
+ LIB_EXTENSION = "$(LIB_EXTENSION)",
+ },
+ platforms = {
+ windows = {
+ type = "cpp",
+ modules = {
+ ["fltk4lua"] = {
+ sources = {
+ "src/fltk4lua.cxx",
+ "src/f4l_enums.cxx",
+ "src/f4l_ask.cxx",
+ "src/f4l_image.cxx",
+ "src/f4l_shared_image.cxx",
+ "src/f4l_widget.cxx",
+ "src/f4l_box.cxx",
+ "src/f4l_button.cxx",
+ "src/f4l_chart.cxx",
+ "src/f4l_clock.cxx",
+ "src/f4l_group.cxx",
+ "src/f4l_browserx.cxx",
+ "src/f4l_browser.cxx",
+ "src/f4l_file_browser.cxx",
+ "src/f4l_check_browser.cxx",
+ "src/f4l_input_choice.cxx",
+ "src/f4l_color_chooser.cxx",
+ "src/f4l_pack.cxx",
+ "src/f4l_scroll.cxx",
+ "src/f4l_spinner.cxx",
+ "src/f4l_tabs.cxx",
+ "src/f4l_tile.cxx",
+ "src/f4l_window.cxx",
+ "src/f4l_wizard.cxx",
+ "src/f4l_input.cxx",
+ "src/f4l_menu.cxx",
+ "src/f4l_choice.cxx",
+ "src/f4l_menu_bar.cxx",
+ "src/f4l_menu_button.cxx",
+ "src/f4l_progress.cxx",
+ "src/f4l_valuator.cxx",
+ "src/f4l_adjuster.cxx",
+ "src/f4l_counter.cxx",
+ "src/f4l_dial.cxx",
+ "src/f4l_roller.cxx",
+ "src/f4l_slider.cxx",
+ "src/f4l_value_input.cxx",
+ "src/f4l_value_output.cxx",
+ "moon/moon.c",
+ "compat-5.3/c-api/compat-5.3.c",
+ },
+ defines = {
+ "MOON_PREFIX=f4lx",
+ "COMPAT53_PREFIX=f4lx",
+ "WIN32",
+ "NDEBUG",
+ "_CRT_SECURE_NO_WARNINGS"
+ },
+ libraries = {
+ "fltkimages",
+ "fltkjpeg",
+ "fltkpng",
+ "fltkzlib",
+ "fltk",
+ "advapi32",
+ "comctl32",
+ "gdi32",
+ "ole32",
+ "shell32",
+ "user32",
+ "uuid",
+ },
+ incdirs = {
+ "$(FLTK_INCDIR)",
+ "moon",
+ "compat-5.3/c-api"
+ },
+ libdirs = { "$(FLTK_LIBDIR)" }
+ }
+ }
+ }
+ }
+}
+
diff --git a/dist/win/deps/osc-1.0.1-1.rockspec b/dist/win/deps/osc-1.0.1-1.rockspec
new file mode 100644
index 0000000..77c2dc0
--- /dev/null
+++ b/dist/win/deps/osc-1.0.1-1.rockspec
@@ -0,0 +1,47 @@
+package = "osc"
+version = "1.0.1-1"
+source = {
+ url = 'git://github.com/lubyk/osc',
+ tag = 'REL-1.0.1',
+ dir = 'osc',
+}
+description = {
+ summary = "OpenSoundControl for Lua with some wrappers around lens.Socket.",
+ detailed = [[
+ Simply packs/unpacks between Lua values and binary strings ready to be sent
+ on the network or other transports.
+
+ Uses Ross Bencina oscpack library.
+ ]],
+ homepage = "http://doc.lubyk.org/osc.html",
+ license = "MIT"
+}
+
+dependencies = {
+ "lua >= 5.1, < 5.4",
+ "lub >= 1.0.3, < 2.0",
+}
+build = {
+ type = 'builtin',
+ modules = {
+ -- Plain Lua files
+ ['osc' ] = 'osc/init.lua',
+ ['osc.Client' ] = 'osc/Client.lua',
+ ['osc.Server' ] = 'osc/Server.lua',
+ -- C module
+ ['osc.core' ] = {
+ defines = {'OSC_HOST_LITTLE_ENDIAN'},
+ sources = {
+ 'src/bind/dub/dub.cpp',
+ 'src/bind/osc_core.cpp',
+ 'src/osc.cpp',
+ 'src/vendor/osc/OscOutboundPacketStream.cpp',
+ 'src/vendor/osc/OscPrintReceivedElements.cpp',
+ 'src/vendor/osc/OscReceivedElements.cpp',
+ 'src/vendor/osc/OscTypes.cpp',
+ },
+ incdirs = {'include', 'src/bind', 'src/vendor'},
+ },
+ },
+}
+
diff --git a/dist/win/deps/wlua.c b/dist/win/deps/wlua.c
new file mode 100644
index 0000000..7e3045f
--- /dev/null
+++ b/dist/win/deps/wlua.c
@@ -0,0 +1,16 @@
+#include <windows.h>
+#include <stdlib.h> /* declaration of __argc and __argv */
+
+extern int main(int, char **);
+
+int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int ncmdshow)
+{
+ int rc;
+
+ extern int __argc; /* this seems to work for all the compilers we tested, except Watcom compilers */
+ extern char** __argv;
+
+ rc = main(__argc, __argv);
+
+ return rc;
+}
diff --git a/dist/win/fix-paths.sh b/dist/win/fix-paths.sh
new file mode 100644
index 0000000..e401c76
--- /dev/null
+++ b/dist/win/fix-paths.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+PP="$1" # "D:/alive_pkg/dist/$1/lua/"
+PR=${PP//\//\\\\}\\\\?
+
+echo "replacing '$PP' / '$PR' with relative paths"
+
+for script in "dist/$2/lua/bin/"*.bat; do
+ echo "fixing '$script'..."
+ head -n 2 "$script" > "$script.nu"
+ cat <<EOF >> "$script.nu"
+set PR=%~dp0..\\
+set PP=%PR:\\=/%
+EOF
+
+ case "$(basename "$script" .bat)" in
+ alv-fltk|alv-wx)
+ tail -n 2 "$script" | \
+ sed -r "s|${PR}|%PR%|g" | \
+ sed -r "s|${PP}|%PP%|g" | \
+ sed 's|"%PR%bin\\lua5.3.exe"|start "Lua" "%PR%bin\\wlua5.3.exe"|' \
+ >> "$script.nu"
+ ;;
+ *)
+ tail -n 2 "$script" | \
+ sed -r "s|${PR}|%PR%|g" | \
+ sed -r "s|${PP}|%PP%|g" \
+ >> "$script.nu"
+ ;;
+ esac
+ mv "$script.nu" "$script"
+done
diff --git a/dist/win/gen-readme.sh b/dist/win/gen-readme.sh
new file mode 100644
index 0000000..99aa738
--- /dev/null
+++ b/dist/win/gen-readme.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+cat <<EOF >"dist/$1/README.txt"
+alive $2
+==========
+
+https://alv.s-ol.nu
+https://github.com/s-ol/alive
+
+License
+-------
+alive is licensed under the GPLv3 free and open-source license, a copy of which
+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\` 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
diff --git a/dist/win/wrappers/alv-fltk.bat b/dist/win/wrappers/alv-fltk.bat
new file mode 100644
index 0000000..92a4482
--- /dev/null
+++ b/dist/win/wrappers/alv-fltk.bat
@@ -0,0 +1,3 @@
+@echo off
+%~dp0lua\bin\alv-fltk.bat %*
+exit /b %ERRORLEVEL%
diff --git a/dist/win/wrappers/alv-lib/README.txt b/dist/win/wrappers/alv-lib/README.txt
new file mode 100644
index 0000000..3680eb2
--- /dev/null
+++ b/dist/win/wrappers/alv-lib/README.txt
@@ -0,0 +1,4 @@
+You can use this directory to add extensions to alv.
+See the extension documentation here for more information:
+
+https://alv.s-ol.nu/stable/internals/topics/extensions.md.html
diff --git a/dist/win/wrappers/alv.bat b/dist/win/wrappers/alv.bat
new file mode 100644
index 0000000..2efff91
--- /dev/null
+++ b/dist/win/wrappers/alv.bat
@@ -0,0 +1,3 @@
+@echo off
+%~dp0lua\bin\alv.bat --nocolor %*
+exit /b %ERRORLEVEL%
diff --git a/dist/win/wrappers/lua/lua.bat b/dist/win/wrappers/lua/lua.bat
new file mode 100644
index 0000000..f7fefe4
--- /dev/null
+++ b/dist/win/wrappers/lua/lua.bat
@@ -0,0 +1,7 @@
+@ECHO OFF
+SETLOCAL
+SET PR=%~dp0
+SET LUAROCKS_CONFIG=%PR%luarocks.config.lua
+%PR%bin\luarocks --lua-dir %PR% --tree %PR% LUA_INCDIR=%PR%include LUA_LIBDIR=%PR%bin path > %TMP%/_luarocks_path.bat
+call %tmp%/_luarocks_path
+%PR%bin\lua5.3 %*
diff --git a/dist/win/wrappers/lua/luarocks.bat b/dist/win/wrappers/lua/luarocks.bat
new file mode 100644
index 0000000..46a8dbd
--- /dev/null
+++ b/dist/win/wrappers/lua/luarocks.bat
@@ -0,0 +1,5 @@
+@ECHO OFF
+SETLOCAL
+SET PR=%~dp0
+SET LUAROCKS_CONFIG=%PR%luarocks.config.lua
+%PR%bin\luarocks --lua-dir %PR% --tree %PR% LUA_INCDIR=%PR%include LUA_LIBDIR=%PR%bin %*
diff --git a/dist/win/wrappers/lua/luarocks.config.lua b/dist/win/wrappers/lua/luarocks.config.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dist/win/wrappers/lua/luarocks.config.lua