sys-apps/groff: stable 1.22.4 for hppa, bug #704420
[gentoo.git] / x11-libs / gtk+ / gtk+-3.24.16.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 GNOME2_LA_PUNT="yes"
6 GNOME2_EAUTORECONF="yes"
7
8 inherit flag-o-matic gnome2 multilib virtualx multilib-minimal
9
10 DESCRIPTION="Gimp ToolKit +"
11 HOMEPAGE="https://www.gtk.org/"
12
13 LICENSE="LGPL-2+"
14 SLOT="3"
15 IUSE="aqua broadway cloudprint colord cups examples gtk-doc +introspection test vim-syntax wayland +X xinerama"
16 REQUIRED_USE="
17         || ( aqua wayland X )
18         xinerama? ( X )
19 "
20
21 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22
23 # Upstream wants us to do their job:
24 # https://bugzilla.gnome.org/show_bug.cgi?id=768662#c1
25 RESTRICT="test"
26
27 # FIXME: introspection data is built against system installation of gtk+:3,
28 # bug #????
29 COMMON_DEPEND="
30         >=dev-libs/atk-2.15[introspection?,${MULTILIB_USEDEP}]
31         >=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
32         >=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
33         media-libs/fontconfig[${MULTILIB_USEDEP}]
34         >=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
35         >=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
36         >=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
37         >=x11-libs/pango-1.41.0[introspection?,${MULTILIB_USEDEP}]
38         >=media-libs/harfbuzz-0.9:=
39         x11-misc/shared-mime-info
40
41         cloudprint? (
42                 >=net-libs/rest-0.7[${MULTILIB_USEDEP}]
43                 >=dev-libs/json-glib-1.0[${MULTILIB_USEDEP}] )
44         colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
45         cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
46         introspection? ( >=dev-libs/gobject-introspection-1.39:= )
47         wayland? (
48                 >=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}]
49                 >=dev-libs/wayland-protocols-1.14
50                 media-libs/mesa[wayland,${MULTILIB_USEDEP}]
51                 >=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}]
52         )
53         X? (
54                 >=app-accessibility/at-spi2-atk-2.5.3[${MULTILIB_USEDEP}]
55                 media-libs/mesa[X(+),${MULTILIB_USEDEP}]
56                 x11-libs/libX11[${MULTILIB_USEDEP}]
57                 >=x11-libs/libXi-1.3[${MULTILIB_USEDEP}]
58                 x11-libs/libXext[${MULTILIB_USEDEP}]
59                 >=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
60                 x11-libs/libXcursor[${MULTILIB_USEDEP}]
61                 x11-libs/libXfixes[${MULTILIB_USEDEP}]
62                 x11-libs/libXcomposite[${MULTILIB_USEDEP}]
63                 x11-libs/libXdamage[${MULTILIB_USEDEP}]
64                 xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
65         )
66 "
67 DEPEND="${COMMON_DEPEND}
68         app-text/docbook-xsl-stylesheets
69         app-text/docbook-xml-dtd:4.1.2
70         dev-libs/libxslt
71         dev-libs/gobject-introspection-common
72         >=dev-util/gdbus-codegen-2.48
73         dev-util/glib-utils
74         >=dev-util/gtk-doc-am-1.20
75         gtk-doc? ( >=dev-util/gtk-doc-1.20
76                 app-text/docbook-xml-dtd:4.3 )
77         >=sys-devel/gettext-0.19.7[${MULTILIB_USEDEP}]
78         virtual/pkgconfig[${MULTILIB_USEDEP}]
79         X? ( x11-base/xorg-proto )
80         test? (
81                 media-fonts/font-misc-misc
82                 media-fonts/font-cursor-misc )
83 "
84 # gtk+-3.2.2 breaks Alt key handling in <=x11-libs/vte-0.30.1:2.90
85 # gtk+-3.3.18 breaks scrolling in <=x11-libs/vte-0.31.0:2.90
86 RDEPEND="${COMMON_DEPEND}
87         >=dev-util/gtk-update-icon-cache-3
88         !<gnome-base/gail-1000
89         !<x11-libs/vte-0.31.0:2.90
90 "
91 # librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
92 PDEPEND="
93         gnome-base/librsvg[${MULTILIB_USEDEP}]
94         >=x11-themes/adwaita-icon-theme-3.14
95         vim-syntax? ( app-vim/gtk-syntax )
96 "
97
98 MULTILIB_CHOST_TOOLS=(
99         /usr/bin/gtk-query-immodules-3.0$(get_exeext)
100 )
101
102 strip_builddir() {
103         local rule=$1
104         shift
105         local directory=$1
106         shift
107         sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
108                 || die "Could not strip director ${directory} from build."
109 }
110
111 src_prepare() {
112         if ! use test ; then
113                 # don't waste time building tests
114                 strip_builddir SRC_SUBDIRS testsuite Makefile.{am,in}
115
116                 # the tests dir needs to be build now because since commit
117                 # 7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 tests/gtkgears.o needs to be there
118                 # strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
119         fi
120
121         if ! use examples; then
122                 # don't waste time building demos
123                 strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
124                 strip_builddir SRC_SUBDIRS examples Makefile.{am,in}
125         fi
126
127         # gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache
128         eapply "${FILESDIR}"/${PN}-3.24.8-update-icon-cache.patch
129
130         # Fix broken autotools logic
131         eapply "${FILESDIR}"/${PN}-3.22.20-libcloudproviders-automagic.patch
132
133         gnome2_src_prepare
134 }
135
136 multilib_src_configure() {
137         local myconf=(
138                 $(use_enable aqua quartz-backend)
139                 $(use_enable broadway broadway-backend)
140                 $(use_enable cloudprint)
141                 $(use_enable colord)
142                 $(use_enable cups cups auto)
143                 $(multilib_native_use_enable gtk-doc)
144                 $(multilib_native_use_enable introspection)
145                 $(use_enable wayland wayland-backend)
146                 $(use_enable X x11-backend)
147                 $(use_enable X xcomposite)
148                 $(use_enable X xdamage)
149                 $(use_enable X xfixes)
150                 $(use_enable X xkb)
151                 $(use_enable X xrandr)
152                 $(use_enable xinerama)
153                 # cloudprovider is not packaged in Gentoo yet
154                 --disable-cloudproviders
155                 --disable-papi
156                 # sysprof integration needs >=sysprof-3.33.2
157                 --disable-profiler
158                 --enable-man
159                 --with-xml-catalog="${EPREFIX}"/etc/xml/catalog
160                 # need libdir here to avoid a double slash in a path that libtool doesn't
161                 # grok so well during install (// between $EPREFIX and usr ...)
162                 # TODO: Is this still the case?
163                 --libdir="${EPREFIX}"/usr/$(get_libdir)
164                 CUPS_CONFIG="${EPREFIX}/usr/bin/${CHOST}-cups-config"
165         )
166
167         if use wayland; then
168                 myconf+=(
169                         # Include wayland immodule into gtk itself, to avoid problems like
170                         # https://gitlab.gnome.org/GNOME/gnome-shell/issues/109 from a
171                         # user overridden GTK_IM_MODULE envvar
172                         --with-included-immodules=wayland
173                 )
174         fi;
175
176         ECONF_SOURCE=${S} gnome2_src_configure "${myconf[@]}"
177
178         # work-around gtk-doc out-of-source brokedness
179         if multilib_is_native_abi; then
180                 local d
181                 for d in gdk gtk libgail-util; do
182                         ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
183                 done
184         fi
185 }
186
187 multilib_src_test() {
188         "${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
189         GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
190 }
191
192 multilib_src_install() {
193         gnome2_src_install
194 }
195
196 multilib_src_install_all() {
197         insinto /etc/gtk-3.0
198         doins "${FILESDIR}"/settings.ini
199         # Skip README.{in,commits,win32} that would get installed by default
200         DOCS=( AUTHORS ChangeLog NEWS README )
201         einstalldocs
202 }
203
204 pkg_preinst() {
205         gnome2_pkg_preinst
206
207         multilib_pkg_preinst() {
208                 # Make immodules.cache belongs to gtk+ alone
209                 local cache="usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
210
211                 if [[ -e ${EROOT}${cache} ]]; then
212                         cp "${EROOT}"${cache} "${ED}"/${cache} || die
213                 else
214                         touch "${ED}"/${cache} || die
215                 fi
216         }
217         multilib_parallel_foreach_abi multilib_pkg_preinst
218 }
219
220 pkg_postinst() {
221         gnome2_pkg_postinst
222
223         multilib_pkg_postinst() {
224                 gnome2_query_immodules_gtk3 \
225                         || die "Update immodules cache failed (for ${ABI})"
226         }
227         multilib_parallel_foreach_abi multilib_pkg_postinst
228
229         if ! has_version "app-text/evince"; then
230                 elog "Please install app-text/evince for print preview functionality."
231                 elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
232                 elog "add it to your settings.ini file."
233         fi
234 }
235
236 pkg_postrm() {
237         gnome2_pkg_postrm
238
239         if [[ -z ${REPLACED_BY_VERSION} ]]; then
240                 multilib_pkg_postrm() {
241                         rm -f "${EROOT}"usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache
242                 }
243                 multilib_foreach_abi multilib_pkg_postrm
244         fi
245 }