about summary refs log tree commit diff
path: root/pkgs/development/lua-modules
diff options
context:
space:
mode:
authorAlexei Robyn <shados@shados.net>2019-06-20 23:20:02 +1000
committerAlexei Robyn <shados@shados.net>2019-06-20 23:20:02 +1000
commit4cdbc771fd42442893cdfbd8b09892ece37d822c (patch)
tree35d53977cda1f801bc88eb37cc45dee0ac9713ef /pkgs/development/lua-modules
parentac28607a039eb8d04f756265d6ead55efea4c27f (diff)
downloadnixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar.gz
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar.bz2
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar.lz
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar.xz
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.tar.zst
nixlib-4cdbc771fd42442893cdfbd8b09892ece37d822c.zip
luaPackages.bit32: Tiny patch to fix a LuaJIT-incompatible declaration
Diffstat (limited to 'pkgs/development/lua-modules')
-rw-r--r--pkgs/development/lua-modules/bit32.patch14
-rw-r--r--pkgs/development/lua-modules/overrides.nix10
2 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/development/lua-modules/bit32.patch b/pkgs/development/lua-modules/bit32.patch
new file mode 100644
index 000000000000..544c4d423981
--- /dev/null
+++ b/pkgs/development/lua-modules/bit32.patch
@@ -0,0 +1,14 @@
+diff -Naur lua-compat-5.2/c-api/compat-5.2.h lua-compat-5.2-patched/c-api/compat-5.2.h
+--- lua-compat-5.2/c-api/compat-5.2.h	2015-02-19 09:23:42.000000000 +1100
++++ lua-compat-5.2-patched/c-api/compat-5.2.h	2019-06-17 17:58:13.585361793 +1000
+@@ -146,8 +146,10 @@
+ #define lua_pushglobaltable(L) \
+   lua_pushvalue(L, LUA_GLOBALSINDEX)
+ 
++#if !defined(luaL_newlib)
+ #define luaL_newlib(L, l) \
+   (lua_newtable((L)),luaL_setfuncs((L), (l), 0))
++#endif
+ 
+ void luaL_checkversion (lua_State *L);
+ 
diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix
index 1967668b1a75..1ce2dc809e5b 100644
--- a/pkgs/development/lua-modules/overrides.nix
+++ b/pkgs/development/lua-modules/overrides.nix
@@ -6,10 +6,12 @@ with super;
   #### manual fixes for generated packages
   ##########################################3
   bit32 = super.bit32.override({
-    disabled = !isLua51;
-    # Theoretically works with luajit, but it does redefine at least one Lua
-    # 5.2 function that Luajit 2.1 provides, see:
-    # https://github.com/LuaJIT/LuaJIT/issues/325
+    # Small patch in order to no longer redefine a Lua 5.2 function that Luajit
+    # 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for
+    # more
+    patches = [
+      ./bit32.patch
+    ];
   });
 
   busted = super.busted.override({