app-crypt/xca: cleanup
[gentoo.git] / x11-libs / gdk-pixbuf / gdk-pixbuf-2.32.1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 GCONF_DEBUG="no"
7 GNOME2_LA_PUNT="yes"
8
9 inherit autotools eutils flag-o-matic gnome2 multilib libtool multilib-minimal
10
11 DESCRIPTION="Image loading library for GTK+"
12 HOMEPAGE="http://www.gtk.org/"
13
14 LICENSE="LGPL-2+"
15 SLOT="2"
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"
18
19 COMMON_DEPEND="
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}] )
27 "
28 DEPEND="${COMMON_DEPEND}
29         >=dev-util/gtk-doc-am-1.20
30         >=sys-devel/gettext-0.19
31         virtual/pkgconfig
32 "
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
39         abi_x86_32? (
40                 !<=app-emulation/emul-linux-x86-gtklibs-20131008-r2
41                 !app-emulation/emul-linux-x86-gtklibs[-abi_x86_32(-)]
42         )
43 "
44
45 MULTILIB_CHOST_TOOLS=(
46         /usr/bin/gdk-pixbuf-query-loaders
47 )
48
49 src_prepare() {
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
53         eautoreconf
54
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
63
64         gnome2_src_prepare
65 }
66
67 multilib_src_configure() {
68         # png always on to display icons
69         ECONF_SOURCE="${S}" \
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) \
76                 $(use_with X x11) \
77                 --with-libpng
78
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
82         fi
83 }
84
85 multilib_src_install() {
86         # Parallel install fails when no gdk-pixbuf is already installed, bug #481372
87         MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install
88 }
89
90 pkg_preinst() {
91         gnome2_pkg_preinst
92
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"
96
97                 if [[ -e ${EROOT}${cache} ]]; then
98                         cp "${EROOT}"${cache} "${ED}"/${cache} || die
99                 else
100                         touch "${ED}"/${cache} || die
101                 fi
102         }
103
104         multilib_foreach_abi multilib_pkg_preinst
105 }
106
107 pkg_postinst() {
108         # causes segfault if set, see bug 375615
109         unset __GL_NO_DSO_FINALIZER
110
111         multilib_foreach_abi gnome2_pkg_postinst
112
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)"
118         fi
119 }
120
121 pkg_postrm() {
122         gnome2_pkg_postrm
123
124         if [[ -z ${REPLACED_BY_VERSION} ]]; then
125                 rm -f "${EROOT}"usr/lib*/${PN}-2.0/2.10.0/loaders.cache
126         fi
127 }