summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2024-10-15 11:32:01 -0500
committerAlexander M Pickering <alex@cogarr.net>2024-10-15 11:32:01 -0500
commit91a209d5cb103feab7f4f73c43f67d3cae541ce6 (patch)
tree6bb7ac1add7c3490a9bd9122bdfcc3c78e779cba
parentce0c322562bdcd6fd8c84b2cddcc7fd38f833b5f (diff)
downloadlua4win-dist-lua-91a209d5cb103feab7f4f73c43f67d3cae541ce6.tar.gz
lua4win-dist-lua-91a209d5cb103feab7f4f73c43f67d3cae541ce6.tar.bz2
lua4win-dist-lua-91a209d5cb103feab7f4f73c43f67d3cae541ce6.zip
Add License task
-rw-r--r--License.md12
-rw-r--r--guid_replacer.awk26
-rwxr-xr-xinit5
-rw-r--r--license3
-rw-r--r--lua4win.wxs6
-rw-r--r--meta.lua9
6 files changed, 56 insertions, 5 deletions
diff --git a/License.md b/License.md
new file mode 100644
index 0000000..6ac08ad
--- /dev/null
+++ b/License.md
@@ -0,0 +1,12 @@
1This distribution may contain the following software, under the following (license)s:
2Lua (MIT) 1994-2024 Lua.org, PUC-Rio
3LuaJIT (MIT) 2005-2023 Mike Pall
4Luarocks (MIT) 2007-2011 Kepler Project
5 2011-2022 LuaRocks project authors
6Additional patches and packaging (MIT) 2024 Alexander Pickering.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
10The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
12THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/guid_replacer.awk b/guid_replacer.awk
new file mode 100644
index 0000000..2a95a93
--- /dev/null
+++ b/guid_replacer.awk
@@ -0,0 +1,26 @@
1#!/usr/bin/env awk
2
3BEGIN{
4 print "#!/usr/bin/env sed"
5}
6
7match($0, /Guid="Lua4Win.[^"]+"/) {
8 plain = substr($0, RSTART+6, RLENGTH-7)
9 cmd = "echo -n " plain " | sha512sum | head -c 32"
10 while((cmd | getline) > 0)
11 str = toupper($0)
12 print str
13 i = 1
14 guid_1 = substr(str,i,8)
15 i+=8
16 guid_2 = substr(str,i,4)
17 i+=4
18 guid_3 = substr(str,i,4)
19 i+=4
20 guid_4 = substr(str,i,4)
21 i+=4
22 guid_5 = substr(str,i,12)
23 i+=12
24 print "s/" plain "/" guid_1 "-" guid_2 "-" guid_3 "-" guid_4 "-" guid_5 "/g"
25 close(cmd)
26}
diff --git a/init b/init
index 4c669ee..a9ea9dd 100755
--- a/init
+++ b/init
@@ -2,8 +2,9 @@
2 2
3cp lua4win-dist-lua/lua4win.wxs . 3cp lua4win-dist-lua/lua4win.wxs .
4cp lua4win-dist-lua/License.rtf . 4cp lua4win-dist-lua/License.rtf .
5echo "#!/usr/bin/env lua" > config.lua 5echo "#!/usr/bin/env lua" > config-5.1.lua
6ln -s /usr/share/wixl-0.103/ext/ui ui 6cat lua4win.wxs | awk -f lua4win-dist-lua/guid_replacer.awk > replacer.sed
7sed -i -f replacer.sed lua4win.wxs
7wix/candle lua4win.wxs 8wix/candle lua4win.wxs
8# Validation causes errors, but the msi seems to work. 9# Validation causes errors, but the msi seems to work.
9wix/light -ext WixUIExtension -sval lua4win.wixobj 10wix/light -ext WixUIExtension -sval lua4win.wixobj
diff --git a/license b/license
new file mode 100644
index 0000000..efda078
--- /dev/null
+++ b/license
@@ -0,0 +1,3 @@
1#!/bin/sh -ex
2
3pandoc -o License.rtf lua4win-dist-lua/License.md --from markdown --to rtf
diff --git a/lua4win.wxs b/lua4win.wxs
index b524e15..9e6e039 100644
--- a/lua4win.wxs
+++ b/lua4win.wxs
@@ -36,14 +36,14 @@
36 </Component> 36 </Component>
37 <Directory Id="Config" Name="config"> 37 <Directory Id="Config" Name="config">
38 <Component Id="Config"> 38 <Component Id="Config">
39 <File Id="config.lua" Source="config.lua" /> 39 <File Id="config.lua" Source="config-5.1.lua" />
40 </Component> 40 </Component>
41 </Directory> 41 </Directory>
42 <Component Id="EnvironmentPath"> 42 <Component Id="EnvironmentPath">
43 <Environment Id="AddPath" Name="PATH" Action="set" System="yes" Part="last" Value="[INSTALLDIR]"/> 43 <Environment Id="AddPath" Name="PATH" Action="set" System="yes" Part="last" Value="[INSTALLDIR]" Guid="Lua4Win.PATH" />
44 </Component> 44 </Component>
45 <Component Id="SysConfigPath"> 45 <Component Id="SysConfigPath">
46 <Environment Id="AddPath" Name="LUAROCKS_SYSCONFDIR" Action="set" System="yes" Part="last" Value="[INSTALLDIR]/config"/> 46 <Environment Id="AddPath" Name="LUAROCKS_SYSCONFDIR" Action="set" System="yes" Part="last" Value="[INSTALLDIR]/config" Guid="Lua4Win.SYSCONFDIR"/>
47 </Component> 47 </Component>
48 </Directory> 48 </Directory>
49 </Directory> 49 </Directory>
diff --git a/meta.lua b/meta.lua
index 74502d6..91558cd 100644
--- a/meta.lua
+++ b/meta.lua
@@ -1,11 +1,20 @@
1 1
2local build = {} 2local build = {}
3build["lua4win-license"] = {
4 image = "image-pandoc",
5 requires = {},
6 produces = {
7 ["License.rtf"] = true,
8 },
9 entrypoint="license",
10}
3build["lua4win-dist-lua"] = { 11build["lua4win-dist-lua"] = {
4 image = "image-wix", 12 image = "image-wix",
5 requires = { 13 requires = {
6 {"cicd","luajit-three-debug-mingw64:luajit.exe"}, 14 {"cicd","luajit-three-debug-mingw64:luajit.exe"},
7 {"cicd","luajit-three-debug-mingw64:lua51.dll"}, 15 {"cicd","luajit-three-debug-mingw64:lua51.dll"},
8 {"cicd","luarocks-jit-three-debug-mingw64:luarocks.exe"}, 16 {"cicd","luarocks-jit-three-debug-mingw64:luarocks.exe"},
17 {"cicd","lua4win-license:License.rtf"}
9 }, 18 },
10 produces = { 19 produces = {
11 ["lua4win.msi"] = true, 20 ["lua4win.msi"] = true,