Skip to content

Commit

Permalink
freeimage: Add patch to fix build with libtiff 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmehall committed Jun 2, 2022
1 parent 25c990a commit 5dcb09d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/libraries/freeimage/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ stdenv.mkDerivation {

# Ensure that the bundled libraries are not used at all
prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
patches = [ ./unbundle.diff ];
patches = [ ./unbundle.diff ./libtiff-4.4.0.diff ];

postPatch = ''
# To support cross compilation, use the correct `pkg-config`.
Expand Down
15 changes: 15 additions & 0 deletions pkgs/development/libraries/freeimage/libtiff-4.4.0.diff
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 5dcb09d

Please sign in to comment.