uwimap: fix cross and remove unnecessary conditional
This commit is contained in:
parent
e8a861f940
commit
c16c3f82b2
|
@ -9,12 +9,14 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak";
|
sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak";
|
||||||
};
|
};
|
||||||
|
|
||||||
makeFlags = [ (if stdenv.isDarwin
|
makeFlags = [
|
||||||
|
"CC=${stdenv.cc.targetPrefix}cc"
|
||||||
|
"RANLIB=${stdenv.cc.targetPrefix}ranlib"
|
||||||
|
(if stdenv.isDarwin
|
||||||
then "osx"
|
then "osx"
|
||||||
else "lnp") ] # Linux with PAM modules;
|
else "lnp") # Linux with PAM modules;
|
||||||
# -fPIC is required to compile php with imap on x86_64 systems
|
] ++ lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC"; # -fPIC is required to compile php with imap on x86_64 systems
|
||||||
++ lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC"
|
|
||||||
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ];
|
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
|
@ -34,6 +36,10 @@ stdenv.mkDerivation rec {
|
||||||
sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${lib.getLib openssl}/lib,'
|
sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${lib.getLib openssl}/lib,'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
makeFlagsArray+=("ARRC=${stdenv.cc.targetPrefix}ar rc")
|
||||||
|
'';
|
||||||
|
|
||||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
|
||||||
"-I${openssl.dev}/include/openssl";
|
"-I${openssl.dev}/include/openssl";
|
||||||
|
|
||||||
|
@ -55,11 +61,4 @@ stdenv.mkDerivation rec {
|
||||||
passthru = {
|
passthru = {
|
||||||
withSSL = true;
|
withSSL = true;
|
||||||
};
|
};
|
||||||
} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
|
||||||
# This is set here to prevent rebuilds on native compilation.
|
|
||||||
# Configure phase is a no-op there, because this package doesn't use ./configure scripts.
|
|
||||||
configurePhase = ''
|
|
||||||
echo "Cross-compilation, injecting make flags"
|
|
||||||
makeFlagsArray+=("ARRC=${stdenv.hostPlatform.config}-ar rc")
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue