From a11426c52376d0d6b82d24519a333a3c1f7dec71 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 26 Jun 2017 18:38:34 -0400 Subject: [PATCH] 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 --- pkgs/applications/graphics/ImageMagick/7.0.nix | 7 ++++--- pkgs/applications/graphics/ImageMagick/default.nix | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/graphics/ImageMagick/7.0.nix b/pkgs/applications/graphics/ImageMagick/7.0.nix index bcad077b38c..5eaf488fff5 100644 --- a/pkgs/applications/graphics/ImageMagick/7.0.nix +++ b/pkgs/applications/graphics/ImageMagick/7.0.nix @@ -2,6 +2,7 @@ , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp , ApplicationServices +, buildPlatform, hostPlatform }: let @@ -47,7 +48,7 @@ stdenv.mkDerivation rec { [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" "--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 ; @@ -57,13 +58,13 @@ stdenv.mkDerivation rec { [ zlib fontconfig freetype ghostscript libpng libtiff libxml2 ] - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + ++ lib.optionals (!hostPlatform.isMinGW) [ openexr librsvg openjpeg ] ++ lib.optional stdenv.isDarwin ApplicationServices; propagatedBuildInputs = [ bzip2 freetype libjpeg lcms2 ] - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + ++ lib.optionals (!hostPlatform.isMinGW) [ libX11 libXext libXt libwebp ] ; diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index 8f4d44932f5..39812b2cfc4 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -2,6 +2,7 @@ , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp , ApplicationServices +, buildPlatform, hostPlatform }: let @@ -18,7 +19,7 @@ let } # Freeze version on mingw so we don't need to port the patch too often. # FIXME: This version has multiple security vulnerabilities - // lib.optionalAttrs (stdenv.cross.libc or null == "msvcrt") { + // lib.optionalAttrs (hostPlatform.isMinGW) { version = "6.9.2-0"; sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7"; patches = [(fetchpatch { @@ -59,7 +60,7 @@ stdenv.mkDerivation rec { [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" "--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 ; @@ -69,13 +70,13 @@ stdenv.mkDerivation rec { [ zlib fontconfig freetype ghostscript libpng libtiff libxml2 ] - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + ++ lib.optionals (!hostPlatform.isMinGW) [ openexr librsvg openjpeg ] ++ lib.optional stdenv.isDarwin ApplicationServices; propagatedBuildInputs = [ bzip2 freetype libjpeg lcms2 ] - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + ++ lib.optionals (!hostPlatform.isMinGW) [ libX11 libXext libXt libwebp ] ;