diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-05-05 08:30:19 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-05-05 08:30:19 +0200 |
commit | 1dc36904d8cefa8188c785efd03274637c838e31 (patch) | |
tree | 0cf37f0803f1e9c6985d09f2870e5ec61229d2ca /pkgs/applications/graphics/ImageMagick/default.nix | |
parent | 75f1cc61b86b002f551529f1cafa30b4f4010bd9 (diff) | |
parent | 7a005601d48f760864258e369364b3b847d4e9fd (diff) | |
download | nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar.gz nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar.bz2 nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar.lz nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar.xz nixlib-1dc36904d8cefa8188c785efd03274637c838e31.tar.zst nixlib-1dc36904d8cefa8188c785efd03274637c838e31.zip |
Merge #14920: windows improvements, mainly mingw
Diffstat (limited to 'pkgs/applications/graphics/ImageMagick/default.nix')
-rw-r--r-- | pkgs/applications/graphics/ImageMagick/default.nix | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index 78837f55af4c..8094252c660d 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkgconfig, libtool +{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libtool , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp }: @@ -9,11 +9,28 @@ let else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64" else if stdenv.system == "armv7l-linux" then "armv7l" else throw "ImageMagick is not supported on this platform."; + + cfg = { + version = "6.9.3-9"; + sha256 = "0q19jgn1iv7zqrw8ibxp4z57iihrc9kyb09k2wnspcacs6vrvinf"; + patches = []; + } + # Freeze version on mingw so we don't need to port the patch too often. + // lib.optionalAttrs (stdenv.cross.libc or null == "msvcrt") { + version = "6.9.2-0"; + sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7"; + patches = (fetchpatch { + name = "mingw-build.patch"; + url = "https://raw.githubusercontent.com/Alexpux/MINGW-packages/" + + "01ca03b2a4ef/mingw-w64-imagemagick/002-build-fixes.patch"; + sha256 = "1pypszlcx2sf7wfi4p37w1y58ck2r8cd5b2wrrwr9rh87p7fy1c0"; + }); + }; in stdenv.mkDerivation rec { name = "imagemagick-${version}"; - version = "6.9.3-8"; + inherit (cfg) version; src = fetchurl { urls = [ @@ -21,9 +38,11 @@ stdenv.mkDerivation rec { # the original source above removes tarballs quickly "http://distfiles.macports.org/ImageMagick/ImageMagick-${version}.tar.xz" ]; - sha256 = "129s4cwp6cbhgsr3xr8186q5j02zpbk6kqfk4j7ayb563zsrdb4h"; + inherit (cfg) sha256; }; + patches = [ ./imagetragick.patch ] ++ cfg.patches; + outputs = [ "out" "doc" ]; enableParallelBuilding = true; @@ -35,15 +54,26 @@ stdenv.mkDerivation rec { ++ lib.optionals (ghostscript != null) [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" "--with-gslib" - ]; + ] + ++ lib.optionals (stdenv.cross.libc or null == "msvcrt") + [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM + ; + + nativeBuildInputs = [ pkgconfig libtool ]; buildInputs = - [ pkgconfig libtool zlib fontconfig freetype ghostscript libjpeg - openexr libpng librsvg libtiff libxml2 openjpeg libwebp - ]; + [ zlib fontconfig freetype ghostscript + libpng libtiff libxml2 + ] + ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + [ openexr librsvg openjpeg ] + ; propagatedBuildInputs = - [ bzip2 freetype libjpeg libX11 libXext libXt lcms2 ]; + [ bzip2 freetype libjpeg lcms2 ] + ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") + [ libX11 libXext libXt libwebp ] + ; postInstall = '' |