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