Skip to content

Instantly share code, notes, and snippets.

@acowley
Created July 15, 2016 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acowley/76c4c5596184d71187f571fa2771deb7 to your computer and use it in GitHub Desktop.
Save acowley/76c4c5596184d71187f571fa2771deb7 to your computer and use it in GitHub Desktop.
A bump of libgd to 2.2.2 and a cherry-picked patch to fix on Darwin
{ stdenv, fetchurl, fetchpatch, autoreconfHook, perl
, pkgconfig
, zlib
, libpng
, libjpeg ? null
, libwebp ? null
, libtiff ? null
, libXpm ? null
, fontconfig
, freetype
}:
stdenv.mkDerivation rec {
name = "gd-${version}";
version = "2.2.2";
src = fetchurl {
url = "https://github.com/libgd/libgd/releases/download/${name}/libgd-${version}.tar.xz";
sha256 = "1311g5mva2xlzqv3rjqjc4jjkn5lzls4skvr395h633zw1n7b7s8";
};
# Address an incompatibility with Darwin's libtool
patches = stdenv.lib.optional stdenv.isDarwin (fetchpatch {
url = https://github.com/libgd/libgd/commit/502e4cd873c3b37b307b9f450ef827d40916c3d6.patch;
sha256 = "1nln93l1fjwsql419jkfbb66p29lm9d3f0vmcj968r7rnxcwvzil";
});
# -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 ];
buildInputs = [ zlib fontconfig freetype ];
propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];
outputs = [ "dev" "out" "bin" ];
postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = https://libgd.github.io/;
description = "A dynamic image creation library";
license = licenses.free; # some custom license
platforms = platforms.unix;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment