2016-05-09 13:56:41 +01:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, pkgconfig
|
|
|
|
, zlib
|
|
|
|
, libpng
|
2016-06-02 18:06:34 +01:00
|
|
|
, libjpeg ? null
|
|
|
|
, libwebp ? null
|
2016-05-09 13:56:41 +01:00
|
|
|
, libtiff ? null
|
|
|
|
, libXpm ? null
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
2016-07-18 20:00:23 +01:00
|
|
|
, fetchpatch, autoreconfHook, perl
|
2016-05-09 13:56:41 +01:00
|
|
|
}:
|
2007-09-21 21:43:43 +01:00
|
|
|
|
2016-05-09 13:56:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gd-${version}";
|
2016-07-09 16:17:38 +01:00
|
|
|
version = "2.2.2";
|
2016-05-13 16:12:07 +01:00
|
|
|
|
2007-09-21 21:43:43 +01:00
|
|
|
src = fetchurl {
|
2016-05-09 13:56:41 +01:00
|
|
|
url = "https://github.com/libgd/libgd/releases/download/${name}/libgd-${version}.tar.xz";
|
2016-07-09 16:17:38 +01:00
|
|
|
sha256 = "1311g5mva2xlzqv3rjqjc4jjkn5lzls4skvr395h633zw1n7b7s8";
|
2007-09-21 21:43:43 +01:00
|
|
|
};
|
|
|
|
|
2016-07-18 20:00:23 +01:00
|
|
|
# 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 ];
|
2016-06-02 18:06:34 +01:00
|
|
|
buildInputs = [ zlib fontconfig freetype ];
|
|
|
|
propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];
|
2007-09-21 21:43:43 +01:00
|
|
|
|
2016-05-22 13:03:16 +01:00
|
|
|
outputs = [ "dev" "out" "bin" ];
|
|
|
|
|
|
|
|
postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
|
|
|
|
|
2016-06-02 18:50:28 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-05-09 13:56:41 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://libgd.github.io/;
|
|
|
|
description = "A dynamic image creation library";
|
|
|
|
license = licenses.free; # some custom license
|
|
|
|
platforms = platforms.unix;
|
2007-09-21 21:43:43 +01:00
|
|
|
};
|
|
|
|
}
|