commit:     838c92297214d6330844df0b15ba61c33c27c430
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 30 15:48:24 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 20:16:13 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=838c9229

media-libs/freetype: avoid redefining TT_CONFIG_OPTION_SUBPIXEL_HINTING

Adjust the enable_option function to remvoe comments instead of appending an
additional line. This should resolve a build failure in sys-boot/grub.

Also allow both cleartype and infinality to be enabled simultaneously, as
documented in ftoption.h.

Bug: https://bugs.gentoo.org/595558
Package-Manager: portage-2.3.1_p4_p550764

 .../{freetype-2.7-r1.ebuild => freetype-2.7-r2.ebuild}  | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/media-libs/freetype/freetype-2.7-r1.ebuild 
b/media-libs/freetype/freetype-2.7-r2.ebuild
similarity index 93%
rename from media-libs/freetype/freetype-2.7-r1.ebuild
rename to media-libs/freetype/freetype-2.7-r2.ebuild
index c7c0aaf..8650a68 100644
--- a/media-libs/freetype/freetype-2.7-r1.ebuild
+++ b/media-libs/freetype/freetype-2.7-r2.ebuild
@@ -41,8 +41,6 @@ RDEPEND="${CDEPEND}
        abi_x86_32? ( utils? ( 
!app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)] ) )"
 PDEPEND="infinality? ( media-libs/fontconfig-infinality )"
 
-REQUIRED_USE="?? ( cleartype_hinting infinality )"
-
 PATCHES=(
        # This is the same as the 01 patch from infinality
        "${FILESDIR}"/${PN}-2.7-enable-valid.patch
@@ -52,27 +50,28 @@ PATCHES=(
 
 src_prepare() {
        enable_option() {
-               sed -i -e "/#define $1/a #define $1" \
+               sed -i -e "/#define $1/ { s:/\* ::; s: \*/:: }" \
                        include/${PN}/config/ftoption.h \
                        || die "unable to enable option $1"
        }
 
        disable_option() {
-               sed -i -e "/#define $1/ { s:^:/*:; s:$:*/: }" \
+               sed -i -e "/#define $1/ { s:^:/* :; s:$: */: }" \
                        include/${PN}/config/ftoption.h \
                        || die "unable to disable option $1"
        }
 
        default
 
-       if use infinality; then
-               # FT_CONFIG_OPTION_SUBPIXEL_RENDERING is already enabled in 
freetype-2.4.11
+       # Will be the new default for >=freetype-2.7.0
+       disable_option "TT_CONFIG_OPTION_SUBPIXEL_HINTING  2"
+
+       if use infinality && use cleartype_hinting; then
+               enable_option "TT_CONFIG_OPTION_SUBPIXEL_HINTING  ( 1 | 2 )"
+       elif use infinality; then
                enable_option "TT_CONFIG_OPTION_SUBPIXEL_HINTING  1"
        elif use cleartype_hinting; then
-               # Will be the new default for >=freetype-2.7.0
                enable_option "TT_CONFIG_OPTION_SUBPIXEL_HINTING  2"
-       else
-               disable_option "TT_CONFIG_OPTION_SUBPIXEL_HINTING  2"
        fi
 
        if ! use bindist; then

Reply via email to