about summary refs log tree commit diff
path: root/pkgs/development/libraries/libtiff/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libtiff/default.nix')
-rw-r--r--pkgs/development/libraries/libtiff/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index c8871a4ba68e8..b66c8c288bc8b 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitLab
+, fetchpatch
 , nix-update-script
 
 , autoreconfHook
@@ -10,8 +11,10 @@
 , lerc
 , libdeflate
 , libjpeg
+, libwebp
 , xz
 , zlib
+, zstd
 
   # for passthru.tests
 , libgeotiff
@@ -41,6 +44,15 @@ stdenv.mkDerivation (finalAttrs: {
     # libc++abi 11 has an `#include <version>`, this picks up files name
     # `version` in the project's include paths
     ./rename-version.patch
+    # Fix static linking of `libtiff` via `pkg-config` not working
+    # because `libtiff` does not declare `Lerc` dependency.
+    # nixpkgs has `lerc` >= 4 which provides a `.pc` file.
+    # TODO: Close when https://gitlab.com/libtiff/libtiff/-/merge_requests/633 is merged and available
+    (fetchpatch {
+      name = "libtiff-4.pc-Fix-Requires.private-missing-Lerc.patch";
+      url = "https://gitlab.com/libtiff/libtiff/-/commit/ea882c3c240c14a897b9be38d815cc1893aafa59.patch";
+      hash = "sha256-C0xA3k1sgKmGJjEnyG9UxhXqYBYShKUDQsyjhbEDJbQ=";
+    })
   ];
 
   postPatch = ''
@@ -62,14 +74,19 @@ stdenv.mkDerivation (finalAttrs: {
 
   buildInputs = [
     lerc
+    zstd
   ];
 
   # TODO: opengl support (bogus configure detection)
   propagatedBuildInputs = [
     libdeflate
     libjpeg
+    # libwebp depends on us; this will cause infinite
+    # recursion otherwise
+    (libwebp.override { tiffSupport = false; })
     xz
     zlib
+    zstd
   ];
 
   enableParallelBuilding = true;