diff --git a/Ports/luarocks/patches/luarocks.patch b/Ports/luarocks/patches/0001-Setup-the-serenity-platform.patch similarity index 71% rename from Ports/luarocks/patches/luarocks.patch rename to Ports/luarocks/patches/0001-Setup-the-serenity-platform.patch index 35023ed49a..bea43802a5 100644 --- a/Ports/luarocks/patches/luarocks.patch +++ b/Ports/luarocks/patches/0001-Setup-the-serenity-platform.patch @@ -1,5 +1,16 @@ +From 372c6d3d0119e1c0b38f9eed0d7e9b4e45c355a3 Mon Sep 17 00:00:00 2001 +From: Daniel Lemos +Date: Tue, 15 Mar 2022 13:48:34 -0300 +Subject: [PATCH 1/2] Setup the serenity platform + +Setup serenity as a platform and configure `defaults.variables.UNZIP` to +work around our `unzip` command not supporting the flag `-n` +--- + src/luarocks/core/cfg.lua | 8 ++++++++ + 1 file changed, 8 insertions(+) + diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua -index 926d4793..7c2914b3 100644 +index 926d479..7c2914b 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -42,6 +42,7 @@ local platform_order = { @@ -31,19 +42,6 @@ index 926d4793..7c2914b3 100644 -- Expose some more values detected by LuaRocks for use by rockspec authors. defaults.variables.LIB_EXTENSION = defaults.lib_extension defaults.variables.OBJ_EXTENSION = defaults.obj_extension -diff --git a/src/luarocks/core/sysdetect.lua b/src/luarocks/core/sysdetect.lua -index 02b8a492..b05f170b 100644 ---- a/src/luarocks/core/sysdetect.lua -+++ b/src/luarocks/core/sysdetect.lua -@@ -189,6 +189,11 @@ local function detect_elf_system(fd, hdr, sections) - return "linux" - end - end -+ -+ local uname_s = io.popen("uname -s"):read("*l") -+ if uname_s == "SerenityOS" then -+ return "serenity" -+ end - end - - return system +-- +2.36.1 + diff --git a/Ports/luarocks/patches/0002-Detect-SerenityOS-using-the-uname-command.patch b/Ports/luarocks/patches/0002-Detect-SerenityOS-using-the-uname-command.patch new file mode 100644 index 0000000000..fe8bfb68ef --- /dev/null +++ b/Ports/luarocks/patches/0002-Detect-SerenityOS-using-the-uname-command.patch @@ -0,0 +1,28 @@ +From 0b568422cbd06468dad849f836b8de06c3e145e0 Mon Sep 17 00:00:00 2001 +From: Daniel Lemos +Date: Tue, 15 Mar 2022 13:48:34 -0300 +Subject: [PATCH 2/2] Detect SerenityOS using the `uname` command + +--- + src/luarocks/core/sysdetect.lua | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/luarocks/core/sysdetect.lua b/src/luarocks/core/sysdetect.lua +index 02b8a49..b05f170 100644 +--- a/src/luarocks/core/sysdetect.lua ++++ b/src/luarocks/core/sysdetect.lua +@@ -189,6 +189,11 @@ local function detect_elf_system(fd, hdr, sections) + return "linux" + end + end ++ ++ local uname_s = io.popen("uname -s"):read("*l") ++ if uname_s == "SerenityOS" then ++ return "serenity" ++ end + end + + return system +-- +2.36.1 + diff --git a/Ports/luarocks/patches/ReadMe.md b/Ports/luarocks/patches/ReadMe.md index e573efaab3..790e8cd861 100644 --- a/Ports/luarocks/patches/ReadMe.md +++ b/Ports/luarocks/patches/ReadMe.md @@ -1,8 +1,14 @@ -# Patches for LuaRocks on SerenityOS +# Patches for luarocks on SerenityOS -## `luarocks.patch` +## `0001-Setup-the-serenity-platform.patch` + +Setup the serenity platform + +Setup serenity as a platform and configure `defaults.variables.UNZIP` to +work around our `unzip` command not supporting the flag `-n` + +## `0002-Detect-SerenityOS-using-the-uname-command.patch` + +Detect SerenityOS using the `uname` command -src/luarocks/core/cfg.lua: Setup serenity as a platform and config `defaults.variables.UNZIP` to work around our `unzip` command not supporting the flag `-n` -src/luarocks/core/sysdetect.lua: Detect SerenityOS using the `uname` command -This should should be upstreamed so next versions of LuaRocks will support Serenity out of the box.