about summary refs log tree commit diff
path: root/pkgs/development/libraries/freeimage
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/freeimage')
-rw-r--r--pkgs/development/libraries/freeimage/default.nix9
-rw-r--r--pkgs/development/libraries/freeimage/libtiff-4.4.0.diff15
2 files changed, 22 insertions, 2 deletions
diff --git a/pkgs/development/libraries/freeimage/default.nix b/pkgs/development/libraries/freeimage/default.nix
index b132b3fae8ceb..807e96669c677 100644
--- a/pkgs/development/libraries/freeimage/default.nix
+++ b/pkgs/development/libraries/freeimage/default.nix
@@ -15,8 +15,13 @@ stdenv.mkDerivation {
   sourceRoot = "svn-r1900/FreeImage/trunk";
 
   # Ensure that the bundled libraries are not used at all
-  prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
-  patches = [ ./unbundle.diff ];
+  prePatch = ''
+    rm -rf Source/Lib* Source/OpenEXR Source/ZLib
+  '';
+  patches = [
+    ./unbundle.diff
+    ./libtiff-4.4.0.diff
+  ];
 
   postPatch = ''
     # To support cross compilation, use the correct `pkg-config`.
diff --git a/pkgs/development/libraries/freeimage/libtiff-4.4.0.diff b/pkgs/development/libraries/freeimage/libtiff-4.4.0.diff
new file mode 100644
index 0000000000000..13abd5dd70893
--- /dev/null
+++ b/pkgs/development/libraries/freeimage/libtiff-4.4.0.diff
@@ -0,0 +1,15 @@
+Fix build with libtiff 4.4.0 by not using a private libtiff API.
+Patch by Kurt Schwehr: https://sourceforge.net/p/freeimage/discussion/36109/thread/2018fdc6e7/
+
+diff -ru a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp
+--- a/Source/Metadata/XTIFF.cpp
++++ b/Source/Metadata/XTIFF.cpp
+@@ -749,7 +749,7 @@
+ 				continue;

+ 			}

+ 			// type of storage may differ (e.g. rationnal array vs float array type)

+-			if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) {

++			if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) {

+ 				// skip tag or _TIFFmemcpy will fail

+ 				continue;

+ 			}