imagemagick: fix on mingw, only static ATM
The output gets rather large (67 MB) as *each* executable gets ~5 MB of magick stuff statically. It seems we would have to fix or disable libxml2 first to get around this blowup.
This commit is contained in:
parent
960244c0af
commit
7aae991fa2
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl, pkgconfig, libtool
|
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libtool
|
||||||
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
|
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
|
||||||
, lcms2, openexr, libpng, librsvg, libtiff, libxml2
|
, lcms2, openexr, libpng, librsvg, libtiff, libxml2
|
||||||
}:
|
}:
|
||||||
@ -9,11 +9,28 @@ let
|
|||||||
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
|
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
|
||||||
else if stdenv.system == "armv7l-linux" then "armv7l"
|
else if stdenv.system == "armv7l-linux" then "armv7l"
|
||||||
else throw "ImageMagick is not supported on this platform.";
|
else throw "ImageMagick is not supported on this platform.";
|
||||||
|
|
||||||
|
cfg = {
|
||||||
|
version = "6.9.3-8";
|
||||||
|
sha256 = "129s4cwp6cbhgsr3xr8186q5j02zpbk6kqfk4j7ayb563zsrdb4h";
|
||||||
|
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
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "imagemagick-${version}";
|
name = "imagemagick-${version}";
|
||||||
version = "6.9.3-8";
|
inherit (cfg) version;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
urls = [
|
urls = [
|
||||||
@ -21,8 +38,9 @@ stdenv.mkDerivation rec {
|
|||||||
# the original source above removes tarballs quickly
|
# the original source above removes tarballs quickly
|
||||||
"http://distfiles.macports.org/ImageMagick/ImageMagick-${version}.tar.xz"
|
"http://distfiles.macports.org/ImageMagick/ImageMagick-${version}.tar.xz"
|
||||||
];
|
];
|
||||||
sha256 = "129s4cwp6cbhgsr3xr8186q5j02zpbk6kqfk4j7ayb563zsrdb4h";
|
inherit (cfg) sha256;
|
||||||
};
|
};
|
||||||
|
inherit (cfg) patches;
|
||||||
|
|
||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
@ -35,15 +53,26 @@ stdenv.mkDerivation rec {
|
|||||||
++ lib.optionals (ghostscript != null)
|
++ lib.optionals (ghostscript != null)
|
||||||
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
|
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
|
||||||
"--with-gslib"
|
"--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 =
|
buildInputs =
|
||||||
[ pkgconfig libtool zlib fontconfig freetype ghostscript libjpeg
|
[ zlib fontconfig freetype ghostscript
|
||||||
openexr libpng librsvg libtiff libxml2
|
libpng libtiff libxml2
|
||||||
];
|
]
|
||||||
|
++ lib.optionals (stdenv.cross.libc or null != "msvcrt")
|
||||||
|
[ openexr librsvg ]
|
||||||
|
;
|
||||||
|
|
||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
[ bzip2 freetype libjpeg libX11 libXext libXt lcms2 ];
|
[ bzip2 freetype libjpeg lcms2 ]
|
||||||
|
++ lib.optionals (stdenv.cross.libc or null != "msvcrt")
|
||||||
|
[ libX11 libXext libXt ]
|
||||||
|
;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
(cd "$out/include" && ln -s ImageMagick* ImageMagick)
|
(cd "$out/include" && ln -s ImageMagick* ImageMagick)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user