Merge pull request #7126 from spwhitt/imagemagick

Fixes for ImageMagick's dependencies on Darwin
This commit is contained in:
William A. Kennington III 2015-04-01 14:31:14 -07:00
commit 7c30e7aa04
4 changed files with 19 additions and 4 deletions

View File

@ -10,6 +10,9 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
'' + stdenv.lib.optionalString (stdenv.cc.cc.isClang or false) ''
substituteInPlace Makefile libjbig/Makefile pbmtools/Makefile \
--replace "CC = gcc" "CC = clang"
''; '';
installPhase = '' installPhase = ''

View File

@ -8,6 +8,14 @@ stdenv.mkDerivation rec {
sha256 = "0pbvxbp30zqjpc0q71qbl15cb47py74c4d6a8qv1mqa6j81pb233"; sha256 = "0pbvxbp30zqjpc0q71qbl15cb47py74c4d6a8qv1mqa6j81pb233";
}; };
# Darwin gets misdetected as Windows without this
NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-D__unix" else null;
# This dead code causes a duplicate symbol error in Clang so just remove it
postPatch = if (stdenv.cc.cc.isClang or false) then ''
substituteInPlace jpeg/ejpeg.h --replace "int No_JPEG_Header_Flag" ""
'' else null;
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://www.imagemagick.org; homepage = http://www.imagemagick.org;
description = "A library for manipulating FlashPIX images"; description = "A library for manipulating FlashPIX images";

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf { stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf
, bzip2, libcroco , bzip2, libcroco, libintlOrEmpty
, gtk3 ? null , gtk3 ? null
, gobjectIntrospection ? null, enableIntrospection ? false }: , gobjectIntrospection ? null, enableIntrospection ? false }:
@ -13,7 +13,9 @@ stdenv.mkDerivation rec {
sha256 = "0fplymmqqr28y24vcnb01szn62pfbqhk8p1ngns54x9m6mflr5hk"; sha256 = "0fplymmqqr28y24vcnb01szn62pfbqhk8p1ngns54x9m6mflr5hk";
}; };
buildInputs = [ libxml2 libgsf bzip2 libcroco pango ] NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
buildInputs = [ libxml2 libgsf bzip2 libcroco pango libintlOrEmpty ]
++ stdenv.lib.optional enableIntrospection [ gobjectIntrospection ]; ++ stdenv.lib.optional enableIntrospection [ gobjectIntrospection ];
propagatedBuildInputs = [ glib gdk_pixbuf cairo gtk3 ]; propagatedBuildInputs = [ glib gdk_pixbuf cairo gtk3 ];

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, fetchpatch, lib { stdenv, fetchurl, fetchpatch, lib
, autoconf, automake, gnum4, libtool, git, perl, gnulib, uthash, pkgconfig, gettext , autoconf, automake, gnum4, libtool, git, perl, gnulib, uthash, pkgconfig, gettext
, python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2 , python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2, pango
, withGTK ? false, gtk2 , withGTK ? false, gtk2
, withPython ? false # python-scripting was breaking inconsolata and libertine builds , withPython ? false # python-scripting was breaking inconsolata and libertine builds
}: }:
@ -30,7 +30,9 @@ stdenv.mkDerivation {
git autoconf automake gnum4 libtool perl pkgconfig gettext uthash git autoconf automake gnum4 libtool perl pkgconfig gettext uthash
python freetype zlib glib libungif libpng libjpeg libtiff libxml2 python freetype zlib glib libungif libpng libjpeg libtiff libxml2
] ]
++ lib.optionals withGTK [ gtk2 ]; ++ lib.optionals withGTK [ gtk2 ]
# I'm not sure why pango doesn't seem necessary on Linux
++ lib.optionals stdenv.isDarwin [ pango ];
configureFlags = configureFlags =
lib.optionals (!withPython) [ "--disable-python-scripting" "--disable-python-extension" ] lib.optionals (!withPython) [ "--disable-python-scripting" "--disable-python-extension" ]