about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/giflib
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-08-23 10:09:14 +0000
committerAlyssa Ross <hi@alyssa.is>2023-08-26 09:07:03 +0000
commit63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f (patch)
treed58934cb48f9c953b19a0d0d5cffc0d0c5561471 /nixpkgs/pkgs/development/libraries/giflib
parentc4eef3dacb2a3d359561f30917d9e3cc4e041be9 (diff)
parent91a22f76cd1716f9d0149e8a5c68424bb691de15 (diff)
downloadnixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar.gz
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar.bz2
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar.lz
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar.xz
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.tar.zst
nixlib-63dabcc77ef9a56655e1ca2ab2e25e6163a72c1f.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/giflib')
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/mingw-install-exes.patch11
2 files changed, 47 insertions, 14 deletions
diff --git a/nixpkgs/pkgs/development/libraries/giflib/default.nix b/nixpkgs/pkgs/development/libraries/giflib/default.nix
index 5202dc0edabc..8c8a587ed548 100644
--- a/nixpkgs/pkgs/development/libraries/giflib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/giflib/default.nix
@@ -1,8 +1,15 @@
-{ lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames, pkgsStatic }:
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch
+, fixDarwinDylibNames
+, pkgsStatic
+}:
 
 stdenv.mkDerivation rec {
   pname = "giflib";
   version = "5.2.1";
+
   src = fetchurl {
     url = "mirror://sourceforge/giflib/giflib-${version}.tar.gz";
     sha256 = "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii";
@@ -14,33 +21,48 @@ stdenv.mkDerivation rec {
       url = "https://src.fedoraproject.org/rpms/giflib/raw/2e9917bf13df114354163f0c0211eccc00943596/f/CVE-2022-28506.patch";
       sha256 = "sha256-TBemEXkuox8FdS9RvjnWcTWPaHRo4crcwSR9czrUwBY=";
     })
-  ] ++ lib.optional stdenv.hostPlatform.isDarwin
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    # https://sourceforge.net/p/giflib/bugs/133/
     (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"}'
-  ''
-  # Upstream build system does not support NOT building shared libraries.
-  + lib.optionalString stdenv.hostPlatform.isStatic ''
+    })
+  ] ++ lib.optionals stdenv.hostPlatform.isMinGW [
+    # Build dll libraries.
+    (fetchurl {
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/001-mingw-build.patch?h=mingw-w64-giflib&id=4cf1e519bcf51338dc607d23388fca47d71790c0";
+      sha256 = "KyJi3eqH/Ae+guEK6znraZI5+IPImaoYoW5NTkCvjsg=";
+    })
+
+    # Install executables.
+    ./mingw-install-exes.patch
+  ];
+
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [
+    fixDarwinDylibNames
+  ];
+
+  makeFlags = [
+    "PREFIX=${builtins.placeholder "out"}"
+  ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
+    # Upstream build system does not support NOT building shared libraries.
     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
   '';
 
-  nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
-
-  passthru.tests.static = pkgsStatic.giflib;
+  passthru.tests = {
+    static = pkgsStatic.giflib;
+  };
 
   meta = {
     description = "A library for reading and writing gif images";
+    homepage = "https://giflib.sourceforge.net/";
     platforms = lib.platforms.unix;
     license = lib.licenses.mit;
     maintainers = with lib.maintainers; [ ];
diff --git a/nixpkgs/pkgs/development/libraries/giflib/mingw-install-exes.patch b/nixpkgs/pkgs/development/libraries/giflib/mingw-install-exes.patch
new file mode 100644
index 000000000000..5ec3fdad7e65
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giflib/mingw-install-exes.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -92,7 +92,7 @@
+ install: all install-bin install-include install-lib install-man
+ install-bin: $(INSTALLABLE)
+ 	$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
+-	$(INSTALL) $^ "$(DESTDIR)$(BINDIR)"
++	$(INSTALL) $(^:=.exe) "$(DESTDIR)$(BINDIR)"
+ install-include:
+ 	$(INSTALL) -d "$(DESTDIR)$(INCDIR)"
+ 	$(INSTALL) -m 644 gif_lib.h "$(DESTDIR)$(INCDIR)"