From 72ec490dbd079556d2b043d65d63405fb1cc1a3b Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 19 Aug 2024 12:24:53 -0500 Subject: Pack distributables for release builds --- init | 14 +++++++++++++- meta.lua | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/init b/init index 010113c..4c3a926 100755 --- a/init +++ b/init @@ -3,4 +3,16 @@ cd luafilesystem luarocks config variables.CFLAGS " $CFLAGS" luarocks make --pack-binary-rock luafilesystem-scm-1.rockspec -cp luafilesystem-scm-1.mingw32-x86_64.rock /root +ojb="luafilesystem-scm-1.$(luarocks config arch).rock" +cp $obj /root +cd /root +if [ -n $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then + # Debug build +else + # Release build, delete docs/ and tests/ + zip -d $obj docs/ docs/* tests/ tests/* + # And pack the library + unzip $obj lib/* + upx lib/* + zip -r -u $obj lib +fi diff --git a/meta.lua b/meta.lua index db0d812..d2f5f56 100644 --- a/meta.lua +++ b/meta.lua @@ -33,7 +33,7 @@ for version, link, name, optimization, rel, flag, _, image in cartesian(lua_vers {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, }, produces = { - "luafilesystem-scm-1.mingw32-x86_64.rock" + ["luafilesystem-scm-1.mingw32-x86_64.rock"] = image .. "/" .. rel .. "/" .. name .. "/" .. version }, env = { CFLAGS = optimization .. " " .. flag, -- cgit v1.2.3-55-g6feb