From 2d716f386deb8620d5e29227a2a4eab4f9aeccf7 Mon Sep 17 00:00:00 2001 From: osch Date: Sun, 25 Feb 2024 09:20:03 +0100 Subject: [PATCH] github ci action: Workaround for msys2-luarocks bug not any longer needed, see https://github.com/msys2/MINGW-packages/pull/12002, fixed in https://github.com/msys2/MINGW-packages/pull/20166 --- .../mingw-w64-lua-luarocks/.gitignore | 5 - .../0001-luarocks_msys2_mingw_w64.patch | 114 ------------------ .../workflows/mingw-w64-lua-luarocks/PKGBUILD | 45 ------- .../luarocks-CLANG32.install | 21 ---- .../luarocks-CLANG64.install | 21 ---- .../luarocks-MINGW32.install | 21 ---- .../luarocks-MINGW64.install | 21 ---- .../luarocks-UCRT64.install | 21 ---- .github/workflows/test-windows.yml | 15 +-- 9 files changed, 6 insertions(+), 278 deletions(-) delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/.gitignore delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/PKGBUILD delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG32.install delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG64.install delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW32.install delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW64.install delete mode 100644 .github/workflows/mingw-w64-lua-luarocks/luarocks-UCRT64.install diff --git a/.github/workflows/mingw-w64-lua-luarocks/.gitignore b/.github/workflows/mingw-w64-lua-luarocks/.gitignore deleted file mode 100644 index 87b0535..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/*.tar.gz -/*.zst -/pkg -/src - diff --git a/.github/workflows/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch b/.github/workflows/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch deleted file mode 100644 index 6f1722e..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff file generated from Sutou Kouhei PR -> https://github.com/luarocks/luarocks/pull/1230/files -diff -Naur luarocks-3.7.0.orig/spec/util/test_env.lua luarocks-3.7.0/spec/util/test_env.lua ---- luarocks-3.7.0.orig/spec/util/test_env.lua 2021-04-13 23:53:36.000000000 +0200 -+++ luarocks-3.7.0/spec/util/test_env.lua 2021-07-25 17:43:16.413491100 +0200 -@@ -248,6 +248,8 @@ - test_env.MINGW = true - elseif argument == "vs" then - test_env.MINGW = false -+ elseif argument == "msys2_mingw_w64" then -+ test_env.MSYS2_MINGW_W64 = true - elseif argument:find("^lua_dir=") then - test_env.LUA_DIR = argument:match("^lua_dir=(.*)$") - elseif argument:find("^lua_interpreter=") then -@@ -429,7 +431,9 @@ - return execute_output("find " .. path .. " -type f -exec stat -f \"%z %N\" {} \\; | md5") - elseif test_env.TEST_TARGET_OS == "windows" then - return execute_output("\"" .. Q(test_env.testing_paths.win_tools .. "/find") .. " " .. Q(path) -- .. " -printf \"%s %p\"\" > temp_sum.txt && certUtil -hashfile temp_sum.txt && del temp_sum.txt") -+ .. " -printf \"%s %p\"\" > temp_sum.txt && " -+ .. "C:\\Windows\\System32\\certUtil -hashfile temp_sum.txt && " -+ .. "del temp_sum.txt") - end - end - -@@ -823,10 +827,14 @@ - if test_env.TEST_TARGET_OS == "windows" then - if test_env.MINGW then - table.insert(lines, [[SYSTEM = "mingw",]]) -+ elseif test_env.MSYS2_MINGW_W64 then -+ table.insert(lines, [[SYSTEM = "msys2_mingw_w64",]]) - else - table.insert(lines, [[SYSTEM = "windows",]]) - end -- table.insert(lines, ("WIN_TOOLS = %q,"):format(testing_paths.win_tools)) -+ if not test_env.MSYS2_MINGW_W64 then -+ table.insert(lines, ("WIN_TOOLS = %q,"):format(testing_paths.win_tools)) -+ end - end - - table.insert(lines, "}") -diff -Naur luarocks-3.7.0.orig/src/luarocks/core/cfg.lua luarocks-3.7.0/src/luarocks/core/cfg.lua ---- luarocks-3.7.0.orig/src/luarocks/core/cfg.lua 2021-04-13 23:53:36.000000000 +0200 -+++ luarocks-3.7.0/src/luarocks/core/cfg.lua 2021-07-25 17:51:51.829906200 +0200 -@@ -414,6 +414,7 @@ - defaults.makefile = "Makefile" - defaults.cmake_generator = "MSYS Makefiles" - defaults.local_cache = home.."/.cache/luarocks" -+ defaults.variables.PWD = "cd" - defaults.variables.MAKE = "make" - defaults.variables.CC = "gcc" - defaults.variables.RC = "windres" -@@ -745,7 +749,7 @@ - - local defaults = make_defaults(cfg.lua_version, processor, platforms, cfg.home) - -- if platforms.windows and hardcoded.WIN_TOOLS then -+ if platforms.windows and not platforms.msys2_mingw_w64 and hardcoded.WIN_TOOLS then - local tools = { "SEVENZ", "CP", "FIND", "LS", "MD5SUM", "WGET", } - for _, tool in ipairs(tools) do - defaults.variables[tool] = '"' .. hardcoded.WIN_TOOLS .. "/" .. defaults.variables[tool] .. '.exe"' -diff -Naur luarocks-3.7.0.orig/src/luarocks/fs/msys2_mingw_w64.lua luarocks-3.7.0/src/luarocks/fs/msys2_mingw_w64.lua ---- luarocks-3.7.0.orig/src/luarocks/fs/msys2_mingw_w64.lua 1970-01-01 01:00:00.000000000 +0100 -+++ luarocks-3.7.0/src/luarocks/fs/msys2_mingw_w64.lua 2021-07-25 17:52:51.477791300 +0200 -@@ -0,0 +1,12 @@ -+--- MSYS2 + Mingw-w64 implementation of filesystem and platform abstractions. -+local msys2_mingw_w64 = {} -+ -+local unix_tools = require("luarocks.fs.unix.tools") -+ -+msys2_mingw_w64.zip = unix_tools.zip -+msys2_mingw_w64.unzip = unix_tools.unzip -+msys2_mingw_w64.gunzip = unix_tools.gunzip -+msys2_mingw_w64.bunzip2 = unix_tools.bunzip2 -+msys2_mingw_w64.copy_contents = unix_tools.copy_contents -+ -+return msys2_mingw_w64 -\ No newline at end of file -diff -Naur luarocks-3.7.0.orig/src/luarocks/fs/unix/tools.lua luarocks-3.7.0/src/luarocks/fs/unix/tools.lua ---- luarocks-3.7.0.orig/src/luarocks/fs/unix/tools.lua 2021-04-13 23:53:36.000000000 +0200 -+++ luarocks-3.7.0/src/luarocks/fs/unix/tools.lua 2021-07-25 17:54:45.618437900 +0200 -@@ -152,13 +152,13 @@ - end - end - --local function uncompress(default_ext, program, infile, outfile) -+local function uncompress(default_ext, program, uncompress_flag, infile, outfile) - assert(type(infile) == "string") - assert(outfile == nil or type(outfile) == "string") - if not outfile then - outfile = infile:gsub("%."..default_ext.."$", "") - end -- if fs.execute(fs.Q(program).." -c "..fs.Q(infile).." > "..fs.Q(outfile)) then -+ if fs.execute(fs.Q(program).." "..fs.Q(uncompress_flag).." -c "..fs.Q(infile).." > "..fs.Q(outfile)) then - return true - else - return nil, "failed extracting " .. infile -@@ -171,7 +171,7 @@ - -- If not given, name is derived from input file. - -- @return boolean: true on success; nil and error message on failure. - function tools.gunzip(infile, outfile) -- return uncompress("gz", "gunzip", infile, outfile) -+ return uncompress("gz", "gzip", "-d", infile, outfile) - end - - --- Uncompresses a .bz2 file. -@@ -180,7 +180,7 @@ - -- If not given, name is derived from input file. - -- @return boolean: true on success; nil and error message on failure. - function tools.bunzip2(infile, outfile) -- return uncompress("bz2", "bunzip2", infile, outfile) -+ return uncompress("bz2", "bzip2", "-d", infile, outfile) - end - - do diff --git a/.github/workflows/mingw-w64-lua-luarocks/PKGBUILD b/.github/workflows/mingw-w64-lua-luarocks/PKGBUILD deleted file mode 100644 index d932551..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/PKGBUILD +++ /dev/null @@ -1,45 +0,0 @@ -# -# Modified PKGBUILD, see https://github.com/msys2/MINGW-packages/pull/12002 -# -# Maintainer: Ricky Wu -# Contributor: ImperatorS79 -# Contributoor: Ray Donnelly - -_realname=luarocks -pkgbase=mingw-w64-lua-${_realname} -pkgname=("${MINGW_PACKAGE_PREFIX}-lua-${_realname}") -pkgver=3.9.0 -pkgrel=2 -pkgdesc="the package manager for Lua modules (mingw-w64)" -arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') -install=${_realname}-${MSYSTEM}.install -url="https://luarocks.org" -license=("MIT") -depends=("${MINGW_PACKAGE_PREFIX}-lua" - "unzip" - "zip") -makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools") -options=('staticlibs' 'strip') -source=("https://luarocks.org/releases/${_realname}-${pkgver}.tar.gz" - "0001-luarocks_msys2_mingw_w64.patch") -sha256sums=('5e840f0224891de96be4139e9475d3b1de7af3a32b95c1bdf05394563c60175f' - '4ac1ec6372899693548d2d7d575f312d704b6883b50c8d4d3740f47a8e08eef3') - -prepare() { - cd "${srcdir}/${_realname}-${pkgver}" - patch -p1 -i "${srcdir}"/0001-luarocks_msys2_mingw_w64.patch -} - -build() { - cd "${srcdir}/${_realname}-${pkgver}" - ./configure --prefix=${MINGW_PREFIX} --lua-version=5.4 --with-lua-interpreter=lua.exe - make ./build/luarocks ./build/luarocks-admin ./build/config-5.4.lua - make LUA_VERSION=5.1 LUA_INTERPRETER=lua5.1.exe LUA_INCDIR=${MINGW_PREFIX}/include/lua5.1 ./build/config-5.1.lua -} - -package() { - cd "${srcdir}/${_realname}-${pkgver}" - make DESTDIR="${pkgdir}" install - make DESTDIR="$pkgdir" LUA_VERSION=5.1 install-config -} diff --git a/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG32.install b/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG32.install deleted file mode 100644 index 40a90b8..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG32.install +++ /dev/null @@ -1,21 +0,0 @@ -MINGW_PREFIX=/clang32 - -post_install() { - PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.1.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.4.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks-admin - -} - -post_upgrade() { - post_install -} \ No newline at end of file diff --git a/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG64.install b/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG64.install deleted file mode 100644 index 6d88fb7..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/luarocks-CLANG64.install +++ /dev/null @@ -1,21 +0,0 @@ -MINGW_PREFIX=/clang64 - -post_install() { - PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.1.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.4.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks-admin - -} - -post_upgrade() { - post_install -} \ No newline at end of file diff --git a/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW32.install b/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW32.install deleted file mode 100644 index 4f12a27..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW32.install +++ /dev/null @@ -1,21 +0,0 @@ -MINGW_PREFIX=/mingw32 - -post_install() { - PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.1.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.4.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks-admin - -} - -post_upgrade() { - post_install -} \ No newline at end of file diff --git a/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW64.install b/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW64.install deleted file mode 100644 index 67d1f90..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/luarocks-MINGW64.install +++ /dev/null @@ -1,21 +0,0 @@ -MINGW_PREFIX=/mingw64 - -post_install() { - PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.1.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.4.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks-admin - -} - -post_upgrade() { - post_install -} \ No newline at end of file diff --git a/.github/workflows/mingw-w64-lua-luarocks/luarocks-UCRT64.install b/.github/workflows/mingw-w64-lua-luarocks/luarocks-UCRT64.install deleted file mode 100644 index e92f126..0000000 --- a/.github/workflows/mingw-w64-lua-luarocks/luarocks-UCRT64.install +++ /dev/null @@ -1,21 +0,0 @@ -MINGW_PREFIX=/ucrt64 - -post_install() { - PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX}) - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.1.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/etc/luarocks/config-5.4.lua - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks - - sed -s "s|${MINGW_PREFIX}|${PREFIX_WIN}|g" \ - -i ${MINGW_PREFIX}/bin/luarocks-admin - -} - -post_upgrade() { - post_install -} \ No newline at end of file diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 83d0a56..c0e3039 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -35,26 +35,23 @@ jobs: libtool:p pkgconf:p autotools:p - lua:p cairo:p - - name: setup-luarocks + - name: setup-lua-luarocks shell: msys2 {0} run: | uname -a pwd echo "-----------------------------------------------------------" - echo "-- Workaround for msys2-luarocks bug, " - echo "-- see: https://github.com/msys2/MINGW-packages/pull/12002 " - echo "-----------------------------------------------------------" - cd .github/workflows/mingw-w64-lua-luarocks - makepkg-mingw -isCf --noconfirm - cd - + pacboy --noconfirm -Sy lua:p lua-luarocks:p echo "-----------------------------------------------------------" type lua type luarocks + echo "-----------------------------------------------------------" lua -v - luarocks + echo "-----------------------------------------------------------" + luarocks --version + echo "-----------------------------------------------------------" luarocks install luafilesystem - name: setup-lwtk