summary refs log tree commit diff
path: root/pkgs/development/libraries/libtiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libtiff')
-rw-r--r--pkgs/development/libraries/libtiff/default.nix17
-rw-r--r--pkgs/development/libraries/libtiff/headers.patch13
2 files changed, 27 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index 3d3b3529483..15ed6b6ed18 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -2,6 +2,7 @@
 , fetchurl
 
 , pkg-config
+, cmake
 
 , zlib
 , libjpeg
@@ -17,15 +18,25 @@ stdenv.mkDerivation rec {
     sha256 = "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax";
   };
 
-  outputs = [ "bin" "dev" "out" "man" "doc" ];
+  # FreeImage needs this patch
+  patches = [ ./headers.patch ];
 
-  nativeBuildInputs = [ pkg-config ];
+  outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
+
+  postFixup = ''
+    moveToOutput include/tif_dir.h $dev_private
+    moveToOutput include/tif_config.h $dev_private
+    moveToOutput include/tiffiop.h $dev_private
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
 
   propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection)
 
   enableParallelBuilding = true;
 
-  doCheck = true; # not cross;
+  doInstallCheck = true;
+  installCheckTarget = "test";
 
   meta = with lib; {
     description = "Library and utilities for working with the TIFF image file format";
diff --git a/pkgs/development/libraries/libtiff/headers.patch b/pkgs/development/libraries/libtiff/headers.patch
new file mode 100644
index 00000000000..5a00502ef28
--- /dev/null
+++ b/pkgs/development/libraries/libtiff/headers.patch
@@ -0,0 +1,13 @@
+diff -ruN a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
+--- a/libtiff/CMakeLists.txt	2019-05-31 13:05:22.849705817 +0000
++++ b/libtiff/CMakeLists.txt	2020-11-27 21:50:03.527831837 +0000
+@@ -42,6 +42,9 @@
+   libtiffxx.map)
+ 
+ set(tiff_HEADERS
++  tiffiop.h
++  ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h
++  tif_dir.h
+   tiff.h
+   tiffio.h
+   tiffvers.h)