1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit autotools eutils flag-o-matic gnome2 multilib libtool multilib-minimal
11 DESCRIPTION="Image loading library for GTK+"
12 HOMEPAGE="http://www.gtk.org/"
16 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="+X debug +introspection jpeg jpeg2k tiff test"
20 >=dev-libs/glib-2.37.6:2[${MULTILIB_USEDEP}]
21 >=media-libs/libpng-1.4:0=[${MULTILIB_USEDEP}]
22 introspection? ( >=dev-libs/gobject-introspection-0.9.3 )
23 jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
24 jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
25 tiff? ( >=media-libs/tiff-3.9.2:0=[${MULTILIB_USEDEP}] )
26 X? ( x11-libs/libX11[${MULTILIB_USEDEP}] )
28 DEPEND="${COMMON_DEPEND}
29 >=dev-util/gtk-doc-am-1.20
30 >=sys-devel/gettext-0.19
33 # librsvg blocker is for the new pixbuf loader API, you lose icons otherwise
34 RDEPEND="${COMMON_DEPEND}
35 !<gnome-base/gail-1000
36 !<gnome-base/librsvg-2.31.0
37 !<x11-libs/gtk+-2.21.3:2
38 !<x11-libs/gtk+-2.90.4:3
40 !<=app-emulation/emul-linux-x86-gtklibs-20131008-r2
41 !app-emulation/emul-linux-x86-gtklibs[-abi_x86_32(-)]
45 MULTILIB_CHOST_TOOLS=(
46 /usr/bin/gdk-pixbuf-query-loaders
50 # Upstream patches from 2.32.x
51 epatch "${FILESDIR}"/${P}-gint64-shift-overflow.patch
52 epatch "${FILESDIR}"/${P}-lowmem-test-glibc.patch #563052, needs eautoreconf
55 # This will avoid polluting the pkg-config file with versioned libpng,
56 # which is causing problems with libpng14 -> libpng15 upgrade
57 # See upstream bug #667068
58 # First check that the pattern is present, to catch upstream changes on bumps,
59 # because sed doesn't return failure code if it doesn't do any replacements
60 grep -q 'l in libpng16' configure || die "libpng check order has changed upstream"
61 sed -e 's:l in libpng16:l in libpng libpng16:' -i configure || die
62 [[ ${CHOST} == *-solaris* ]] && append-libs intl
67 multilib_src_configure() {
68 # png always on to display icons
70 gnome2_src_configure \
71 $(usex debug --enable-debug=yes "") \
72 $(use_with jpeg libjpeg) \
73 $(use_with jpeg2k libjasper) \
74 $(use_with tiff libtiff) \
75 $(multilib_native_use_enable introspection) \
79 # work-around gtk-doc out-of-source brokedness
80 if multilib_is_native_abi; then
81 ln -s "${S}"/docs/reference/${PN}/html docs/reference/${PN}/html || die
85 multilib_src_install() {
86 # Parallel install fails when no gdk-pixbuf is already installed, bug #481372
87 MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install
93 multilib_pkg_preinst() {
94 # Make sure loaders.cache belongs to gdk-pixbuf alone
95 local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
97 if [[ -e ${EROOT}${cache} ]]; then
98 cp "${EROOT}"${cache} "${ED}"/${cache} || die
100 touch "${ED}"/${cache} || die
104 multilib_foreach_abi multilib_pkg_preinst
108 # causes segfault if set, see bug 375615
109 unset __GL_NO_DSO_FINALIZER
111 multilib_foreach_abi gnome2_pkg_postinst
113 # Migration snippet for when this was handled by gtk+
114 if [ -e "${EROOT}"usr/lib/gtk-2.0/2.*/loaders ]; then
115 elog "You need to rebuild ebuilds that installed into" "${EROOT}"usr/lib/gtk-2.0/2.*/loaders
116 elog "to do that you can use qfile from portage-utils:"
117 elog "emerge -va1 \$(qfile -qC ${EPREFIX}/usr/lib/gtk-2.0/2.*/loaders)"
124 if [[ -z ${REPLACED_BY_VERSION} ]]; then
125 rm -f "${EROOT}"usr/lib*/${PN}-2.0/2.10.0/loaders.cache