From 5fa9e09511f2883572bac2a899419e2097204787561ece7ac4182afc0731ac39 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Fri, 2 Sep 2022 12:43:18 +0000 Subject: [PATCH] Accepting request 1000887 from home:gmbr3:Lua - Add lib64.patch: * Fix luarocks placing files in incorrect libdir OBS-URL: https://build.opensuse.org/request/show/1000887 OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luarocks?expand=0&rev=27 --- lib64.patch | 37 +++++++++++++++++++++++++++++++++++++ lua-luarocks.changes | 6 ++++++ lua-luarocks.spec | 3 ++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 lib64.patch diff --git a/lib64.patch b/lib64.patch new file mode 100644 index 0000000..e5964af --- /dev/null +++ b/lib64.patch @@ -0,0 +1,37 @@ +From aed621d5db1d521404238a92f16b879180a469a2 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Wed, 27 Jan 2021 20:32:07 -0800 +Subject: [PATCH] Dynamically detect libdir on Linux + +Some Linux distributions (e.g. Fedora, CentOS) put 64-bit libraries +in `/usr/lib64` rather than `/usr/lib`. On such systems `luarocks` +should use `lib64` rather than `lib`. + +Signed-off-by: Michel Alexandre Salim +--- + src/luarocks/core/cfg.lua | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua +index 4ac5ee281..c7d2cb2cb 100644 +--- a/src/luarocks/core/cfg.lua ++++ b/src/luarocks/core/cfg.lua +@@ -397,6 +397,18 @@ local function make_defaults(lua_version, target_cpu, platforms, home) + local xdg_cache_home = os.getenv("XDG_CACHE_HOME") or home.."/.cache" + defaults.local_cache = xdg_cache_home.."/luarocks" + defaults.web_browser = "xdg-open" ++ if platforms.linux then ++ -- inline code from fs/linux.lua since ++ -- luarocks.fs can't be required here ++ -- (circular dependencies) ++ local fd, _, code = io.open("/usr/lib64", "r") ++ if code ~= 2 then ++ defaults.lib_modules_path = "/lib64/lua/"..lua_version ++ end ++ if fd then ++ fd:close() ++ end ++ end + end + + if platforms.cygwin then diff --git a/lua-luarocks.changes b/lua-luarocks.changes index b8f7bc2..0c9a5e4 100644 --- a/lua-luarocks.changes +++ b/lua-luarocks.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 2 12:42:27 UTC 2022 - Callum Farmer + +- Add lib64.patch: + * Fix luarocks placing files in incorrect libdir + ------------------------------------------------------------------- Tue Aug 23 07:36:14 UTC 2022 - Gordon Leung diff --git a/lua-luarocks.spec b/lua-luarocks.spec index e8aa1f2..ecd11f7 100644 --- a/lua-luarocks.spec +++ b/lua-luarocks.spec @@ -33,6 +33,7 @@ License: MIT Group: Development/Languages/Other URL: https://luarocks.org Source0: https://luarocks.org/releases/%{mod_name}-%{version}.tar.gz +Patch0: lib64.patch BuildRequires: %{flavor}-devel BuildRequires: curl BuildRequires: openssl @@ -57,7 +58,7 @@ correct version is loaded. LuaRocks supports both local and remote repositories, and multiple local rocks trees. %prep -%autosetup -n %{mod_name}-%{version} +%autosetup -n %{mod_name}-%{version} -p1 %build # Not an autotools based system