diff options
author | Vika <kisik21@fireburn.ru> | 2019-08-19 10:37:24 +0300 |
---|---|---|
committer | Vika <kisik21@fireburn.ru> | 2019-08-19 12:04:26 +0300 |
commit | 68847aeef420cf6a65f2697c1d3b961143d84cb2 (patch) | |
tree | 632cfa306388d0a9e00f6dd533542dff3804cd62 /pkgs/development/interpreters/lua-5 | |
parent | 1316d812e1ea1ef626c525611121c3d160f7df3a (diff) |
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.
Diffstat (limited to 'pkgs/development/interpreters/lua-5')
-rw-r--r-- | pkgs/development/interpreters/lua-5/interpreter.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 26db917c9002..fb0021cb709a 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/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}"}" ) |