ImageMagick: Don't use stdenv.cross

I'm guessing the salient aspect here is not cross compiling itself, but
just whether the host platform is MinGW, so I simplified the logic
accordingly
This commit is contained in:
John Ericson 2017-06-26 18:38:34 -04:00
parent 099b83f90d
commit a11426c523
2 changed files with 9 additions and 7 deletions

View File

@ -2,6 +2,7 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp
, ApplicationServices , ApplicationServices
, buildPlatform, hostPlatform
}: }:
let let
@ -47,7 +48,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib" "--with-gslib"
] ]
++ lib.optionals (stdenv.cross.libc or null == "msvcrt") ++ lib.optionals hostPlatform.isMinGW
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
; ;
@ -57,13 +58,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript [ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libpng libtiff libxml2
] ]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt") ++ lib.optionals (!hostPlatform.isMinGW)
[ openexr librsvg openjpeg ] [ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices; ++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs = propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 ] [ bzip2 freetype libjpeg lcms2 ]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt") ++ lib.optionals (!hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ] [ libX11 libXext libXt libwebp ]
; ;

View File

@ -2,6 +2,7 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp
, ApplicationServices , ApplicationServices
, buildPlatform, hostPlatform
}: }:
let let
@ -18,7 +19,7 @@ let
} }
# Freeze version on mingw so we don't need to port the patch too often. # Freeze version on mingw so we don't need to port the patch too often.
# FIXME: This version has multiple security vulnerabilities # FIXME: This version has multiple security vulnerabilities
// lib.optionalAttrs (stdenv.cross.libc or null == "msvcrt") { // lib.optionalAttrs (hostPlatform.isMinGW) {
version = "6.9.2-0"; version = "6.9.2-0";
sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7"; sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7";
patches = [(fetchpatch { patches = [(fetchpatch {
@ -59,7 +60,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib" "--with-gslib"
] ]
++ lib.optionals (stdenv.cross.libc or null == "msvcrt") ++ lib.optionals (hostPlatform.isMinGW)
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
; ;
@ -69,13 +70,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript [ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libpng libtiff libxml2
] ]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt") ++ lib.optionals (!hostPlatform.isMinGW)
[ openexr librsvg openjpeg ] [ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices; ++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs = propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 ] [ bzip2 freetype libjpeg lcms2 ]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt") ++ lib.optionals (!hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ] [ libX11 libXext libXt libwebp ]
; ;