Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147058 - add imagemagick USE flag to dev-lang/php
Summary: add imagemagick USE flag to dev-lang/php
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Gentoo Linux bug wranglers
URL: http://overlays.gentoo.org/proj/php/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-10 05:48 UTC by Fab
Modified: 2006-09-10 09:40 UTC (History)
1 user (show)

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


Attachments
add imagemagick USE flag to dev-lang/php (imagemagick-support.patch,6.80 KB, patch)
2006-09-10 05:49 UTC, Fab
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fab 2006-09-10 05:48:22 UTC
Hi,

I'm currently writting an ebuild for a web-based application which use php.

This application optionally need imagemagick php's wrappers : dev-php4/pecl-imagick or dev-php5/pecl-imagick
So, I need an imagemagick USE flag on php merge : I modified current eclasses to add it.

Please have a look at the attached patch.
Tested with dev-lang/php-5.1.6-r2, seems to work fine.
Thanks.
Comment 1 Fab 2006-09-10 05:49:34 UTC
Created attachment 96583 [details, diff]
add imagemagick USE flag to dev-lang/php
Comment 2 Luca Longinotti (RETIRED) gentoo-dev 2006-09-10 06:11:15 UTC
There is no need to modify the eclasses for this and add complexity to them for just an extension...
Simply do
DEPEND="dev-php5/pecl-imagick dev-php4/pecl-imagick"
if you want to force both to be installed, or
DEPEND="||( dev-php5/pecl-imagick dev-php4/pecl-imagick)"
if it's enough that one of the two is installed.
This is how it's done generally for webapps and other ebuilds that have such dependencies, it's not THE perfect solution, but it's the best we could come up with for now. ;)
Best regards, CHTEKK.
Comment 3 Fab 2006-09-10 08:35:00 UTC
(In reply to comment #2)
> Simply do
> DEPEND="dev-php5/pecl-imagick dev-php4/pecl-imagick"
> if you want to force both to be installed

Not possible : if php5 is here, it will force php4 to be installed.

> or
> DEPEND="||( dev-php5/pecl-imagick dev-php4/pecl-imagick)"
> if it's enough that one of the two is installed.

I didn't know this syntax, I tried it, but I don't understand how to apply it to resolve the following problem :

 - if the useflag pdf-preview is selected and :
   - if php4 is installed, dev-php4/pecl-imagick is required.
   - if php5 is installed, dev-php5/pecl-imagick is required.

Currently, there's no way to do it from an ebuild, or I missed something...

The only clean way I found was to modify theses eclasses, and to write in the ebuild :

pkg_setup() {
	...

	use pdf-preview && require_imagick

	...
}

And it works perfectly.

I reopen the bug, just to be certain that you'll see this message, but I promise to give up if you'll close it again. I'll try to search another (ugly) way.

Anyway, thanks for your help.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-09-10 08:44:03 UTC
(In reply to comment #3)
As said above, use 

DEPEND="|| ( dev-php5/pecl-imagick dev-php4/pecl-imagick)"

so that users get the extension installed for PHP5 by default (which is the version that will be installed by portage as default anyway). If they need both, then they need to emerge the other one manually. If they don't want PHP5, they should package.mask it, together w/ other things that may depend on it.

We won't be adding functions to eclasses for one ebuild, sorry.
Comment 5 Fab 2006-09-10 09:40:21 UTC
ok, thanks.