Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906585 - dev-lang/php: unbundle media-libs/gd
Summary: dev-lang/php: unbundle media-libs/gd
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on: 912772
Blocks: bundled-libs
  Show dependency tree
 
Reported: 2023-05-16 20:55 UTC by Michael Orlitzky
Modified: 2023-08-21 18:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2023-05-16 20:55:48 UTC
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.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-16 20:57:07 UTC
I may start grepping for unused *external* config args...
Comment 2 Brian Evans (RETIRED) gentoo-dev 2023-05-16 22:18:42 UTC
This existed several years ago but generated many bugs as exact versions are expected.  It should stay bundled.
Comment 3 Michael Orlitzky gentoo-dev 2023-05-17 01:33:57 UTC
(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?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-17 01:36:29 UTC
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.
Comment 5 Michael Orlitzky gentoo-dev 2023-05-17 23:55:29 UTC
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.
Comment 6 Michael Orlitzky gentoo-dev 2023-05-19 22:00:06 UTC
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.