Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gtk+-2.12.10: gtk-doc-am patch
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Wed Aug 13, 2008 4:09 pm    Post subject: gtk+-2.12.10: gtk-doc-am patch Reply with quote

The more recent gtk+ (.9 and .10) pull in gtk-doc-am even if you have -doc. I fixed this, but then gtk fails to compile with:
Quote:
gtk-doc.make:7: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
gtk-doc.make:48: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL
gtk-doc.make:153: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL
gtk-doc.make:7: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
gtk-doc.make:48: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL
gtk-doc.make:153: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL
gtk-doc.make:7: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
gtk-doc.make:48: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL
gtk-doc.make:153: ENABLE_GTK_DOC does not appear in AM_CONDITIONAL



After some checking, the critical reason for this seems to be because of a change in the src_unpack() section:
Quote:

# remember, eautoreconf applies elibtoolize.
# if you remove this, you should manually run elibtoolize

cp aclocal.m4 old_macros.m4
AT_M4DIR="." eautoreconf

eautoreconf

epunt_cxx


Was changed to:
Quote:

# remember, eautoreconf applies elibtoolize.
# if you remove this, you should manually run elibtoolize
eautoreconf


Unfortunately, the documentation for changes in this ebuild are abysmal; They don't mention anywhere what these little hacks and kludges do.

After much experimenting, I got the fixed ebuild to work by simply replacing eautoreconf with elibtoolize.

I've made a patch for anyone who maintains an overlay like me. It also optionalizes xdamage and xcomposite, which were made hard deps for a really stupid reason a few versions ago. (Since VNC doesn't support either of those, I see no point in wasting space on them.)

Code:
--- gtk+-2.12.10-r1.ebuild.org  2008-08-13 16:38:08.000000000 +0100
+++ gtk+-2.12.10-r1.ebuild.new  2008-08-13 16:38:40.000000000 +0100
@@ -12,7 +12,7 @@
 LICENSE="LGPL-2"
 SLOT="2"
 KEYWORDS="alpha amd64 ~arm ~hppa ia64 ~mips ppc ~ppc64 ~sh sparc x86 ~x86-fbsd"
-IUSE="cups debug doc jpeg tiff vim-syntax xinerama"
+IUSE="cups debug doc jpeg tiff vim-syntax xcomposite xdamage xinerama"
 
 RDEPEND="x11-libs/libXrender
        x11-libs/libX11
@@ -22,8 +22,8 @@
        x11-libs/libXrandr
        x11-libs/libXcursor
        x11-libs/libXfixes
-       x11-libs/libXcomposite
-       x11-libs/libXdamage
+       xcomposite? ( x11-libs/libXcomposite )
+       xdamage? ( x11-libs/libXdamage )
        xinerama? ( x11-libs/libXinerama )
        >=dev-libs/glib-2.13.5
        >=x11-libs/pango-1.17.3
@@ -43,8 +43,8 @@
        x11-proto/inputproto
        x11-proto/damageproto
        xinerama? ( x11-proto/xineramaproto )
-       >=dev-util/gtk-doc-am-1.8
        doc? (
+                       >=dev-util/gtk-doc-am-1.8
                        >=dev-util/gtk-doc-1.8
                        ~app-text/docbook-xml-dtd-4.1.2
                 )"
@@ -103,7 +103,9 @@
 
        # remember, eautoreconf applies elibtoolize.
        # if you remove this, you should manually run elibtoolize
-       eautoreconf
+
+       #eautoreconf
+       elibtoolize
 }
 
 src_compile() {
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3789
Location: sleeping in the bathtub

PostPosted: Wed Aug 13, 2008 6:52 pm    Post subject: Re: gtk+-2.12.10: gtk-doc-am patch Reply with quote

This is of interest to me, however I tried building gtk+ without composite before and the build failed, does it actually build for you when neither libXcomposite nor compositeproto are installed on your system?

Also, you can shrink the size of /usr/lib/libgtk-x11-2.0.so.0.whatever considerably by passing --disable-debug, it's not recommended but it works fine for me.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Wed Aug 13, 2008 10:53 pm    Post subject: Reply with quote

This is the full ebuild:
Code:
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-libs/gtk+/gtk+-2.12.10-r1.ebuild,v 1.5 2008/08/12 13:28:21 armin76 Exp $

WANT_AUTOMAKE="1.7"

inherit gnome.org flag-o-matic eutils autotools virtualx

DESCRIPTION="Gimp ToolKit +"
HOMEPAGE="http://www.gtk.org/"

LICENSE="LGPL-2"
SLOT="2"
KEYWORDS="alpha amd64 ~arm ~hppa ia64 ~mips ppc ~ppc64 ~sh sparc x86 ~x86-fbsd"
IUSE="cups debug doc jpeg tiff vim-syntax xcomposite xdamage xinerama"

RDEPEND="x11-libs/libXrender
        x11-libs/libX11
        x11-libs/libXi
        x11-libs/libXt
        x11-libs/libXext
        x11-libs/libXrandr
        x11-libs/libXcursor
        x11-libs/libXfixes
        xcomposite? ( x11-libs/libXcomposite )
        xdamage? ( x11-libs/libXdamage )
        xinerama? ( x11-libs/libXinerama )
        >=dev-libs/glib-2.13.5
        >=x11-libs/pango-1.17.3
        >=dev-libs/atk-1.10.1
        >=x11-libs/cairo-1.2.0
        media-libs/fontconfig
        x11-misc/shared-mime-info
        >=media-libs/libpng-1.2.1
        cups? ( net-print/cups )
        jpeg? ( >=media-libs/jpeg-6b-r2 )
        tiff? ( >=media-libs/tiff-3.5.7 )"
DEPEND="${RDEPEND}
        sys-devel/autoconf
        >=dev-util/pkgconfig-0.9
        x11-proto/xextproto
        x11-proto/xproto
        x11-proto/inputproto
        x11-proto/damageproto
        xinerama? ( x11-proto/xineramaproto )
        doc? (
                        >=dev-util/gtk-doc-am-1.8
                        >=dev-util/gtk-doc-1.8
                        ~app-text/docbook-xml-dtd-4.1.2
                 )"
PDEPEND="vim-syntax? ( app-vim/gtk-syntax )"

pkg_setup() {
        if ! built_with_use x11-libs/cairo X; then
                eerror "Please re-emerge x11-libs/cairo with the X USE flag set"
                die "cairo needs the X flag set"
        fi
}

set_gtk2_confdir() {
        # An arch specific config directory is used on multilib systems
        has_multilib_profile && GTK2_CONFDIR="/etc/gtk-2.0/${CHOST}"
        GTK2_CONFDIR=${GTK2_CONFDIR:=/etc/gtk-2.0}
}

src_unpack() {
        unpack ${A}
        cd "${S}"

        # use an arch-specific config directory so that 32bit and 64bit versions
        # dont clash on multilib systems
        has_multilib_profile && epatch "${FILESDIR}/${PN}-2.8.0-multilib.patch"

        # Workaround adobe flash infinite loop. Patch from http://bugzilla.gnome.org/show_bug.cgi?id=463773#c11
        epatch "${FILESDIR}/${PN}-2.12.0-flash-workaround.patch"

        # OpenOffice.org might hang at startup (on non-gnome env) without this workaround, bug #193513
        epatch "${FILESDIR}/${PN}-2.12.0-openoffice-freeze-workaround.patch"

        # Firefox print review crash fix, bug #195644
        epatch "${FILESDIR}/${PN}-2.12.1-firefox-print-preview.patch"

        # Fix gdk_window_get_frame_extents, to fix window placements bugs from bug #225339; included in 2.12.11
        epatch "${FILESDIR}/${P}-fix-get_frame_extents.patch"

        # Fix showing of treeview sort indicators; included in 2.12.11
        epatch "${FILESDIR}/${P}-fix-treeview_sort_indicators.patch"

        # Compile without libintl.h (uclibc)
        epatch "${FILESDIR}/${P}-no-libintl.patch"

        # Work without C++
        epatch "${FILESDIR}/${P}-fix-nocxx.patch"

        # -O3 and company cause random crashes in applications. Bug #133469
        replace-flags -O3 -O2
        strip-flags

        use ppc64 && append-flags -mminimal-toc

        # Fix libtool usage for configure stage, bug #213789
        epatch "${FILESDIR}/${PN}-2.12.9-libtool-2.patch"

        # remember, eautoreconf applies elibtoolize.
        # if you remove this, you should manually run elibtoolize

        #eautoreconf
        elibtoolize
}

src_compile() {
        # png always on to display icons (foser)
        local myconf="$(use_enable doc gtk-doc) \
                $(use_with jpeg libjpeg) \
                $(use_with tiff libtiff) \
                $(use_enable xinerama) \
                $(use_enable cups cups auto) \
                --with-libpng \
                --with-gdktarget=x11 \
                --with-xinput"

        # Passing --disable-debug is not recommended for production use
        use debug && myconf="${myconf} --enable-debug=yes"

        econf ${myconf} || die "configure failed"

        emake || die "compile failed"
}

src_test() {
        Xemake check || die
}

src_install() {
        emake DESTDIR="${D}" install || die "Installation failed"

        set_gtk2_confdir
        dodir ${GTK2_CONFDIR}
        keepdir ${GTK2_CONFDIR}

        # see bug #133241
        echo 'gtk-fallback-icon-theme = "gnome"' > "${D}/${GTK2_CONFDIR}/gtkrc"

        # Enable xft in environment as suggested by <utx@gentoo.org>
        dodir /etc/env.d
        echo "GDK_USE_XFT=1" > "${D}/etc/env.d/50gtk2"

        dodoc AUTHORS ChangeLog* HACKING NEWS* README*

        # This has to be removed, because it's multilib specific; generated in
        # postinst
        rm "${D}/etc/gtk-2.0/gtk.immodules"
}

pkg_postinst() {
        set_gtk2_confdir

        if [ -d "${ROOT}${GTK2_CONFDIR}" ]; then
                gtk-query-immodules-2.0  > "${ROOT}${GTK2_CONFDIR}/gtk.immodules"
                gdk-pixbuf-query-loaders > "${ROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders"
        else
                ewarn "The destination path ${ROOT}${GTK2_CONFDIR} doesn't exist;"
                ewarn "to complete the installation of GTK+, please create the"
                ewarn "directory and then manually run:"
                ewarn "  cd ${ROOT}${GTK2_CONFDIR}"
                ewarn "  gtk-query-immodules-2.0  > gtk.immodules"
                ewarn "  gdk-pixbuf-query-loaders > gdk-pixbuf.loaders"
        fi

        if [ -e /usr/lib/gtk-2.0/2.[^1]* ]; then
                elog "You need to rebuild ebuilds that installed into" /usr/lib/gtk-2.0/2.[^1]*
                elog "to do that you can use qfile from portage-utils:"
                elog "emerge -va1 \$(qfile -qC /usr/lib/gtk-2.0/2.[^1]*)"
        fi

        elog "Please install app-text/evince for print preview functionality"
}


It emerges fine on mine with these useflags:

[ebuild R ] x11-libs/gtk+-2.12.10-r1 USE="X jpeg tiff -cups -debug -doc -vim-syntax -xcomposite -xdamage -xinerama" 0 kB [1]


I couldn't get it to work without DEPENDS stuff like damageproto and compositeproto which is why it they aren't commented out or optionalized, but apart from that it seemes fine.

Note that I have no idea what all this crap does; All I know is my system worked fine without it and then one day after a --sync, the ebuild decided it suddenly needed all these new deps.

I disagreed.

The downside is that I have to update lots of overlaid ebuilds everytime they get updated.

It is irritating 'tho - The documentation for changes like that are awful; Often I can't find any reason for the sudden change. On lucky rare occasions, there'll be a bug # submitted, but then it often turns out the reason for suddenly adding the hard dep are really silly/trivial.
Back to top
View user's profile Send private message
Leio
Developer
Developer


Joined: 27 Feb 2003
Posts: 487
Location: Estonia

PostPosted: Fri Aug 15, 2008 1:03 pm    Post subject: Reply with quote

cp aclocal.m4 old_macros.m4 was an awful hack that doesn't work when you have new automake, autoconf and/or libtool versions.
Therefore gtk-doc-am is a BUILD requirement. It only installs a .m4 file, that can be in the end removed with --depclean because it's only a build time dependency for autoconf to succeed...
This is correctly and fully documented in ChangeLog as "Fix libtool usage for configure stage, bug #213789.". We do not include the "cvs diff" output before committing to ChangeLog to document any more detailed than that.

epunt_cxx was removed because CXX cheks are actually necessary as it will then correctly detect if g++ isn't there and then not build a C++ test instead of failing build. But epunt_cxx hasn't worked for a while anyway (due to the patch it applying to configure silently has failed for a while with newer autoconf generated configure files) and the removal was actually no real change.

I fail to find any requests for investigating USE flagging libXdamage and/or libXcomposite in Gentoo bugzilla.
_________________
GNOME team lead; GStreamer; MIPS/ARM64
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Fri Aug 15, 2008 6:07 pm    Post subject: Reply with quote

Ah! Very informative. Thank you for the info :)

It's a bit unfortunate I didn't find that bug during my searches as I was looking for stuff regarding gtk-doc-am and that was only mentioned once in that bug, and even then only in passing...

('tho reading it, I still don't think I'd have understood wtf it was talking about tbh! :P)

re. libXdamage and libXcomposite, I never posted anything about that. I routinely remove deps like that because I'm trying to keep my system bloat down, and trimming creeping deps is the main how. I didn't think it was worth posting a bug since I'd have to do it for every other ebuild on my system which I do this to then.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum