about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/giflib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/giflib/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/giflib/default.nix b/nixpkgs/pkgs/development/libraries/giflib/default.nix
new file mode 100644
index 000000000000..9eaf7b933d43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giflib/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  name = "giflib-5.2.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/giflib/${name}.tar.gz";
+    sha256 = "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii";
+  };
+
+  patches = lib.optional stdenv.hostPlatform.isDarwin
+    (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 = "./";
+    });
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}'
+  '';
+
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+
+  buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
+
+  meta = {
+    description = "A library for reading and writing gif images";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    branch = "5.2";
+  };
+}