2021-12-26 17:43:05 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
|
|
|
, fetchpatch
|
2020-08-20 17:08:02 +00:00
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib
|
|
|
|
, libpng
|
|
|
|
, libjpeg ? null
|
|
|
|
, libwebp ? null
|
|
|
|
, libtiff ? null
|
|
|
|
, libXpm ? null
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gd";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "2.3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/libgd/libgd/releases/download/${pname}-${version}/libgd-${version}.tar.xz";
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "0qas3q9xz3wgw06dm2fj0i189rain6n60z1vyq50d5h7wbn25s1z";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
patches = [
|
2021-12-26 17:43:05 +00:00
|
|
|
(fetchpatch { # included in > 2.3.3
|
|
|
|
name = "restore-GD_FLIP.patch";
|
|
|
|
url = "https://github.com/libgd/libgd/commit/f4bc1f5c26925548662946ed7cfa473c190a104a.diff";
|
|
|
|
sha256 = "XRXR3NOkbEub3Nybaco2duQk0n8vxif5mTl2AUacn9w=";
|
2020-08-20 17:08:02 +00:00
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[
|
|
|
|
"--enable-gd-formats"
|
|
|
|
]
|
|
|
|
# -pthread gets passed to clang, causing warnings
|
|
|
|
++ lib.optional stdenv.isDarwin "--enable-werror=no";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ zlib fontconfig freetype ];
|
|
|
|
propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" ];
|
|
|
|
|
|
|
|
postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = false; # fails 2 tests
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://libgd.github.io/";
|
|
|
|
description = "A dynamic image creation library";
|
|
|
|
license = licenses.free; # some custom license
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|