Skip to content

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Apr 19, 2025

Related to Homebrew/homebrew-core#220708

Will be experimenting with various patches/inreplaces to help unbundle freeimage.

Only bundled dependencies are supported by upstream. Most of unbundling is already done by applying Debian patch (which is a similar patch carried by Fedora, Arch, Gentoo, etc). Went with Debian as we can also get a few CVE fixes.


The extra patches here include:

  1. imath-int64.patch - Similar to https://src.fedoraproject.org/rpms/freeimage/blob/rawhide/f/freeimage-openexr3.patch but the minimal set needed. Debian doesn't have a patch for this. Mainly impacts macOS due to some long vs long long.
  2. libtiff-warning.patch - This is patch on top of Debian/Fedora's patched TIFF code. It looks like Fedora logic used in patch will trigger libtiff's stderr and cause flooding of warning messages seen in perpetualdiff. For now, just disable warning output for the patched logic.
  3. macos.patch is based on our 3.17.0.patch though I changed install_name to VERLIBNAME so that linkage happens using versioned path matching the compatibility version. This matches Linux library SONAME and MacPorts https://github.com/macports/macports-ports/blob/master/graphics/freeimage/Portfile#L56
  4. debian-to-homebrew.patch - a couple things in Debian patch don't work in Homebrew

Revamped the old patches for HEAD usage as it is difficult to carry an unbundle patch there.

In follow up, I may just remove HEAD as it bundled libs don't build on macOS 15.4. On Linux, it builds but something is wrong with bundled libtiff

@cho-m cho-m force-pushed the freeimage-patches branch 4 times, most recently from 1bcd694 to 4151471 Compare April 19, 2025 21:45
@cho-m cho-m force-pushed the freeimage-patches branch from 4151471 to 53efe78 Compare April 19, 2025 21:56
@cho-m cho-m marked this pull request as ready for review April 19, 2025 22:17
@cho-m cho-m marked this pull request as draft April 19, 2025 22:17
@cho-m
Copy link
Member Author

cho-m commented Apr 19, 2025

Draft until Homebrew/homebrew-core#220708 run is done.

@cho-m cho-m marked this pull request as ready for review April 19, 2025 23:59
Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great if upstream accepted these.

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label May 12, 2025
@github-actions github-actions bot closed this May 19, 2025
@github-actions github-actions bot deleted the freeimage-patches branch May 19, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants