about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/lua-5
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-31 11:57:05 +0000
committerAlyssa Ross <hi@alyssa.is>2019-09-16 22:04:28 +0000
commita0842e8b20cbe1ed717b72775428d1f8fc047fa4 (patch)
treeb86d0614a477f7e092d626d59b888d085aaca400 /nixpkgs/pkgs/development/interpreters/lua-5
parentc36b32d476b520ed0d2a37cd0973f98583d6dc7c (diff)
parent8d1510abfb592339e13ce8f6db6f29c1f8b72924 (diff)
downloadnixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.gz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.bz2
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.lz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.xz
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.tar.zst
nixlib-a0842e8b20cbe1ed717b72775428d1f8fc047fa4.zip
Merge commit '8d1510abfb592339e13ce8f6db6f29c1f8b72924'
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/lua-5')
-rw-r--r--nixpkgs/pkgs/development/interpreters/lua-5/interpreter.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/lua-5/interpreter.nix b/nixpkgs/pkgs/development/interpreters/lua-5/interpreter.nix
index 26db917c9002..fb0021cb709a 100644
--- a/nixpkgs/pkgs/development/interpreters/lua-5/interpreter.nix
+++ b/nixpkgs/pkgs/development/interpreters/lua-5/interpreter.nix
@@ -40,14 +40,17 @@ self = stdenv.mkDerivation rec {
     "PLAT=macosx"
   ] else [
     "PLAT=linux"
-  ])
+  ]) ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [
+    "CC=${stdenv.hostPlatform.config}-gcc"
+    "RANLIB=${stdenv.hostPlatform.config}-ranlib"
+  ] else [])
   ;
 
   configurePhase = ''
     runHook preConfigure
 
     makeFlagsArray+=(CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" )
-    makeFlagsArray+=(${stdenv.lib.optionalString stdenv.isDarwin "CC=\"$CC\""})
+    makeFlagsArray+=(${stdenv.lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
 
     installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \
       TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" )