diff --git a/pkgs/applications/graphics/ImageMagick/7.0.nix b/pkgs/applications/graphics/ImageMagick/7.0.nix index bcad077b38c9..5eaf488fff53 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 8f4d44932f59..39812b2cfc47 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 ] ;