about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-03-10 22:17:04 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-03-12 10:00:46 +0100
commit745c4779305490816682bb95b319923d27c4a8fe (patch)
tree858da2fb0db0c143894db4718e719448db3f587e /pkgs/development/interpreters
parent3940b219882f873314cd36c261cf807e94fa5f3b (diff)
downloadnixlib-745c4779305490816682bb95b319923d27c4a8fe.tar
nixlib-745c4779305490816682bb95b319923d27c4a8fe.tar.gz
nixlib-745c4779305490816682bb95b319923d27c4a8fe.tar.bz2
nixlib-745c4779305490816682bb95b319923d27c4a8fe.tar.lz
nixlib-745c4779305490816682bb95b319923d27c4a8fe.tar.xz
nixlib-745c4779305490816682bb95b319923d27c4a8fe.tar.zst
nixlib-745c4779305490816682bb95b319923d27c4a8fe.zip
lua5.2/cross: Fix build for Darwin.
The ld from cctools doesn't like the -soname argument, so let's strip it
off for now until we have a binutils <-> cctools bridge.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/lua-5/5.2.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix
index 70ab0c3bdf8b..c496d14083e7 100644
--- a/pkgs/development/interpreters/lua-5/5.2.nix
+++ b/pkgs/development/interpreters/lua-5/5.2.nix
@@ -49,6 +49,30 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
+  crossAttrs = let
+    isDarwin = stdenv.cross.libc == "libSystem";
+  in {
+    configurePhase = ''
+      makeFlagsArray=(
+        INSTALL_TOP=$out
+        INSTALL_MAN=$out/share/man/man1
+        CC=${stdenv.cross.config}-gcc
+        STRIP=:
+        RANLIB=${stdenv.cross.config}-ranlib
+        V=${majorVersion}
+        R=${version}
+        ${stdenv.lib.optionalString isDarwin ''
+        AR="${stdenv.cross.config}-ar rcu"
+        macosx
+        ''}
+      )
+    '';
+  } // stdenv.lib.optionalAttrs isDarwin {
+    postPatch = ''
+      sed -i -e 's/-Wl,-soname[^ ]* *//' src/Makefile
+    '';
+  };
+
   meta = {
     homepage = "http://www.lua.org";
     description = "Powerful, fast, lightweight, embeddable scripting language";