···16161717 # Ensure that the bundled libraries are not used at all
1818 prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
1919- patches = [ ./unbundle.diff ];
1919+ patches = [ ./unbundle.diff ./libtiff-4.4.0.diff ];
20202121 postPatch = ''
2222 # To support cross compilation, use the correct `pkg-config`.
···11+Fix build with libtiff 4.4.0 by not using a private libtiff API.
22+Patch by Kurt Schwehr: https://sourceforge.net/p/freeimage/discussion/36109/thread/2018fdc6e7/
33+44+diff -ru a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp
55+--- a/Source/Metadata/XTIFF.cpp
66++++ b/Source/Metadata/XTIFF.cpp
77+@@ -749,7 +749,7 @@
88+ continue;
99+ }
1010+ // type of storage may differ (e.g. rationnal array vs float array type)
1111+- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) {
1212++ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) {
1313+ // skip tag or _TIFFmemcpy will fail
1414+ continue;
1515+ }