git.s-ol.nu alive / 1459ebb
once again, revamp windows distribution s-ol 1 year, 1 month ago
18 changed file(s) with 342 addition(s) and 116 deletion(s). Raw diff Collapse all Expand all
00 *.zip
1 *.tar.gz
12 *.rock
23 *.rock.asc
34 alive-test-999.*
5 alive-*-win/
6 win/deps/*/
+0
-24
dist/fix-bat-script.sh less more
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
-90
dist/pack-win.sh less more
0 #!/bin/sh
1
2 TAG="$1"
3 ROCKVER="$2"
4 LUA_WIN="$3"
5 if [ -z "$LUA_WIN" ]; then
6 LUA_WIN="/mnt/d/alive_pkg/lua"
7 fi
8
9 BUNDLE="alive-$TAG-win"
10 ROCK="alive-$ROCKVER.all.rock"
11
12 set -e
13
14 if [ "$TAG" = "test" ]; then
15 rm -rf "dist/$BUNDLE" "dist/$BUNDLE.zip"
16 fi
17
18 if [ -e "dist/$BUNDLE.zip" ]; then
19 echo "dist/$BUNDLE.zip already exists!"
20 exit 2
21 fi
22
23 if [ -e "dist/$BUNDLE" ]; then
24 echo "dist/$BUNDLE already exists!"
25 exit 2
26 fi
27
28 mkdir -p "dist/$BUNDLE"
29
30 cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
31 rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
32 cp -r "$LUA_WIN" "dist/$BUNDLE/"
33
34 cat <<EOF >"dist/$BUNDLE/alv.bat"
35 @echo off
36 %~dp0lua\bin\alv.bat --nocolor %*
37 exit /b %ERRORLEVEL%
38 EOF
39
40 cat <<EOF >"dist/$BUNDLE/alv-fltk.bat"
41 @echo off
42 %~dp0lua\bin\alv-fltk.bat %*
43 exit /b %ERRORLEVEL%
44 EOF
45
46 for script in "dist/$BUNDLE/lua/bin/"*.bat; do
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"
52 mv "$script.nu" "$script"
53 done
54
55 mkdir "dist/$BUNDLE/alv-lib"
56 cat <<EOF >"dist/$BUNDLE/alv-lib/README.txt"
57 You can use this directory to add extensions to alv.
58 See the extension documentation here for more information:
59
60 https://alv.s-ol.nu/stable/internals/topics/extensions.md.html
61 EOF
62
63 cat <<EOF >"dist/$BUNDLE/README.md"
64 alive $TAG
65 ==========
66
67 https://alv.s-ol.nu
68 https://github.com/s-ol/alive
69
70 License
71 -------
72 alive is licensed under the GPLv3 free and open-source license, a copy of which
73 you can find in the file \`LICENSE\`.
74
75 This binary distribution of alive contains the Lua interpreter, LuaRocks package
76 manager, and a number of Lua modules licensed under various terms. Lua and
77 LuaRocks are both licensed under the MIT license. The packages can be found
78 within the \`lua\` directory while their individual licensing information may be
79 viewed using \`luarocks.bat\`:
80
81 cmd.exe> luarocks.bat list
82 cmd.exe> luarocks.bat show moonscript
83 cmd.exe> luarocks.bat show ...
84 EOF
85
86 (
87 cd dist/
88 zip -rm "$BUNDLE.zip" "$BUNDLE"
89 )
0 SETLOCAL
1 SET TAG=%1
2 SET ROCK=%2
3 SET DEPS=%~dp0win\deps
4 SET BUNDLE=alive-%TAG%-win
5 rmdir /Q /S dist\%BUNDLE%
6 mkdir dist\%BUNDLE%
7
8 mkdir dist\%BUNDLE%\lua
9 mkdir dist\%BUNDLE%\lua\bin
10 mkdir dist\%BUNDLE%\lua\include
11 copy /Y %DEPS%\lua-5.3.5\bin\* dist\%BUNDLE%\lua\bin\
12 copy /Y %DEPS%\lua-5.3.5\include\* dist\%BUNDLE%\lua\include\
13 copy /Y %DEPS%\luarocks-3.3.1-windows-64\luarocks.exe dist\%BUNDLE%\lua\bin\
14 copy /Y hello.alv dist\%BUNDLE%\
15 copy /Y LICENSE dist\%BUNDLE%\LICENSE.txt
16 xcopy /E /I docs dist\%BUNDLE%\docs
17 xcopy /E /I dist\win\wrappers\* dist\%BUNDLE%\
18
19 cd dist\%BUNDLE%\lua
20 call luarocks install busted
21 call luarocks install %DEPS%\osc-1.0.1-1.rockspec
22 call luarocks install luarocks-fetch-gitrec
23 call luarocks install luarocks-build-cpp
24 call luarocks install %DEPS%\fltk4lua-0.1-1.rockspec FLTK_LIBDIR=%DEPS%\fltk-1.3.5\lib FLTK_INCDIR=%DEPS%\fltk-1.3.5
25 call luarocks --server https://luarocks.org/manifests/s-ol install %ROCK%
26 cd ..\..\..
27
28 set DIST_UNIX=%~dp0%BUNDLE%\lua\
29 set DIST_UNIX=%DIST_UNIX:\=/%
30 bash dist/win/fix-paths.sh %DIST_UNIX% %BUNDLE%
31 sh dist/win/gen-readme.sh %BUNDLE% %TAG%
125125 luarocks make "dist/rocks/alive-$VERSION-$REVISION.rockspec" $ROCK_OPTS \
126126 --deps-mode none --pack-binary-rock
127127 mv "alive-$VERSION-$REVISION.all.rock"* dist/rocks
128 echo "now install 'alive-$VERSION-$REVISION.all.rock' on windows and run"
129 echo dist/pack-win.sh "$TAG" "$VERSION-$REVISION"
128 echo "now run this in a windows dev cmd.exe:"
129 echo dist\win\release.bat "$TAG" "dist/rocks/alive-$VERSION-$REVISION.all.rock"
130130 fi
0 Building & Packaging on Windows
1 ===============================
2
3 1. download and build dependencies
4 - Lua:
5 - download `lua-5.3.5.tar.gz` and extract in `dist/win/deps`
6 - run `dist\\win\\build-lua.bat`
7 - luarocks:
8 - downlaod `luarocks-3.3.1-windows-64.zip` and extract in `dist/win/deps`
9 - FLTK:
10 - download `fltk-1.3.5-source.tar.gz` and extract in `dist/win/deps`
11 - compile the fltkdll project in `fltk-*/ide/VisualC2010/` in Release mode
12 2. build or obtain an alive binary rock (`alive-VERSION-REVISION.all.rock`)
13 3. run `dist\\release.bat VERSION path\to\alive-VERSION-REVISION.all.rock`
14 4. zip `dist\alive-VERSION-win` and distribute
0 cd %~dp0deps
1
2 cd lua-5.3.5
3 del /F /Q bin include
4 mkdir bin
5 mkdir include
6 copy /Y ..\wlua.c src
7 copy /Y src\lua*.h include
8 copy /Y src\lua.hpp include
9 copy /Y src\lauxlib.h include
10
11 cd src
12 del *.obj *.o *.lib
13 cl /MD /O2 /c /DLUA_BUILD_AS_DLL *.c
14 ren lua.obj lua.o
15 ren luac.obj luac.o
16 ren wlua.obj wlua.o
17 link /DLL /IMPLIB:lua5.3.5.lib /OUT:../bin/lua5.3.dll *.obj
18 copy lua5.3.5.lib ..\bin\lua5.3.lib
19 link /OUT:../bin/lua5.3.exe /SUBSYSTEM:CONSOLE lua.o lua5.3.5.lib
20 link /OUT:../bin/wlua5.3.exe /SUBSYSTEM:WINDOWS wlua.o lua.o lua5.3.5.lib
21 lib /OUT:lua5.3.5-static.lib *.obj
22 link /OUT:../bin/luac5.3.exe /SUBSYSTEM:CONSOLE luac.o lua5.3.5-static.lib
23 cd ../..
0 package = "fltk4lua"
1 version = "0.1-1"
2 source = {
3 url = "gitrec+https://github.com/siffiejoe/lua-fltk4lua.git",
4 tag = "v0.1"
5 }
6 description = {
7 summary = "Lua binding to FLTK, the Fast Light ToolKit",
8 detailed = [[
9 Lua binding to FLTK, a C++ GUI toolkit, which allows you to
10 create GUIs from within Lua programs.
11 ]],
12 homepage = "https://github.com/siffiejoe/lua-fltk4lua/",
13 license = "MIT+LGPL"
14 }
15 supported_platforms = { "unix", "windows" }
16 dependencies = {
17 "lua >= 5.1, < 5.4",
18 "luarocks-fetch-gitrec",
19 "luarocks-build-cpp",
20 }
21 external_dependencies = {
22 platforms = {
23 windows = {
24 FLTK = {
25 header = "FL/Fl",
26 library = "fltk"
27 }
28 },
29 unix = {
30 FLTK = {
31 program = "fltk-config"
32 }
33 }
34 }
35 }
36 build = {
37 type = "make",
38 variables = {
39 DLL_INSTALL_DIR = "$(LIBDIR)",
40 LUA_INCDIR = "$(LUA_INCDIR)",
41 FLTK_CONFIG = "$(FLTK_BINDIR)/fltk-config",
42 CXX = "g++",
43 CFLAGS = "$(CFLAGS)",
44 LIBFLAG = "$(LIBFLAG)",
45 LIB_EXTENSION = "$(LIB_EXTENSION)",
46 },
47 platforms = {
48 windows = {
49 type = "cpp",
50 modules = {
51 ["fltk4lua"] = {
52 sources = {
53 "src/fltk4lua.cxx",
54 "src/f4l_enums.cxx",
55 "src/f4l_ask.cxx",
56 "src/f4l_image.cxx",
57 "src/f4l_shared_image.cxx",
58 "src/f4l_widget.cxx",
59 "src/f4l_box.cxx",
60 "src/f4l_button.cxx",
61 "src/f4l_chart.cxx",
62 "src/f4l_clock.cxx",
63 "src/f4l_group.cxx",
64 "src/f4l_browserx.cxx",
65 "src/f4l_browser.cxx",
66 "src/f4l_file_browser.cxx",
67 "src/f4l_check_browser.cxx",
68 "src/f4l_input_choice.cxx",
69 "src/f4l_color_chooser.cxx",
70 "src/f4l_pack.cxx",
71 "src/f4l_scroll.cxx",
72 "src/f4l_spinner.cxx",
73 "src/f4l_tabs.cxx",
74 "src/f4l_tile.cxx",
75 "src/f4l_window.cxx",
76 "src/f4l_wizard.cxx",
77 "src/f4l_input.cxx",
78 "src/f4l_menu.cxx",
79 "src/f4l_choice.cxx",
80 "src/f4l_menu_bar.cxx",
81 "src/f4l_menu_button.cxx",
82 "src/f4l_progress.cxx",
83 "src/f4l_valuator.cxx",
84 "src/f4l_adjuster.cxx",
85 "src/f4l_counter.cxx",
86 "src/f4l_dial.cxx",
87 "src/f4l_roller.cxx",
88 "src/f4l_slider.cxx",
89 "src/f4l_value_input.cxx",
90 "src/f4l_value_output.cxx",
91 "moon/moon.c",
92 "compat-5.3/c-api/compat-5.3.c",
93 },
94 defines = {
95 "MOON_PREFIX=f4lx",
96 "COMPAT53_PREFIX=f4lx",
97 "WIN32",
98 "NDEBUG",
99 "_CRT_SECURE_NO_WARNINGS"
100 },
101 libraries = {
102 "fltkimages",
103 "fltkjpeg",
104 "fltkpng",
105 "fltkzlib",
106 "fltk",
107 "advapi32",
108 "comctl32",
109 "gdi32",
110 "ole32",
111 "shell32",
112 "user32",
113 "uuid",
114 },
115 incdirs = {
116 "$(FLTK_INCDIR)",
117 "moon",
118 "compat-5.3/c-api"
119 },
120 libdirs = { "$(FLTK_LIBDIR)" }
121 }
122 }
123 }
124 }
125 }
126
0 package = "osc"
1 version = "1.0.1-1"
2 source = {
3 url = 'git://github.com/lubyk/osc',
4 tag = 'REL-1.0.1',
5 dir = 'osc',
6 }
7 description = {
8 summary = "OpenSoundControl for Lua with some wrappers around lens.Socket.",
9 detailed = [[
10 Simply packs/unpacks between Lua values and binary strings ready to be sent
11 on the network or other transports.
12
13 Uses Ross Bencina oscpack library.
14 ]],
15 homepage = "http://doc.lubyk.org/osc.html",
16 license = "MIT"
17 }
18
19 dependencies = {
20 "lua >= 5.1, < 5.4",
21 "lub >= 1.0.3, < 2.0",
22 }
23 build = {
24 type = 'builtin',
25 modules = {
26 -- Plain Lua files
27 ['osc' ] = 'osc/init.lua',
28 ['osc.Client' ] = 'osc/Client.lua',
29 ['osc.Server' ] = 'osc/Server.lua',
30 -- C module
31 ['osc.core' ] = {
32 defines = {'OSC_HOST_LITTLE_ENDIAN'},
33 sources = {
34 'src/bind/dub/dub.cpp',
35 'src/bind/osc_core.cpp',
36 'src/osc.cpp',
37 'src/vendor/osc/OscOutboundPacketStream.cpp',
38 'src/vendor/osc/OscPrintReceivedElements.cpp',
39 'src/vendor/osc/OscReceivedElements.cpp',
40 'src/vendor/osc/OscTypes.cpp',
41 },
42 incdirs = {'include', 'src/bind', 'src/vendor'},
43 },
44 },
45 }
46
0 #include <windows.h>
1 #include <stdlib.h> /* declaration of __argc and __argv */
2
3 extern int main(int, char **);
4
5 int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int ncmdshow)
6 {
7 int rc;
8
9 extern int __argc; /* this seems to work for all the compilers we tested, except Watcom compilers */
10 extern char** __argv;
11
12 rc = main(__argc, __argv);
13
14 return rc;
15 }
0 #!/bin/bash
1 PP="$1" # "D:/alive_pkg/dist/$1/lua/"
2 PR=${PP//\//\\\\}\\\\?
3
4 echo "replacing '$PP' / '$PR' with relative paths"
5
6 for script in "dist/$2/lua/bin/"*.bat; do
7 echo "fixing '$script'..."
8 head -n 2 "$script" > "$script.nu"
9 cat <<EOF >> "$script.nu"
10 set PR=%~dp0..\\
11 set PP=%PR:\\=/%
12 EOF
13
14 case "$(basename "$script" .bat)" in
15 alv-fltk|alv-wx)
16 tail -n 2 "$script" | \
17 sed -r "s|${PR}|%PR%|g" | \
18 sed -r "s|${PP}|%PP%|g" | \
19 sed 's|"%PR%bin\\lua5.3.exe"|start "Lua" "%PR%bin\\wlua5.3.exe"|' \
20 >> "$script.nu"
21 ;;
22 *)
23 tail -n 2 "$script" | \
24 sed -r "s|${PR}|%PR%|g" | \
25 sed -r "s|${PP}|%PP%|g" \
26 >> "$script.nu"
27 ;;
28 esac
29 mv "$script.nu" "$script"
30 done
0 #!/bin/bash
1 cat <<EOF >"dist/$1/README.txt"
2 alive $2
3 ==========
4
5 https://alv.s-ol.nu
6 https://github.com/s-ol/alive
7
8 License
9 -------
10 alive is licensed under the GPLv3 free and open-source license, a copy of which
11 you can find in the file \`LICENSE\`.
12
13 This binary distribution of alive contains the Lua interpreter, LuaRocks package
14 manager, and a number of Lua modules licensed under various terms. Lua and
15 LuaRocks are both licensed under the MIT license. The packages can be found
16 within the \`lua\` directory while their individual licensing information may be
17 viewed using \`luarocks.bat\`:
18
19 cmd.exe> luarocks.bat list
20 cmd.exe> luarocks.bat show moonscript
21 cmd.exe> luarocks.bat show ...
22 EOF
0 @echo off
1 %~dp0lua\bin\alv-fltk.bat %*
2 exit /b %ERRORLEVEL%
0 You can use this directory to add extensions to alv.
1 See the extension documentation here for more information:
2
3 https://alv.s-ol.nu/stable/internals/topics/extensions.md.html
0 @echo off
1 %~dp0lua\bin\alv.bat --nocolor %*
2 exit /b %ERRORLEVEL%
0 @ECHO OFF
1 SETLOCAL
2 SET PR=%~dp0
3 SET LUAROCKS_CONFIG=%PR%luarocks.config.lua
4 %PR%bin\luarocks --lua-dir %PR% --tree %PR% LUA_INCDIR=%PR%include LUA_LIBDIR=%PR%bin path > %TMP%/_luarocks_path.bat
5 call %tmp%/_luarocks_path
6 %PR%bin\lua5.3 %*
0 @ECHO OFF
1 SETLOCAL
2 SET PR=%~dp0
3 SET LUAROCKS_CONFIG=%PR%luarocks.config.lua
4 %PR%bin\luarocks --lua-dir %PR% --tree %PR% LUA_INCDIR=%PR%include LUA_LIBDIR=%PR%bin %*