freeimage: Add patch to fix build with libtiff 4.4.0

+16 -1
+1 -1
pkgs/development/libraries/freeimage/default.nix
··· 16 16 17 17 # Ensure that the bundled libraries are not used at all 18 18 prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib"; 19 - patches = [ ./unbundle.diff ]; 19 + patches = [ ./unbundle.diff ./libtiff-4.4.0.diff ]; 20 20 21 21 postPatch = '' 22 22 # To support cross compilation, use the correct `pkg-config`.
+15
pkgs/development/libraries/freeimage/libtiff-4.4.0.diff
··· 1 + Fix build with libtiff 4.4.0 by not using a private libtiff API. 2 + Patch by Kurt Schwehr: https://sourceforge.net/p/freeimage/discussion/36109/thread/2018fdc6e7/ 3 + 4 + diff -ru a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp 5 + --- a/Source/Metadata/XTIFF.cpp 6 + +++ b/Source/Metadata/XTIFF.cpp 7 + @@ -749,7 +749,7 @@ 8 + continue; 9 + } 10 + // type of storage may differ (e.g. rationnal array vs float array type) 11 + - if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { 12 + + if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) { 13 + // skip tag or _TIFFmemcpy will fail 14 + continue; 15 + }