Merge pull request #67202 from kisik21/uwimap-cross-compile-fix

uwimap: Fixed cross-compilation
This commit is contained in:
Marek Mahut 2019-08-25 14:27:24 +02:00 committed by GitHub
commit d212d864e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, fetchpatch, pam, openssl }:
stdenv.mkDerivation {
stdenv.mkDerivation ({
name = "uw-imap-2007f";
src = fetchurl {
@ -12,7 +12,8 @@ stdenv.mkDerivation {
then "osx"
else "lnp" # Linux with PAM modules;
# -fPIC is required to compile php with imap on x86_64 systems
+ stdenv.lib.optionalString stdenv.isx86_64 " EXTRACFLAGS=-fPIC";
+ stdenv.lib.optionalString stdenv.isx86_64 " EXTRACFLAGS=-fPIC"
+ stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " CC=${stdenv.hostPlatform.config}-gcc RANLIB=${stdenv.hostPlatform.config}-ranlib";
hardeningDisable = [ "format" ];
@ -51,4 +52,11 @@ stdenv.mkDerivation {
passthru = {
withSSL = true;
};
}
} // stdenv.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")
'';
})