about summary refs log tree commit diff
path: root/pkgs/applications/graphics/ImageMagick
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-10-30 13:34:26 +0100
committerDomen Kožar <domen@dev.si>2014-11-06 11:10:32 +0100
commit6f538863607474fd09895723abae62198264bb5c (patch)
treefe96c694e35e5e5da9afe5b8d3a1fda07d10a026 /pkgs/applications/graphics/ImageMagick
parent782a12e450a58b815cd702c65da75855124d1572 (diff)
downloadnixlib-6f538863607474fd09895723abae62198264bb5c.tar
nixlib-6f538863607474fd09895723abae62198264bb5c.tar.gz
nixlib-6f538863607474fd09895723abae62198264bb5c.tar.bz2
nixlib-6f538863607474fd09895723abae62198264bb5c.tar.lz
nixlib-6f538863607474fd09895723abae62198264bb5c.tar.xz
nixlib-6f538863607474fd09895723abae62198264bb5c.tar.zst
nixlib-6f538863607474fd09895723abae62198264bb5c.zip
imagemagick: Use --with-gcc-arch
Without this, ImageMagick's configure script will generate code
specific to the machine building the package. This code may then fail
on other CPU types.

http://hydra.nixos.org/build/16564129
Signed-off-by: Domen Kožar <domen@dev.si>
Diffstat (limited to 'pkgs/applications/graphics/ImageMagick')
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix28
1 files changed, 19 insertions, 9 deletions
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index e75ce535f7f2..da2ca64d9758 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetchurl
 , pkgconfig
 , bzip2
@@ -18,8 +19,16 @@
 }:
 
 let
+
   version = "6.8.9-8";
+
+  arch =
+    if stdenv.system == "i686-linux" then "i686"
+    else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
+    else throw "ImageMagick is not supported on this platform.";
+
 in
+
 stdenv.mkDerivation rec {
   name = "ImageMagick-${version}";
 
@@ -35,18 +44,19 @@ stdenv.mkDerivation rec {
       export DVIDecodeDelegate=${tetex}/bin/dvips
     '' else "";
 
-  configureFlags = "" + stdenv.lib.optionalString (stdenv.system != "x86_64-darwin") ''
-    --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
-    --with-gslib
-  '' + ''
-    --with-frozenpaths
-    ${if librsvg != null then "--with-rsvg" else ""}
-  '';
+  configureFlags =
+    [ "--with-frozenpaths" ]
+    ++ [ "--with-gcc-arch=${arch}" ]
+    ++ lib.optional (librsvg != null) "--with-rsvg"
+    ++ lib.optionals (stdenv.system != "x86_64-darwin")
+      [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
+        "--with-gslib"
+      ];
 
   propagatedBuildInputs =
     [ bzip2 fontconfig freetype libjpeg libpng libtiff libxml2 zlib librsvg
       libtool jasper libX11
-    ] ++ stdenv.lib.optional (stdenv.system != "x86_64-darwin") ghostscript;
+    ] ++ lib.optional (stdenv.system != "x86_64-darwin") ghostscript;
 
   buildInputs = [ tetex pkgconfig ];