about summary refs log tree commit diff
path: root/pkgs/top-level/lua-packages.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level/lua-packages.nix')
-rw-r--r--pkgs/top-level/lua-packages.nix26
1 files changed, 20 insertions, 6 deletions
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index 3db9e66a98ee..a5490970b728 100644
--- a/pkgs/top-level/lua-packages.nix
+++ b/pkgs/top-level/lua-packages.nix
@@ -112,6 +112,11 @@ let
 
     buildInputs = [ expat ];
 
+    preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+      substituteInPlace Makefile \
+      --replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
+    '';
+
     preBuild = ''
       makeFlagsArray=(
         LUA_LDIR="$out/share/lua/${lua.luaversion}"
@@ -121,7 +126,7 @@ let
 
     meta = {
       homepage = "http://matthewwild.co.uk/projects/luaexpat";
-      hydraPlatforms = stdenv.lib.platforms.linux;
+      hydraPlatforms = stdenv.lib.platforms.unix;
       maintainers = [ stdenv.lib.maintainers.flosse ];
     };
   };
@@ -132,9 +137,16 @@ let
       url = "https://github.com/keplerproject/luafilesystem/archive/v1_6_2.tar.gz";
       sha256 = "134azkxw84xp9g5qmzjsmcva629jm7plwcmjxkdzdg05vyd7kig1";
     };
+    preConfigure = "substituteInPlace config --replace 'CC= gcc' '';"
+    + stdenv.lib.optionalString stdenv.isDarwin ''
+      substituteInPlace config \
+      --replace 'LIB_OPTION= -shared' '###' \
+      --replace '#LIB_OPTION= -bundle' 'LIB_OPTION= -bundle'
+      substituteInPlace Makefile --replace '10.3' '10.5'
+    '';
     meta = {
       homepage = "https://github.com/keplerproject/luafilesystem";
-      hydraPlatforms = stdenv.lib.platforms.linux;
+      hydraPlatforms = stdenv.lib.platforms.unix;
       maintainers = with maintainers; [ flosse ];
     };
   };
@@ -237,29 +249,31 @@ let
 
   luazlib = buildLuaPackage rec {
     name = "zlib-${version}";
-    version = "0.4";
+    version = "1.1";
 
     src = fetchzip {
       url = "https://github.com/brimworks/lua-zlib/archive/v${version}.tar.gz";
-      sha256 = "1pgxnjc0gvk25wsr69nsm60y5ad86z1nlq7mzj3ckygzkgi782dd";
+      sha256 = "1520lk4xpf094xn2zallqgqhs0zb4w61l49knv9y8pmhkdkxzzgy";
     };
 
     buildInputs = [ zlib ];
 
+    preConfigure = "substituteInPlace Makefile --replace gcc cc --replace '-llua' ''";
+
     preBuild = ''
       makeFlagsArray=(
         ${platformString}
         LUAPATH="$out/share/lua/${lua.luaversion}"
         LUACPATH="$out/lib/lua/${lua.luaversion}"
         INCDIR="-I${lua}/include"
-        LIBDIR="-L$out/lib");
+        LIBDIR="-L${lua}/lib");
     '';
 
     preInstall = "mkdir -p $out/lib/lua/${lua.luaversion}";
 
     meta = with stdenv.lib; {
       homepage = https://github.com/brimworks/lua-zlib;
-      hydraPlatforms = platforms.linux;
+      hydraPlatforms = platforms.unix;
       license = licenses.mit;
       maintainers = [ maintainers.koral ];
     };