From 36c872b96fb4335078558cec78075d2c332114ea Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Thu, 7 Nov 2024 23:44:15 -0600 Subject: Patch wget to use short options --- init | 1 + meta.lua | 3 +++ wget.patch | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 wget.patch diff --git a/init b/init index 5943696..ece283c 100755 --- a/init +++ b/init @@ -11,6 +11,7 @@ cd luarocks mkdir build-binary sed -i 's/local program_version = "dev"/local program_version = "lua4.win"/g' /root/luarocks/src/luarocks/core/cfg.lua patch -i /root/luarocks-packaging/all_in_one.patch binary/all_in_one +patch -i /root/luarocks-packaging/wget.patch src/luarocks/fs/tools.lua LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one "src/bin/luarocks" "" "^src/luarocks/admin/" "/config" "build-binary" "yes" "windows" if [ -e "/root/luarocks-packaging/luarocks.exe.c.$LUA_VER.patch" ]; then patch -i "/root/luarocks-packaging/luarocks.exe.c.$LUA_VER.patch" build-binary/luarocks.exe.c diff --git a/meta.lua b/meta.lua index dd3ad09..89c6f6b 100644 --- a/meta.lua +++ b/meta.lua @@ -67,6 +67,9 @@ for version_k, version_v, opti_k, opti_v, debug_k, debug_v, comp_k, comp_v in ca LUA_VER=version_k, } } + -- Lua can't just be pulled from git, the .tar.gz releases include extra + -- information and files not stored in git. + -- Luajit can just be built from git though. if version_k ~= "jit" then builds[name].requires[#builds[name].requires + 1] = {"http", version_v.link} else diff --git a/wget.patch b/wget.patch new file mode 100644 index 0000000..11d46d4 --- /dev/null +++ b/wget.patch @@ -0,0 +1,29 @@ +--- a/src/luarocks/fs/tools.lua ++++ b/src/luarocks/fs/tools.lua +@@ -153,6 +153,7 @@ end + function tools.use_downloader(url, filename, cache) + assert(type(url) == "string") + assert(type(filename) == "string" or not filename) ++ cache = false + + filename = fs.absolute_name(filename or dir.base_name(url)) + +@@ -163,7 +164,7 @@ function tools.use_downloader(url, filename, cache) + + local ok = false + if downloader == "wget" then +- local wget_cmd = vars.WGET.." "..vars.WGETNOCERTFLAG.." --no-cache --user-agent=\""..cfg.user_agent.." via wget\" --quiet " ++ local wget_cmd = vars.WGET.." "..vars.WGETNOCERTFLAG.." -U \""..cfg.user_agent.." via wget\" -q " + if cfg.connection_timeout and cfg.connection_timeout > 0 then + wget_cmd = wget_cmd .. "--timeout="..tostring(cfg.connection_timeout).." --tries=1 " + end +@@ -175,7 +176,7 @@ function tools.use_downloader(url, filename, cache) + ok = fs.execute_quiet(wget_cmd.." --timestamping ", url) + fs.pop_dir() + elseif filename then +- ok = fs.execute_quiet(wget_cmd.." --output-document ", filename, url) ++ ok = fs.execute_quiet(wget_cmd.." -O", filename, url) + else + ok = fs.execute_quiet(wget_cmd, url) + end + -- cgit v1.2.3-55-g6feb