From 745c4779305490816682bb95b319923d27c4a8fe Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 10 Mar 2014 22:17:04 +0100 Subject: [PATCH] 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 --- pkgs/development/interpreters/lua-5/5.2.nix | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) 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";