I'm not sure how I missed this for so long, but PHP (since 7.4) supports an external libgd with --enable-gd Include GD support --with-external-gd Use external libgd This would eventually allow us to eliminate the following options, --with-avif GD: Enable AVIF support (only for bundled libgd) --with-webp GD: Enable WEBP support (only for bundled libgd) --with-jpeg GD: Enable JPEG support (only for bundled libgd) --with-xpm GD: Enable XPM support (only for bundled libgd) libgd) --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support (only for bundled libgd) In the meantime, we could propagate the existing php USE flags to media-libs/gd, and warn about the eventual migration.
I may start grepping for unused *external* config args...
This existed several years ago but generated many bugs as exact versions are expected. It should stay bundled.
(In reply to Brian Evans from comment #2) > This existed several years ago but generated many bugs as exact versions are > expected. It should stay bundled. Oh, that's disappointing. I found a bunch of failures in the test suite but a huge chunk of them are spurious failures due to the "gd" format being removed from gd-2.3.3. Others fail for trivial output differences. And some of course fail because real bugs were fixed and those fixes never made it upstream, but those are the most rare. The ./configure script for php does now use pkg-config and a few PHP_CHECK_LIBRARY calls to ensure that a "suitable" version of libgd is found on the system. Do you remember what kind of failures you hit? Any hope of me fixing them upstream?
Given that remi has committed a bunch to the gd repo in recent years and gd development activity has slowed down a bit (it's pretty stable now), I imagine it's fine. Maybe check how different the internal copy in php is and how often it gets commits.
I've started working through the test failures at https://github.com/php/php-src/issues/11252 The lack of "gd" format (and temporarily IMG_BICUBIC) support is potentially annoying if you're stuck with an old codebase that tries to use one of those.
The IMG_BICUBIC bug is a trivial backport if we want to attempt this while gd-2.3.3 is still the latest stable: https://github.com/libgd/libgd/commit/a5f5698a6832fc1f8179a9257f0b91c9a8ef496b#diff-e6f252e5a515be3a071f2a75bd00d2e69d55a1c37970da572f905c04c9b55547 Otherwise I've got it down to what look like a few minor box-sizing issues.