aboutsummaryrefslogtreecommitdiff
path: root/binary
diff options
context:
space:
mode:
authortobil4sk <tobil4sk@outlook.com>2026-02-03 22:47:50 +0000
committerGitHub <noreply@github.com>2026-02-03 19:47:50 -0300
commit47301d83aba58925e1b9594023621ebb27070cdb (patch)
tree73021b5366687ec1683b9e66505e74f22f71d31b /binary
parentacf1f47e7f1b1ecbc147e41cae51ddfd06ad898d (diff)
downloadluarocks-47301d83aba58925e1b9594023621ebb27070cdb.tar.gz
luarocks-47301d83aba58925e1b9594023621ebb27070cdb.tar.bz2
luarocks-47301d83aba58925e1b9594023621ebb27070cdb.zip
Improve flexibility around vendored librariesmain
compat53 is vendored since #1757 as it is required to run luarocks with lua 5.1 or 5.2. However, this introduced some issues as the GNUmakefile install rule places these in the same place where `luarocks install compat53` would install them. This means you get conflicts if you install the actual package: ``` Warning: /.../prefix/share/lua/5.1/compat53/init.lua is not tracked by this installation of LuaRocks. Moving it to /.../prefix/share/lua/5.1/compat53/init.lua~ Warning: /.../prefix/share/lua/5.1/compat53/module.lua is not tracked by this installation of LuaRocks. Moving it to /.../prefix/share/lua/5.1/compat53/module.lua~ Warning: /.../prefix/share/lua/5.1/compat53/file_mt.lua is not tracked by this installation of LuaRocks. Moving it to /.../prefix/share/lua/5.1/compat53/file_mt.lua~ ``` It is also not ideal for linux package maintainers to include a vendored package, see: https://github.com/luarocks/luarocks/pull/1757#issuecomment-3409873412. To solve these issues, this patchset makes the following changes: - GNUmakefile now places the compat53 files under `luarocks/vendor/compat53` (which is added internally to the luarocks script's `package.path`). This way a user's installation of compat53 does not interfere at all with luarocks one. - Added `--with-system-compat53` option to configure script for external packaging systems. - Fixed install.bat's logic for deciding whether to vendor compat53, as the current script includes it for every version. install.bat already places luarocks sources outside of LUAPATH, so that part can stay as is. I've also inverted the version check to avoid the need for future patches like: #1850.
Diffstat (limited to 'binary')
-rwxr-xr-xbinary/all_in_one10
1 files changed, 5 insertions, 5 deletions
diff --git a/binary/all_in_one b/binary/all_in_one
index e3d595d7..1b096936 100755
--- a/binary/all_in_one
+++ b/binary/all_in_one
@@ -44,7 +44,7 @@ end
44local LUA_MODULES = TARGET_DIR .. "/lua_modules" 44local LUA_MODULES = TARGET_DIR .. "/lua_modules"
45local CONFIG_DIR = TARGET_DIR .. "/.luarocks" 45local CONFIG_DIR = TARGET_DIR .. "/.luarocks"
46 46
47package.path = "./src/?.lua;" .. package.path 47package.path = "./src/?.lua;" .. "./vendor/?.lua;" .. package.path
48 48
49local fs = require("luarocks.fs") 49local fs = require("luarocks.fs")
50local cfg = require("luarocks.core.cfg") 50local cfg = require("luarocks.core.cfg")
@@ -385,17 +385,17 @@ end
385 385
386local function nonnull(x) return x ~= nil end 386local function nonnull(x) return x ~= nil end
387 387
388local function generate(main_program, dir, skip) 388local function generate(main_program, src_dir, vendor_dir, skip)
389 local program_name = main_program:gsub(".*/", "") 389 local program_name = main_program:gsub(".*/", "")
390 390
391 local hardcoded = write_hardcoded_module(dir) 391 local hardcoded = write_hardcoded_module(src_dir)
392 392
393 local out = {} 393 local out = {}
394 table.insert(out, ([[static const char* progname = %q;]]):format(program_name)) 394 table.insert(out, ([[static const char* progname = %q;]]):format(program_name))
395 table.insert(out, c_preamble) 395 table.insert(out, c_preamble)
396 load_main(out, main_program, program_name) 396 load_main(out, main_program, program_name)
397 local lua_modules = LUA_MODULES .. "/share/lua/" .. cfg.lua_version 397 local lua_modules = LUA_MODULES .. "/share/lua/" .. cfg.lua_version
398 declare_modules(out, { dir, lua_modules }, skip) 398 declare_modules(out, { src_dir, vendor_dir, lua_modules }, skip)
399 local a_files = declare_libraries(out, LUA_MODULES .. "/lib/lua/" .. cfg.lua_version) 399 local a_files = declare_libraries(out, LUA_MODULES .. "/lib/lua/" .. cfg.lua_version)
400 table.insert(out, c_main) 400 table.insert(out, c_main)
401 401
@@ -497,7 +497,7 @@ local function main()
497 end 497 end
498 end 498 end
499 499
500 generate(MAIN_PROGRAM, "src", { EXCLUDE, "^bin/?" }) 500 generate(MAIN_PROGRAM, "src", "vendor", { EXCLUDE, "^bin/?" })
501end 501end
502 502
503main() 503main()