20 stdenv.mkDerivation rec {
25 url = "https://github.com/libgd/libgd/releases/download/${pname}-${version}/libgd-${version}.tar.xz";
26 sha256 = "0qas3q9xz3wgw06dm2fj0i189rain6n60z1vyq50d5h7wbn25s1z";
30 (fetchpatch { # included in > 2.3.3
31 name = "restore-GD_FLIP.patch";
32 url = "https://github.com/libgd/libgd/commit/f4bc1f5c26925548662946ed7cfa473c190a104a.diff";
33 sha256 = "XRXR3NOkbEub3Nybaco2duQk0n8vxif5mTl2AUacn9w=";
37 hardeningDisable = [ "format" ];
42 # -pthread gets passed to clang, causing warnings
43 ++ lib.optional stdenv.hostPlatform.isDarwin "--enable-werror=no";
45 nativeBuildInputs = [ autoconf automake pkg-config ];
47 buildInputs = [ zlib freetype libpng libjpeg libwebp libtiff libavif ]
48 ++ lib.optionals withXorg [ fontconfig libXpm ];
50 outputs = [ "bin" "dev" "out" ];
53 moveToOutput "bin/gdlib-config" $dev
56 enableParallelBuilding = true;
58 doCheck = false; # fails 2 tests
61 homepage = "https://libgd.github.io/";
62 description = "Dynamic image creation library";
63 license = licenses.free; # some custom license
64 platforms = platforms.unix;