diff --git a/pkgs/development/libraries/gd/default.nix b/pkgs/development/libraries/gd/default.nix index f4386a22ffa1..cf0ed7883a06 100644 --- a/pkgs/development/libraries/gd/default.nix +++ b/pkgs/development/libraries/gd/default.nix @@ -8,6 +8,7 @@ , libXpm ? null , fontconfig , freetype +, fetchpatch, autoreconfHook, perl }: stdenv.mkDerivation rec { @@ -19,7 +20,17 @@ stdenv.mkDerivation rec { sha256 = "1311g5mva2xlzqv3rjqjc4jjkn5lzls4skvr395h633zw1n7b7s8"; }; - nativeBuildInputs = [ pkgconfig ]; + # Address an incompatibility with Darwin's libtool + patches = stdenv.lib.optional stdenv.isDarwin (fetchpatch { + url = https://github.com/libgd/libgd/commit/502e4cd873c3b37b307b9f450ef827d40916c3d6.patch; + sha256 = "0gawr2c4zr6cljnwzhdlxhz2mkbg0r5vzvr79dv6yf6fcj06awfs"; + }); + + # -pthread gets passed to clang, causing warnings + configureFlags = stdenv.lib.optional stdenv.isDarwin "--enable-werror=no"; + + nativeBuildInputs = [ pkgconfig ] + ++ stdenv.lib.optionals stdenv.isDarwin [ autoreconfHook perl ]; buildInputs = [ zlib fontconfig freetype ]; propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];