mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 23:20:55 +00:00
lua: use stdenv.cc.targetPrefix
This evaluates to an empty string when not cross compiling, so by using this instead of stdenv.hostPlatform.config we can eliminate a conditional.
This commit is contained in:
parent
8abdf1db65
commit
25d4f0d334
|
@ -54,17 +54,15 @@ self = stdenv.mkDerivation rec {
|
|||
"LDFLAGS=-fPIC"
|
||||
"V=${luaversion}"
|
||||
"PLAT=${plat}"
|
||||
] ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [
|
||||
"CC=${stdenv.hostPlatform.config}-gcc"
|
||||
"RANLIB=${stdenv.hostPlatform.config}-ranlib"
|
||||
] else [])
|
||||
;
|
||||
"CC=${stdenv.cc.targetPrefix}cc"
|
||||
"RANLIB=${stdenv.cc.targetPrefix}ranlib"
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' )
|
||||
makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
|
||||
makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}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}"}" )
|
||||
|
|
Loading…
Reference in a new issue