2021-11-11 14:00:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames, pkgsStatic }:
|
2006-08-13 09:46:54 +00:00
|
|
|
|
2019-09-22 07:38:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-11-09 22:12:55 +00:00
|
|
|
pname = "giflib";
|
|
|
|
version = "5.2.1";
|
2006-08-13 09:46:54 +00:00
|
|
|
src = fetchurl {
|
2021-11-09 22:12:55 +00:00
|
|
|
url = "mirror://sourceforge/giflib/giflib-${version}.tar.gz";
|
2019-09-22 07:38:09 +00:00
|
|
|
sha256 = "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii";
|
2006-08-13 09:46:54 +00:00
|
|
|
};
|
2013-12-04 14:56:05 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
patches = lib.optional stdenv.hostPlatform.isDarwin
|
2019-09-27 17:44:32 +00:00
|
|
|
(fetchpatch {
|
|
|
|
# https://sourceforge.net/p/giflib/bugs/133/
|
|
|
|
name = "darwin-soname.patch";
|
|
|
|
url = "https://sourceforge.net/p/giflib/bugs/_discuss/thread/4e811ad29b/c323/attachment/Makefile.patch";
|
|
|
|
sha256 = "12afkqnlkl3n1hywwgx8sqnhp3bz0c5qrwcv8j9hifw1lmfhv67r";
|
|
|
|
extraPrefix = "./";
|
|
|
|
});
|
|
|
|
|
2019-09-22 07:38:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}'
|
2021-11-11 14:00:19 +00:00
|
|
|
''
|
|
|
|
# Upstream build system does not support NOT building shared libraries.
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isStatic ''
|
|
|
|
sed -i '/all:/ s/libgif.so//' Makefile
|
|
|
|
sed -i '/all:/ s/libutil.so//' Makefile
|
|
|
|
sed -i '/-m 755 libgif.so/ d' Makefile
|
|
|
|
sed -i '/ln -sf libgif.so/ d' Makefile
|
2019-09-22 07:38:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
|
2019-11-29 09:20:00 +00:00
|
|
|
|
2013-12-04 14:56:05 +00:00
|
|
|
buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
|
2019-09-22 07:38:09 +00:00
|
|
|
|
2021-11-11 14:00:19 +00:00
|
|
|
passthru.tests.static = pkgsStatic.giflib;
|
|
|
|
|
2014-09-30 09:41:06 +00:00
|
|
|
meta = {
|
2015-04-30 15:05:14 +00:00
|
|
|
description = "A library for reading and writing gif images";
|
2021-01-21 17:00:13 +00:00
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ ];
|
2019-09-22 07:38:09 +00:00
|
|
|
branch = "5.2";
|
2014-09-30 09:41:06 +00:00
|
|
|
};
|
2006-08-13 09:46:54 +00:00
|
|
|
}
|