git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #66883 from kisik21/lua-cross-compile-fix

lua: fix cross-compilation; fixes #66742

commitd38d6aba1f1ff5508f11a6fb1dfcb094308cbad4 authorMichael Raskin <7c6f434c@mail.ru> dateTue 20 Aug 2019, 08:13 (7 years ago) parent0cbeac468847ae
1 file changed+5−2
pkgs/development/interpreters/lua-5/interpreter.nix+5−2
pkgs/development/interpreters/lua-5/interpreter.nix+5−2
@@ -40,14 +40,17 @@ self = stdenv.mkDerivation rec {
4040 "PLAT=macosx"
4141 ] else [
4242 "PLAT=linux"
43− ])
43+ ]) ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [
44+ "CC=${stdenv.hostPlatform.config}-gcc"
45+ "RANLIB=${stdenv.hostPlatform.config}-ranlib"
46+ ] else [])
4447 ;
4548
4649 configurePhase = ''
4750 runHook preConfigure
4851
4952 makeFlagsArray+=(CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" )
50− makeFlagsArray+=(${stdenv.lib.optionalString stdenv.isDarwin "CC=\"$CC\""})
53+ makeFlagsArray+=(${stdenv.lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
5154
5255 installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \
5356 TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" )