git.iko.soy/typeable/nixpkgs
on master help sign in
lua: fix cross-compilation; fixes #66742

The makefile isn't able to find the toolchain when cross-compiling. I helped it a little bit by adding the parameters explicitly.

commit68847aeef420cf6a65f2697c1d3b961143d84cb2 authorVika <kisik21@fireburn.ru> dateMon 19 Aug 2019, 10:37 (7 years ago) parent1316d81
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}"}" )