2021-11-22 12:17:49 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2021-12-15 10:17:28 +00:00
|
|
|
, fetchpatch
|
2020-07-03 03:10:03 +00:00
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, pkg-config
|
2016-05-09 12:56:41 +00:00
|
|
|
, zlib
|
|
|
|
, libpng
|
2022-02-09 13:29:25 +00:00
|
|
|
, libjpeg
|
|
|
|
, libwebp
|
|
|
|
, libtiff
|
|
|
|
, libXpm
|
|
|
|
, libavif
|
2016-05-09 12:56:41 +00:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
}:
|
2007-09-21 20:43:43 +00:00
|
|
|
|
2016-05-09 12:56:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gd";
|
2021-11-22 12:17:49 +00:00
|
|
|
version = "2.3.3";
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2007-09-21 20:43:43 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://github.com/libgd/libgd/releases/download/${pname}-${version}/libgd-${version}.tar.xz";
|
2021-11-22 12:17:49 +00:00
|
|
|
sha256 = "0qas3q9xz3wgw06dm2fj0i189rain6n60z1vyq50d5h7wbn25s1z";
|
2007-09-21 20:43:43 +00:00
|
|
|
};
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2021-12-15 10:17:28 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch { # included in > 2.3.3
|
|
|
|
name = "restore-GD_FLIP.patch";
|
|
|
|
url = "https://github.com/libgd/libgd/commit/f4bc1f5c26925548662946ed7cfa473c190a104a.diff";
|
|
|
|
sha256 = "XRXR3NOkbEub3Nybaco2duQk0n8vxif5mTl2AUacn9w=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2021-12-23 05:14:26 +00:00
|
|
|
configureFlags =
|
|
|
|
[
|
|
|
|
"--enable-gd-formats"
|
|
|
|
]
|
|
|
|
# -pthread gets passed to clang, causing warnings
|
|
|
|
++ lib.optional stdenv.isDarwin "--enable-werror=no";
|
2016-07-18 19:00:23 +00:00
|
|
|
|
2020-07-03 03:10:03 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake pkg-config ];
|
2016-07-21 00:56:43 +00:00
|
|
|
|
2022-02-09 13:29:25 +00:00
|
|
|
buildInputs = [ zlib fontconfig freetype libpng libjpeg libwebp libtiff libXpm libavif ];
|
2007-09-21 20:43:43 +00:00
|
|
|
|
2016-08-29 00:30:01 +00:00
|
|
|
outputs = [ "bin" "dev" "out" ];
|
2016-05-22 12:03:16 +00:00
|
|
|
|
|
|
|
postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
|
2007-09-21 20:43:43 +00:00
|
|
|
|
2016-06-02 17:50:28 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-08-08 18:34:25 +00:00
|
|
|
doCheck = false; # fails 2 tests
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-03-24 06:48:50 +00:00
|
|
|
homepage = "https://libgd.github.io/";
|
2016-05-09 12:56:41 +00:00
|
|
|
description = "A dynamic image creation library";
|
|
|
|
license = licenses.free; # some custom license
|
|
|
|
platforms = platforms.unix;
|
2007-09-21 20:43:43 +00:00
|
|
|
};
|
|
|
|
}
|