Summary: | sci-visualization/gnuplot - gd terminal should use fontconfig but erroneous version check prevents it | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Bernardo Costa <bernardofpc> |
Component: | Current packages | Assignee: | Ulrich Müller <ulm> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | junghans, sci, vapier |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Change #ifdef condition to allow gd-2.0.35-r3's fontconfig mechanism |
Description
Bernardo Costa
2013-03-24 17:28:09 UTC
Created attachment 343122 [details, diff]
Change #ifdef condition to allow gd-2.0.35-r3's fontconfig mechanism
This is a very simple patch.
Enabling this should probably be conditionned to having gd-2.0.35-r3[fontconfig] installed, but I don't know how to do that. At the moment, this is the only version of gd in the portage tree, so perhaps just adding and epatch line is not a problem.
Patch looks ok to me, have you send it upstream? (In reply to comment #2) > Patch looks ok to me, have you send it upstream? If the backport of the bugfix to gd-2.0.35-r3 is Gentoo specific, then the patch shouldn't be sent upstream. (In reply to comment #1) > Enabling this should probably be conditionned to having > gd-2.0.35-r3[fontconfig] installed, [...] Linking against gd[-fontconfig] succeeds, so I wonder if we really need that USE dependency? (In reply to comment #3) > (In reply to comment #2) > > Patch looks ok to me, have you send it upstream? > > If the backport of the bugfix to gd-2.0.35-r3 is Gentoo specific, then the > patch shouldn't be sent upstream. Please note that the patch is for gnuplot-4.6.2, but otherwise, yes, I think this is pretty much gentoo-only. Of course, we could also try to update gd to 2.0.36, which is out since 2007-11 or something like that (and at least 2008-09, per https://bitbucket.org/pierrejoye/gd-libgd/diff/NEWS?diff2=72f83e829f56&at=default) > (In reply to comment #1) > > Enabling this should probably be conditionned to having > > gd-2.0.35-r3[fontconfig] installed, [...] > > Linking against gd[-fontconfig] succeeds, so I wonder if we really need that > USE dependency? You're probably right, since then another #ifdef will fail (HAVE_GD_TTF) that will not include code containing anything enabled by the GD_versions check. What does gnuplot tell you if you run my "set term png" experiment if it's linked to gd[-fontconfig] ? You would also have to try the GDFONTPATH way: setting it to something meaningful for you (such as /usr/share/fonts) and then passing a font such as $ GDFONTPATH=/usr/share/fonts gnuplot [...] gnuplot> set term png font "liberation-fonts/LiberationSans-Regular" gnuplot> set output "/tmp/testgd.png" gnuplot> plot sin(x) This should produce a png with the chosen font, and if you skip the "font ..." part it should produce a png with the "default GD font" (In reply to comment #4) > Of course, we could also try to update gd to 2.0.36, which is out since > 2007-11 or something like that (and at least 2008-09, per > https://bitbucket.org/pierrejoye/gd-libgd/diff/ > NEWS?diff2=72f83e829f56&at=default) @vapier: Can you comment on this? The upstream status of gd isn't entirely clear to me. (In reply to comment #5) the OP's logic makes sense to me -- let's apply this patch to the Gentoo ebuild only and have the gd dep require >=gd-2.0.35-r3. there doesn't appear to be a way to do runtime detection on whether the functionality is supported and/or works. the flags bits go into libgd, but there's no way to read them back out. +*gnuplot-4.6.2-r1 (26 Mar 2013) + + 26 Mar 2013; Ulrich Müller <ulm@gentoo.org> +gnuplot-4.6.2-r1.ebuild, + +files/gnuplot-4.6.2-gdversion.patch: + Update test for GD version, bug 462996. Thanks to Bernardo Costa + <bernardofpc@gmail.com> for the bug report and the patch. + (In reply to comment #4) > What does gnuplot tell you if you run my "set term png" experiment if it's > linked to gd[-fontconfig] ? You would also have to try the GDFONTPATH way: > setting it to something meaningful for you (such as /usr/share/fonts) and > then passing a font such as > > $ GDFONTPATH=/usr/share/fonts gnuplot > [...] > gnuplot> set term png font "liberation-fonts/LiberationSans-Regular" > gnuplot> set output "/tmp/testgd.png" > gnuplot> plot sin(x) > > This should produce a png with the chosen font, and if you skip the "font > ..." part it should produce a png with the "default GD font" Works for me (i.e. uses the chosen font) in both cases, with gd[fontconfig] and with gd[-fontconfig]. |