Diff gtk+-2.24.33-r3 with a gtk+-3.24.35

/usr/portage/x11-libs/gtk+/gtk+-3.24.35.ebuild 2023-10-09 14:52:35.916368512 +0300
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2022 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=8
4
EAPI=7
5 5
GNOME2_EAUTORECONF="yes"
6 6

  
7
inherit flag-o-matic gnome2 multilib multilib-minimal readme.gentoo-r1 virtualx
7
inherit gnome2 multilib multilib-minimal virtualx
8 8

  
9 9
DESCRIPTION="Gimp ToolKit +"
10 10
HOMEPAGE="https://www.gtk.org/"
11 11

  
12 12
LICENSE="LGPL-2+"
13
SLOT="2"
14
IUSE="aqua cups examples +introspection test vim-syntax xinerama"
13
SLOT="3"
14
IUSE="aqua broadway colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama"
15 15
REQUIRED_USE="
16
	xinerama? ( !aqua )
16
	|| ( aqua wayland X )
17
	xinerama? ( X )
17 18
"
18 19

  
19
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
20
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-solaris"
20 21

  
21 22
# Upstream wants us to do their job:
22
# https://bugzilla.gnome.org/show_bug.cgi?id=768663#c1
23
# https://bugzilla.gnome.org/show_bug.cgi?id=768662#c1
23 24
RESTRICT="test"
24 25

  
26
# FIXME: introspection data is built against system installation of gtk+:3,
27
# bug #????
25 28
COMMON_DEPEND="
26 29
	>=app-accessibility/at-spi2-core-2.46.0[introspection?,${MULTILIB_USEDEP}]
27
	>=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
28
	>=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
30
	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
31
	>=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}]
32
	media-libs/fontconfig[${MULTILIB_USEDEP}]
33
	>=media-libs/harfbuzz-2.2.0:=
34
	>=media-libs/libepoxy-1.4[X(+)?,${MULTILIB_USEDEP}]
29 35
	virtual/libintl[${MULTILIB_USEDEP}]
30
	>=x11-libs/cairo-1.12.14-r4:=[aqua?,svg(+),${MULTILIB_USEDEP}]
31
	>=x11-libs/gdk-pixbuf-2.30.7:2[introspection?,${MULTILIB_USEDEP}]
32
	>=x11-libs/pango-1.36.3[introspection?,${MULTILIB_USEDEP}]
36
	>=x11-libs/cairo-1.14[aqua?,glib,svg(+),X?,${MULTILIB_USEDEP}]
37
	>=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}]
38
	>=x11-libs/pango-1.44.0[introspection?,${MULTILIB_USEDEP}]
33 39
	x11-misc/shared-mime-info
34 40

  
35
	cups? ( >=net-print/cups-1.7.1-r2:=[${MULTILIB_USEDEP}] )
36
	introspection? ( >=dev-libs/gobject-introspection-0.9.3:= )
37
	!aqua? (
38
		>=x11-libs/cairo-1.12.14-r4:=[aqua?,svg(+),X,${MULTILIB_USEDEP}]
39
		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
40
		>=x11-libs/libXcomposite-0.4.4-r1[${MULTILIB_USEDEP}]
41
		>=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
42
		>=x11-libs/libXdamage-1.1.4-r1[${MULTILIB_USEDEP}]
43
		>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
44
		>=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
45
		>=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
41
	colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] )
42
	cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] )
43
	introspection? ( >=dev-libs/gobject-introspection-1.39:= )
44
	sysprof? ( >=dev-util/sysprof-capture-3.33.2:3[${MULTILIB_USEDEP}] )
45
	wayland? (
46
		>=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}]
47
		>=dev-libs/wayland-protocols-1.21
48
		media-libs/mesa[wayland,${MULTILIB_USEDEP}]
49
		>=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}]
50
	)
51
	X? (
52
		media-libs/libglvnd[X(+),${MULTILIB_USEDEP}]
53
		x11-libs/libX11[${MULTILIB_USEDEP}]
54
		x11-libs/libXcomposite[${MULTILIB_USEDEP}]
55
		x11-libs/libXcursor[${MULTILIB_USEDEP}]
56
		x11-libs/libXdamage[${MULTILIB_USEDEP}]
57
		x11-libs/libXext[${MULTILIB_USEDEP}]
58
		x11-libs/libXfixes[${MULTILIB_USEDEP}]
59
		>=x11-libs/libXi-1.8[${MULTILIB_USEDEP}]
46 60
		>=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
47
		>=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
48
		xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
61
		xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
49 62
	)
50 63
"
51 64
DEPEND="${COMMON_DEPEND}
52
	!aqua? ( x11-base/xorg-proto )
53 65
	test? (
54 66
		media-fonts/font-cursor-misc
55 67
		media-fonts/font-misc-misc
56
		x11-themes/hicolor-icon-theme
57 68
	)
69
	X? ( x11-base/xorg-proto )
58 70
"
59

  
60
# gtk+-2.24.8 breaks Alt key handling in <=x11-libs/vte-0.28.2:0
61
# Add blocker against old gtk-builder-convert to be sure we maintain both
62
# in sync.
63 71
RDEPEND="${COMMON_DEPEND}
64
	>=dev-util/gtk-update-icon-cache-2
65
	>=x11-themes/adwaita-icon-theme-3.14
66
	x11-themes/gnome-themes-standard
67
	!<dev-util/gtk-builder-convert-${PV}
72
	>=dev-util/gtk-update-icon-cache-3
68 73
"
69 74
# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
70 75
PDEPEND="
71 76
	gnome-base/librsvg[${MULTILIB_USEDEP}]
72
	x11-themes/gtk-engines-adwaita
77
	>=x11-themes/adwaita-icon-theme-3.14
73 78
	vim-syntax? ( app-vim/gtk-syntax )
74 79
"
75
# docbook-4.1.2 and xsl required for man pages
76
# docbook-4.3 required for gtk-doc
77 80
BDEPEND="
78 81
	app-text/docbook-xml-dtd:4.1.2
79
	app-text/docbook-xml-dtd:4.3
80 82
	app-text/docbook-xsl-stylesheets
81 83
	dev-libs/gobject-introspection-common
82 84
	dev-libs/libxslt
85
	>=dev-util/gdbus-codegen-2.48
83 86
	dev-util/glib-utils
84 87
	>=dev-util/gtk-doc-am-1.20
85
	>=sys-devel/gettext-0.18.3
88
	wayland? ( dev-util/wayland-scanner )
89
	>=sys-devel/gettext-0.19.7
86 90
	virtual/pkgconfig
87
	examples? ( x11-libs/gdk-pixbuf )
91
	x11-libs/gdk-pixbuf:2
92
	gtk-doc? (
93
		app-text/docbook-xml-dtd:4.3
94
		>=dev-util/gtk-doc-1.20
95
	)
88 96
"
89 97

  
90
DISABLE_AUTOFORMATTING="yes"
91
DOC_CONTENTS="To make the gtk2 file chooser use 'current directory' mode by default,
92
edit ~/.config/gtk-2.0/gtkfilechooser.ini to contain the following:
93
[Filechooser Settings]
94
StartupMode=cwd"
95

  
96 98
MULTILIB_CHOST_TOOLS=(
97
	/usr/bin/gtk-query-immodules-2.0$(get_exeext)
99
	/usr/bin/gtk-query-immodules-3.0$(get_exeext)
98 100
)
99 101

  
100 102
PATCHES=(
101
	# Fix tests running when building out of sources, bug #510596, upstream bug #730319
102
	"${FILESDIR}"/${PN}-2.24.24-out-of-source.patch
103
	# Rely on split gtk-update-icon-cache package, bug #528810
104
	"${FILESDIR}"/${PN}-2.24.31-update-icon-cache.patch # requires eautoreconf
105
	# Respect ${NM}, bug #725852
106
	"${FILESDIR}"/${PN}-2.24.33-respect-NM.patch # requires eautoreconf
107
	# Fix casts, bug #880617
108
	"${FILESDIR}"/${PN}-2.24.33-Fix-casts.patch
103
	# gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache
104
	"${FILESDIR}"/${PN}-3.24.25-update-icon-cache.patch
105

  
106
	# Fix broken autotools logic
107
	"${FILESDIR}"/${PN}-3.22.20-libcloudproviders-automagic.patch
109 108
)
110 109

  
111 110
strip_builddir() {
......
117 116
		|| die "Could not strip director ${directory} from build."
118 117
}
119 118

  
120
set_gtk2_confdir() {
121
	# An arch specific config directory is used on multilib systems
122
	GTK2_CONFDIR="/etc/gtk-2.0/${CHOST}"
123
}
124

  
125 119
src_prepare() {
126
	# Various glib marshaller churn could break build against a different glib version, force regeneration
127
	rm -v gdk/gdkmarshalers.{c,h} gtk/gtkmarshal.{c,h} gtk/gtkmarshalers.{c,h} \
128
		perf/marshalers.{c,h} gtk/gtkaliasdef.c gtk/gtkalias.h || die
129

  
130
	# Stop trying to build unmaintained docs, bug #349754, upstream bug #623150
131
	strip_builddir SUBDIRS tutorial docs/Makefile.{am,in}
132
	strip_builddir SUBDIRS faq docs/Makefile.{am,in}
133

  
134
	# -O3 and company cause random crashes in applications, bug #133469
135
	replace-flags -O3 -O2
136
	strip-flags
137

  
138 120
	if ! use test ; then
139 121
		# don't waste time building tests
140
		strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
141
		strip_builddir SUBDIRS tests gdk/Makefile.{am,in} gtk/Makefile.{am,in}
142
	else
143
		# Non-working test in gentoo's env
144
		sed 's:\(g_test_add_func ("/ui-tests/keys-events.*\):/*\1*/:g' \
145
			-i gtk/tests/testing.c || die "sed 1 failed"
146

  
147
		# Cannot work because glib is too clever to find real user's home
148
		# gentoo bug #285687, upstream bug #639832
149
		# XXX: /!\ Pay extra attention to second sed when bumping /!\
150
		sed '/TEST_PROGS.*recentmanager/d' -i gtk/tests/Makefile.am \
151
			|| die "failed to disable recentmanager test (1)"
152
		sed '/^TEST_PROGS =/,+3 s/recentmanager//' -i gtk/tests/Makefile.in \
153
			|| die "failed to disable recentmanager test (2)"
154
		sed 's:\({ "GtkFileChooserButton".*},\):/*\1*/:g' -i gtk/tests/object.c \
155
			|| die "failed to disable recentmanager test (3)"
156

  
157
		# https://bugzilla.gnome.org/show_bug.cgi?id=617473
158
		sed -i -e 's:pltcheck.sh:$(NULL):g' \
159
			gtk/Makefile.am || die
160

  
161
		# UI tests require immodules already installed; bug #413185
162
		if ! has_version 'x11-libs/gtk+:2'; then
163
			ewarn "Disabling UI tests because this is the first install of"
164
			ewarn "gtk+:2 on this machine. Please re-run the tests after ${P}"
165
			ewarn "has been installed."
166
			sed '/g_test_add_func.*ui-tests/ d' \
167
				-i gtk/tests/testing.c || die "sed 2 failed"
168
		fi
122
		strip_builddir SRC_SUBDIRS testsuite Makefile.{am,in}
123

  
124
		# the tests dir needs to be build now because since commit
125
		# 7ff3c6df80185e165e3bf6aa31bd014d1f8bf224 tests/gtkgears.o needs to be there
126
		# strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
169 127
	fi
170 128

  
171 129
	if ! use examples; then
172 130
		# don't waste time building demos
173 131
		strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
132
		strip_builddir SRC_SUBDIRS examples Makefile.{am,in}
174 133
	fi
175 134

  
176 135
	gnome2_src_prepare
177 136
}
178 137

  
179 138
multilib_src_configure() {
180
	[[ ${ABI} == ppc64 ]] && append-flags -mminimal-toc
181

  
182
	ECONF_SOURCE=${S} \
183
	gnome2_src_configure \
184
		$(usex aqua --with-gdktarget=quartz --with-gdktarget=x11) \
185
		$(usex aqua "" --with-xinput) \
186
		$(use_enable cups cups auto) \
187
		$(multilib_native_use_enable introspection) \
188
		$(use_enable xinerama) \
189
		--disable-papi \
190
		--enable-man \
191
		--with-xml-catalog="${EPREFIX}"/etc/xml/catalog \
139
	local myconf=(
140
		$(use_enable aqua quartz-backend)
141
		$(use_enable broadway broadway-backend)
142
		$(use_enable colord)
143
		$(use_enable cups cups auto)
144
		$(multilib_native_use_enable gtk-doc)
145
		$(multilib_native_use_enable introspection)
146
		$(use_enable sysprof profiler)
147
		$(use_enable wayland wayland-backend)
148
		$(use_enable X x11-backend)
149
		$(use_enable X xcomposite)
150
		$(use_enable X xdamage)
151
		$(use_enable X xfixes)
152
		$(use_enable X xkb)
153
		$(use_enable X xrandr)
154
		$(use_enable xinerama)
155
		# cloudprovider is not packaged in Gentoo yet
156
		--disable-cloudproviders
157
		--disable-papi
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)
192 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[@]}"
193 177

  
194 178
	# work-around gtk-doc out-of-source brokedness
195 179
	if multilib_is_native_abi; then
......
201 185
}
202 186

  
203 187
multilib_src_test() {
204
	virtx emake check
188
	"${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
189
	GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
205 190
}
206 191

  
207 192
multilib_src_install() {
......
209 194
}
210 195

  
211 196
multilib_src_install_all() {
212
	# see bug #133241
213
	# Also set more default variables in sync with gtk3 and other distributions
214
	insinto /usr/share/gtk-2.0
215
	newins - gtkrc <<- 'EOF'
216
	gtk-fallback-icon-theme = "gnome"
217
	gtk-theme-name = "Adwaita"
218
	gtk-icon-theme-name = "Adwaita"
219
	gtk-cursor-theme-name = "Adwaita"
220
	EOF
221

  
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 )
222 201
	einstalldocs
223
	rm "${ED}"/usr/share/doc/${P}/ChangeLog # empty file
224

  
225
	# dev-util/gtk-builder-convert split off into a separate package, #402905
226
	rm "${ED}"/usr/bin/gtk-builder-convert || die
227
	rm "${ED}"/usr/share/man/man1/gtk-builder-convert.* || die
228

  
229
	readme.gentoo_create_doc
230 202
}
231 203

  
232 204
pkg_preinst() {
......
234 206

  
235 207
	multilib_pkg_preinst() {
236 208
		# Make immodules.cache belongs to gtk+ alone
237
		local cache="/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"
209
		local cache="/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
238 210

  
239
		if [[ -e "${EROOT}${cache}" ]]; then
211
		if [[ -e ${EROOT}${cache} ]]; then
240 212
			cp "${EROOT}${cache}" "${ED}${cache}" || die
241 213
		else
242 214
			touch "${ED}${cache}" || die
......
249 221
	gnome2_pkg_postinst
250 222

  
251 223
	multilib_pkg_postinst() {
252
		gnome2_query_immodules_gtk2 \
224
		gnome2_query_immodules_gtk3 \
253 225
			|| die "Update immodules cache failed (for ${ABI})"
254 226
	}
255 227
	multilib_parallel_foreach_abi multilib_pkg_postinst
256 228

  
257
	set_gtk2_confdir
258

  
259
	if [[ -e "${EROOT}/etc/gtk-2.0/gtk.immodules" ]]; then
260
		elog "File /etc/gtk-2.0/gtk.immodules has been moved to \$CHOST"
261
		elog "aware location. Removing deprecated file."
262
		rm -f "${EROOT}/etc/gtk-2.0/gtk.immodules"
263
	fi
264

  
265
	if [[ -e "${EROOT}${GTK2_CONFDIR}/gtk.immodules" ]]; then
266
		elog "File /etc/gtk-2.0/gtk.immodules has been moved to"
267
		elog "${EROOT}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"
268
		elog "Removing deprecated file."
269
		rm -f "${EROOT}${GTK2_CONFDIR}/gtk.immodules"
270
	fi
271

  
272
	# pixbufs are now handled by x11-libs/gdk-pixbuf
273
	if [[ -e "${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders" ]]; then
274
		elog "File ${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders is now handled by x11-libs/gdk-pixbuf"
275
		elog "Removing deprecated file."
276
		rm -f "${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders"
277
	fi
278

  
279
	# two checks needed since we dropped multilib conditional
280
	if [[ -e "${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders" ]]; then
281
		elog "File ${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders is now handled by x11-libs/gdk-pixbuf"
282
		elog "Removing deprecated file."
283
		rm -f "${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders"
284
	fi
285

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

  
292 229
	if ! has_version "app-text/evince"; then
293 230
		elog "Please install app-text/evince for print preview functionality."
294 231
		elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
295
		elog "add it to your gtkrc."
232
		elog "add it to your settings.ini file."
296 233
	fi
297

  
298
	readme.gentoo_print_elog
299 234
}
300 235

  
301 236
pkg_postrm() {
......
303 238

  
304 239
	if [[ -z ${REPLACED_BY_VERSION} ]]; then
305 240
		multilib_pkg_postrm() {
306
			rm -f "${EROOT}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"
241
			rm -f "${EROOT}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache"
307 242
		}
308 243
		multilib_foreach_abi multilib_pkg_postrm
309 244
	fi
Thank you!