The way Freetype structured in portage and linked to php & mod_php are really wrong as I can see it. First, Freetype1 and Freetype2 are really 2 different packages, not simply as second or prior version of the other. When this is the case, the later version usually replaces the previous. This is not the case with Freetype... This is also reflected in the way php compile flags are set up, which however is not the case with the Gentoo php & mod_php ebuild. I'm not sure of this is just laziness :-) or too much work load... but, the ebuilds make use of a 'freetype' use flag, which not exist in the profiles/use.desc file. There however are a 'truetype' use flag, supposed to implement freetype support (both FT1 & FT2 as it says), but this are not used by php & mod_php. Also, in php documentation truetype are talked about as freetype1 and t1lib, while with freetype, freetype2 are assumed. Hence, I want to suggest the following to bring order in the php caos... :-) In the php ebuilds, change the current instance of 'freetype' use variable to 'truetype' and change description for 'truetype' in the use.desc file to only talking about Freetype1 and T1lib. Add 'freetype' to use.desc with text 'implements support for Freetype2' or similar. In php ebuilds add support for Freetype2: (mod_php) DEPEND=" >=net-www/apache-1.3.26-r2 apache2? ( >=net-www/apache-2.0.43-r1 ) freetype? ( >=media-libs/freetype-2.0.9) truetype? ( ~media-libs/freetype-1.3.1 >=media-libs/t1lib-1.3.1 ) (php) DEPEND=" freetype? ( >=media-libs/freetype-2.0.9) truetype? ( ~media-libs/freetype-1.3.1 >=media-libs/t1lib-1.3.1 ) and for both php & mod_php use truetype && myconf="${myconf} --with-ttf --with-t1lib" use freetype && myconf="${myconf} --with-freetype" I'm not sure about workings of Portage Slots system, if it can keep FT1 & FT2 apart from conflicting, otherwise I suggest it's devided into 'media-libs/freetype1' and 'media-libs/freetype2'. I want to point out the switch of use variables truetype|freetype may seam trevial, but I concider it importance as in general talk with freetype, Freetype2 is meant and not Freetype1, and will never be - so lets get in phase!
Sorry, it have to be '--with-freetype-dir=DIR'
Check /usr/portage/profile/use.desc. There should be no 'freetype' USE flag. 'truetype' on the other hand, are for freetype and/or TT fonts usage ... Secondly, freetype1 and freetype2 does the same thing. They just changed the api pretty much in freetype2, thus the changed soname for libs, and headers in /usr/include/freetype2/ .... From: http://www.freetype.org/freetype2/docs/ft2faq.html#general-freetype1 --------------------------------------------------------------------- I.5 What are the differences between FreeType 1.x and FreeType 2 ? The biggest differences are that: * FT1 only supports the TrueType format, while FT2 does a lot more. * The FT2 API is simpler as well as more powerful than the FT1 API, * FT1 includes an extension to support OpenType text layout processing. This support is not part of FT2, but has been moved to a distinct project, called FreeType Layout. ( FT Layout is not currently available though..) ------------------------------------------------------------------------- As for the t1lib dependency with freetype1 ... Because freetype1 do not support Type1 fonts, it need to make use of t1lib to have Type1 support. I thus really do not see the need for freetype1 support, if freetype2 does more, and add one less dependency (and are actually still maintained, updated etc).
Technically it's right yes, but when it comes use in php it's not really as some scrips/programs like to use FT1 for different reasons. Php also clearly differs between FT1 and FT2. Also FT2 is said to do same and more then Ft1 I think it's not quite right or it still does it in a different way and that's why some prefere to use Ft1. Point is also both can be used at same time. Anyhow, the Freetype 1 & 2 thingy can be dicussed of course... but my main concerns are really with php. Right, there are no 'freetype' use variable in use.desc as you said and as I pointed out BUT the php ebuilds are using one and not the 'trutype' one. I don't mind if only one use are used and install support for both FT1 and FT2, but now only support for the old FT1 is installed AND it also have the nasty manner to wanna downgrade any existing FT2 instalment. In that case, 'freetype' have to change to 'truetype' in php ebuilds and support for Ft2 also be added. My suggestion was simply to give an option to choose weather install support for both in php or not. And by doing so I think it's better to keep it clearer by using use flag names in accordance with php naming.
I've changed the ebuilds to reflect the truetype USE var.
You can have both installed at the same time: nosferatu root # epm -q freetype freetype-1.3.1-r3 freetype-2.1.3-r2 nosferatu root # Have a look at the SLOT variable, it allows things to coexist. Also, the downgrade thing with diff SLOT's, are just cosmetic bug in portage still ... I am not going to argue on the differences php have with the diff freetypes, but technically they should do the same (with ft2 doing more), on a code level ft2 should just have a simpler api/inteface ... I will leave that to an php expert to descide what should be done with ft1/ft2. Maybe it should depend on ft2 by default, and just use ft1 if present, or the other way around. Like I said, that ill leave for the experts ...
ryan philips wrote: I've changed the ebuilds to reflect the truetype USE var. Ok good so far, but your change do notting but making the freetype1 support in php "official". The freetype2 support are still missing... So all you have to do now are to add an 'freetype' use flag to portage and use it to implement freetype2 support in php :-) Now ppl have the freedome to choose whether they want to use fretype1|freetype2 or both - isn't that a nice thingy? To Marting: I know about the SLOT variable and if the Downgrading really just are a cosmetic thing, it's fine. But my main point wasn't really about that but how freetype was implemented and speacially how it effects php. Not only in php but generally I think it's a good idea to separate freetype1 and freetype2 support and then do it by using the terms used by php (which are the only app I know about in this case, but there may be others). I don't understand why this should be so hard to achive?
I'll propose truetype1 and truetype2 after the 1.4 release... We are too close now.
Why not truetype and truetype2 and it wont break anything but make it possible to add truetype2 support in php, rightaway? Why delay until tomorrow what can be done today?
I do not see why we need to add one more USE flag for on build only. Also, you have not really yet given any examples as to why it cannot just use freetype2 only, but must be able to use both.
To answer first part, I think it's a question of freedom (:-) whether you like to have|need to install (support for) both Freetype1 and Freetype2 (this is in regard of php), also I can't see any harm of adding a USE variable - are there some of ransone of those or? Like it would bring some kind of overhead? To answer the second part, as it is now only support for Freetype1 are compiled into mod_php, which of course are a shortcomming of the ebuild as such. I'm not competent when it comes to build ebuilds but as far as I understand it wont be possible to give the option of which support of freetype compiled in without have individual USE flag. Anyhow, the least that is needed to to is to also add support for freetype2 to mod_php as that is lacking now. If this not answer it I don't understand what kind of example you are asking for.
What I meant was: FT1 (with t1lib) and FT2 does the same thing, FT2 just more. Cant we just enable support for only FT2 and be done with it? Or enable both if 'truetype' in USE? Although I think the first should be sufficient ?
To me FT2 support would be enough, but I'm sure someone else will come nagging if you remove FT1 (it just use to be so...). I think there is some packages that have chosen to rely on the older FT1, not sure but think Typo3 is one, at least it was when I tried it out some months ago. I don't think it matter, but some may not like to be forced to have both installed which would be the case if support for both was added under one use flag - that is basicly my point about it, although I'm personally satisfied with FT2 support (which unfortunately is lacking now and force me to tweak the ebuild at each update).
Based on this discussion, I have switched to FT2 in the latest unstable ebuilds of PHP. Hopefully no bugs are reported, and then we can close this bug fully.
I could only get php to render truetype fonts with the unstable flag set, which means the fix is working here. My 2 cents to closing this bug :-)
Ok, closing this and pushing FT2 stuff to real x86.
since ft2 is marked stable I think that in php.eclass on line 105 and 320 the 'runningunstable' should be removed. I am trying to get a mod_php compiled with '--with-freetype-dir=/usr' instead of ft1 and t1lib, but even after uninstalling ft1, ft2 is still not used. Had to modify the eclass to make things work.
*** Bug 31796 has been marked as a duplicate of this bug. ***
Closing (very) old bug.