Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502546 - dev-perl/GD - add more features to Makefile.PL
Summary: dev-perl/GD - add more features to Makefile.PL
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-02-26 17:35 UTC by Jorge Nerin
Modified: 2016-12-26 21:01 UTC (History)
0 users

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


Attachments
patch to dev-perl/GD/GD-2.500.0.ebuild (file_502546.txt,522 bytes, patch)
2014-02-26 17:51 UTC, Jorge Nerin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jorge Nerin 2014-02-26 17:35:53 UTC
GD-2.500.0.ebuild passes an explicit -options argument to Makefile.PL so GD does not autoconfigure itself.

When passed the options it results in:
Included Features:          'JPEG,FREETYPE,PNG,GIF'

And when autoconfigured by itself:
Included Features:          GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33

So there is a loss of functionality.


Reproducible: Always

Steps to Reproduce:
1. emerge dev-perl/GD
2. It's difficult to test, you have to use a program that calls a feature not compiled or do a manual ebuild /usr/portage/dev-perl/GD/GD-2.500.0.ebuild compile and look at the output of the compile phase.
Actual Results:  
dev-perl/GD is compiled without some options

Expected Results:  
dev-perl/GD should be compiled with the options supported by installed media-libs/gd

The problem lies in src_configure of the ebuild:

src_configure() {
	local myconf
	use gif && use animgif && myconf+=",ANIMGIF"
	use jpeg && myconf+=",JPEG"
	use truetype && myconf+=",FREETYPE"
	use png && myconf+=",PNG"
	use xpm && myconf+=",XPM"
	use gif && myconf+=",GIF"
	myconf="-options '${myconf:1}'"
	perl-module_src_configure
}

Because it's passing an explicit configuracion Makefile.PL does use it without additional checks.

If we keep passing an explicit -options then we need to add use flags or checks in src_configure. I have added a new check in src_configure:

	if has_version ">=media-libs/gd-2.0.33" ; then myconf+=",VERSION_33,GD_UNCLOSEDPOLY,GD_FTCIRCLE"; fi # Per line 284 of Makefile.PL
Comment 1 Jorge Nerin 2014-02-26 17:51:31 UTC
Created attachment 371352 [details, diff]
patch to dev-perl/GD/GD-2.500.0.ebuild

This patch uses the same logic that there is in Makefile.PL.

Makefile.PL enables the flags VERSION_33,GD_UNCLOSEDPOLY,GD_FTCIRCLE and others that we have as use flags if it finds a media-libs/gd with $minor >= 33, this patch also workarounds a future bug with libgd >=2.1 (https://rt.cpan.org/Public/Bug/Display.html?id=89592) by checking for libgd version with has_version ">=media-libs/gd-2.0.33".
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2016-12-26 21:01:08 UTC
Added in GD-2.560.0-r2, thanks!


commit 437aa9460a636f7f700873fe19ffe2491e0be9aa
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Mon Dec 26 21:57:02 2016 +0100

    dev-perl/GD: Revision bump to add missing GD features, bug 502546 - thanks to Jorge Nerin
    
    Package-Manager: portage-2.3.3

 dev-perl/GD/GD-2.560.0-r2.ebuild | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)