Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 919376

Summary: dev-php/ca-bundle-1.3.1: Supplied autoload.php does not respect EPREFIX
Product: Gentoo/Alt Reporter: Moritz Brunner <moritz.brunner+gentoo>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: CONFIRMED ---    
Severity: normal CC: guillaumeseren, php-bugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to include $EPREFIX in autoload.php paths
v2 of patch, using prefix.eclass/prefixify_ro

Description Moritz Brunner 2023-12-06 19:04:33 UTC
The bundled autoload.php file from the ebuild's files subdirectory hardcodes library dependency paths to /usr/share/php/..., which will not be valid in a Prefix installation. 

One example:
> require_once '/usr/share/php/Fedora/Autoloader/autoload.php';

The file should be modified to include EPREFIX in all paths before being included in the final installation image.
Comment 1 Moritz Brunner 2023-12-06 19:06:34 UTC
Created attachment 877958 [details, diff]
Patch to include $EPREFIX in autoload.php paths
Comment 2 Fabian Groffen gentoo-dev 2023-12-07 08:18:18 UTC
I think you should be able to require prefix, and then use prefixify_ro "${FILESDIR}"/autoload.php, it will place an adapted copy in ${T}.
Comment 3 Moritz Brunner 2023-12-07 17:59:39 UTC
Created attachment 878162 [details, diff]
v2 of patch, using prefix.eclass/prefixify_ro

Thank you for your improvement suggestion, this is indeed less verbose and more elegant. I've adapted the patch to use prefixify_ro instead of sed.
Comment 4 Fabian Groffen gentoo-dev 2023-12-25 11:22:08 UTC
@PHP, @Guillame: does this look acceptable?  OK to apply?