2020-07-02 20:10:03 -07:00
|
|
|
{ stdenv, fetchurl, fetchpatch
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, pkg-config
|
2016-05-09 05:56:41 -07:00
|
|
|
, zlib
|
|
|
|
, libpng
|
2016-06-02 10:06:34 -07:00
|
|
|
, libjpeg ? null
|
|
|
|
, libwebp ? null
|
2016-05-09 05:56:41 -07:00
|
|
|
, libtiff ? null
|
|
|
|
, libXpm ? null
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
}:
|
2007-09-21 13:43:43 -07:00
|
|
|
|
2016-05-09 05:56:41 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "gd";
|
2020-03-23 23:48:50 -07:00
|
|
|
version = "2.3.0";
|
2015-12-22 17:59:47 -08:00
|
|
|
|
2007-09-21 13:43:43 -07:00
|
|
|
src = fetchurl {
|
2019-08-15 05:41:18 -07:00
|
|
|
url = "https://github.com/libgd/libgd/releases/download/${pname}-${version}/libgd-${version}.tar.xz";
|
2020-03-23 23:48:50 -07:00
|
|
|
sha256 = "0n5czhxzinvjvmhkf5l9fwjdx5ip69k5k7pj6zwb6zs1k9dibngc";
|
2007-09-21 13:43:43 -07:00
|
|
|
};
|
2015-12-22 17:59:47 -08:00
|
|
|
|
2016-02-26 09:38:15 -08:00
|
|
|
hardeningDisable = [ "format" ];
|
2020-07-02 20:10:03 -07:00
|
|
|
patches = [
|
|
|
|
# Fixes an issue where some other packages would fail to build
|
|
|
|
# their documentation with an error like:
|
|
|
|
# "Error: Problem doing text layout"
|
|
|
|
#
|
|
|
|
# Can be removed if Wayland can still be built successfully with
|
|
|
|
# documentation.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libgd/libgd/commit/3dd0e308cbd2c24fde2fc9e9b707181252a2de95.patch";
|
|
|
|
excludes = [ "tests/gdimagestringft/.gitignore" ];
|
|
|
|
sha256 = "12iqlanl9czig9d7c3rvizrigw2iacimnmimfcny392dv9iazhl1";
|
|
|
|
})
|
|
|
|
];
|
2015-12-22 17:59:47 -08:00
|
|
|
|
2016-07-18 12:00:23 -07:00
|
|
|
# -pthread gets passed to clang, causing warnings
|
|
|
|
configureFlags = stdenv.lib.optional stdenv.isDarwin "--enable-werror=no";
|
|
|
|
|
2020-07-02 20:10:03 -07:00
|
|
|
nativeBuildInputs = [ autoconf automake pkg-config ];
|
2016-07-20 17:56:43 -07:00
|
|
|
|
2016-06-02 10:06:34 -07:00
|
|
|
buildInputs = [ zlib fontconfig freetype ];
|
|
|
|
propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];
|
2007-09-21 13:43:43 -07:00
|
|
|
|
2016-08-28 17:30:01 -07:00
|
|
|
outputs = [ "bin" "dev" "out" ];
|
2016-05-22 05:03:16 -07:00
|
|
|
|
|
|
|
postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
|
2007-09-21 13:43:43 -07:00
|
|
|
|
2016-06-02 10:50:28 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-08-08 11:34:25 -07:00
|
|
|
doCheck = false; # fails 2 tests
|
|
|
|
|
2016-05-09 05:56:41 -07:00
|
|
|
meta = with stdenv.lib; {
|
2020-03-23 23:48:50 -07:00
|
|
|
homepage = "https://libgd.github.io/";
|
2016-05-09 05:56:41 -07:00
|
|
|
description = "A dynamic image creation library";
|
|
|
|
license = licenses.free; # some custom license
|
|
|
|
platforms = platforms.unix;
|
2007-09-21 13:43:43 -07:00
|
|
|
};
|
|
|
|
}
|