From 990431c1e3bcf38995fc32efa1831a7583485c8f Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 31 May 2021 18:28:16 -0700 Subject: [PATCH] imagemagick: Allow compilation without --with-gcc-arch The --with-gcc-arch flag is used to specify the value used for --march and --mtune [1], therefore it does not make sense to fail the evaluation simply because it's not enumerated by us. However, it's necessary to specify --without-gcc-arch, otherwise the config script will guess the values and lead to incompatible / non-determinstic artifacts. [1] https://github.com/ImageMagick/ImageMagick/blob/850d5a9fc5d8d6ae7534421737a1709efe164a77/m4/ax_gcc_archflag.m4 --- pkgs/applications/graphics/ImageMagick/6.x.nix | 4 ++-- pkgs/applications/graphics/ImageMagick/7.0.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/ImageMagick/6.x.nix b/pkgs/applications/graphics/ImageMagick/6.x.nix index 79fdacfaadb..e8a88249368 100644 --- a/pkgs/applications/graphics/ImageMagick/6.x.nix +++ b/pkgs/applications/graphics/ImageMagick/6.x.nix @@ -11,7 +11,7 @@ let else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l" else if stdenv.hostPlatform.system == "aarch64-linux" || stdenv.hostPlatform.system == "aarch64-darwin" then "aarch64" else if stdenv.hostPlatform.system == "powerpc64le-linux" then "ppc64le" - else throw "ImageMagick is not supported on this platform."; + else null; in stdenv.mkDerivation rec { @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-frozenpaths" ] - ++ [ "--with-gcc-arch=${arch}" ] + ++ (if arch != null then [ "--with-gcc-arch=${arch}" ] else [ "--without-gcc-arch" ]) ++ lib.optional (librsvg != null) "--with-rsvg" ++ lib.optionals (ghostscript != null) [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" diff --git a/pkgs/applications/graphics/ImageMagick/7.0.nix b/pkgs/applications/graphics/ImageMagick/7.0.nix index ed1e580cb16..27c3e31b28c 100644 --- a/pkgs/applications/graphics/ImageMagick/7.0.nix +++ b/pkgs/applications/graphics/ImageMagick/7.0.nix @@ -13,7 +13,7 @@ let else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l" else if stdenv.hostPlatform.system == "aarch64-linux" || stdenv.hostPlatform.system == "aarch64-darwin" then "aarch64" else if stdenv.hostPlatform.system == "powerpc64le-linux" then "ppc64le" - else throw "ImageMagick is not supported on this platform."; + else null; in stdenv.mkDerivation rec { @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-frozenpaths" ] - ++ [ "--with-gcc-arch=${arch}" ] + ++ (if arch != null then [ "--with-gcc-arch=${arch}" ] else [ "--without-gcc-arch" ]) ++ lib.optional (librsvg != null) "--with-rsvg" ++ lib.optionals (ghostscript != null) [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"