From 91a209d5cb103feab7f4f73c43f67d3cae541ce6 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Tue, 15 Oct 2024 11:32:01 -0500 Subject: Add License task --- License.md | 12 ++++++++++++ guid_replacer.awk | 26 ++++++++++++++++++++++++++ init | 5 +++-- license | 3 +++ lua4win.wxs | 6 +++--- meta.lua | 9 +++++++++ 6 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 License.md create mode 100644 guid_replacer.awk create mode 100644 license diff --git a/License.md b/License.md new file mode 100644 index 0000000..6ac08ad --- /dev/null +++ b/License.md @@ -0,0 +1,12 @@ +This distribution may contain the following software, under the following (license)s: +Lua (MIT) 1994-2024 Lua.org, PUC-Rio +LuaJIT (MIT) 2005-2023 Mike Pall +Luarocks (MIT) 2007-2011 Kepler Project + 2011-2022 LuaRocks project authors +Additional patches and packaging (MIT) 2024 Alexander Pickering. + +Permission 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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE 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 @@ +#!/usr/bin/env awk + +BEGIN{ + print "#!/usr/bin/env sed" +} + +match($0, /Guid="Lua4Win.[^"]+"/) { + plain = substr($0, RSTART+6, RLENGTH-7) + cmd = "echo -n " plain " | sha512sum | head -c 32" + while((cmd | getline) > 0) + str = toupper($0) + print str + i = 1 + guid_1 = substr(str,i,8) + i+=8 + guid_2 = substr(str,i,4) + i+=4 + guid_3 = substr(str,i,4) + i+=4 + guid_4 = substr(str,i,4) + i+=4 + guid_5 = substr(str,i,12) + i+=12 + print "s/" plain "/" guid_1 "-" guid_2 "-" guid_3 "-" guid_4 "-" guid_5 "/g" + close(cmd) +} diff --git a/init b/init index 4c669ee..a9ea9dd 100755 --- a/init +++ b/init @@ -2,8 +2,9 @@ cp lua4win-dist-lua/lua4win.wxs . cp lua4win-dist-lua/License.rtf . -echo "#!/usr/bin/env lua" > config.lua -ln -s /usr/share/wixl-0.103/ext/ui ui +echo "#!/usr/bin/env lua" > config-5.1.lua +cat lua4win.wxs | awk -f lua4win-dist-lua/guid_replacer.awk > replacer.sed +sed -i -f replacer.sed lua4win.wxs wix/candle lua4win.wxs # Validation causes errors, but the msi seems to work. wix/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 @@ +#!/bin/sh -ex + +pandoc -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 @@ - + - + - + diff --git a/meta.lua b/meta.lua index 74502d6..91558cd 100644 --- a/meta.lua +++ b/meta.lua @@ -1,11 +1,20 @@ local build = {} +build["lua4win-license"] = { + image = "image-pandoc", + requires = {}, + produces = { + ["License.rtf"] = true, + }, + entrypoint="license", +} build["lua4win-dist-lua"] = { image = "image-wix", requires = { {"cicd","luajit-three-debug-mingw64:luajit.exe"}, {"cicd","luajit-three-debug-mingw64:lua51.dll"}, {"cicd","luarocks-jit-three-debug-mingw64:luarocks.exe"}, + {"cicd","lua4win-license:License.rtf"} }, produces = { ["lua4win.msi"] = true, -- cgit v1.2.3-55-g6feb