Diff gimp-3.0.6 with a gimp-9999

/usr/portage/media-gfx/gimp/gimp-9999.ebuild 2026-02-04 11:18:06.404204559 +0300
7 7
PYTHON_COMPAT=( python3_{11..14} )
8 8
VALA_USE_DEPEND=vapigen
9 9

  
10
inherit flag-o-matic lua-single meson python-single-r1 toolchain-funcs vala xdg
10
inherit bash-completion-r1 branding flag-o-matic lua-single meson python-single-r1 toolchain-funcs vala xdg
11 11

  
12 12
DESCRIPTION="GNU Image Manipulation Program"
13 13
HOMEPAGE="https://www.gimp.org/"
14
SRC_URI="mirror://gimp/v$(ver_cut 1-2)/${P}.tar.xz"
14

  
15
if [[ ${PV} == 9999 ]]; then
16
	inherit git-r3
17
	EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/gimp.git"
18

  
19
	MAJOR_VERSION="3"
20
else
21
	MY_PV="${PV/_rc/-RC}"
22
	MY_P="${PN}-${MY_PV}"
23
	SRC_URI="mirror://gimp/v$(ver_cut 1-2)/${MY_P}.tar.xz"
24
	S="${WORKDIR}/${MY_P}"
25

  
26
	MAJOR_VERSION="$(ver_cut 1)"
27

  
28
	# Dont keyword prereleases or unstable releases
29
	# https://gitlab.gnome.org/Infrastructure/gimp-web-devel/-/blob/testing/content/core/maintainer/versioning.md#software-version
30
	if ! [[ ${PV} =~ _rc ]] &&
31
		[[ $(( $(ver_cut 2) % 2 )) -eq 0 ]] &&
32
		[[ $(( $(ver_cut 3) % 2 )) -eq 0 ]]
33
	then
34
		KEYWORDS="~amd64 ~arm ~x86"
35
	fi
36
fi
15 37

  
16 38
LICENSE="GPL-3+ LGPL-3+"
17
SLOT="0/3"
18
KEYWORDS="amd64 ~arm ~arm64 ~loong ~ppc ppc64 x86"
39
SLOT="0/${MAJOR_VERSION}"
19 40

  
20
IUSE="X aalib alsa doc fits gnome heif javascript jpeg2k jpegxl lua mng openexr openmp postscript test udev unwind vala vector-icons wayland webp wmf xpm"
41
IUSE="X aalib alsa bash-completion doc fits gnome heif javascript jpeg2k jpegxl lua mng openexr openmp postscript test udev unwind vala vector-icons wayland webp wmf xpm"
21 42
REQUIRED_USE="
22 43
	${PYTHON_REQUIRED_USE}
23 44
	lua? ( ${LUA_REQUIRED_USE} )
24
	test? ( X )
25 45
	xpm? ( X )
26 46
"
27 47

  
28 48
RESTRICT="!test? ( test )"
29 49

  
30
# media-libs/{babl,gegl} are required to be built with USE="introspection"
31
# to fix the compilation checking of /usr/share/gir-1.0/{Babl-0.1gir,Gegl-0.4.gir}
50
# See libgimp_deps_table in libgimp/meson.build for introspection dependencies, bug #969449
32 51
COMMON_DEPEND="
33 52
	${PYTHON_DEPS}
34 53
	$(python_gen_cond_dep '
35 54
		>=dev-python/pygobject-3.0:3[${PYTHON_USEDEP}]
36 55
	')
37
	>=app-accessibility/at-spi2-core-2.46.0
56
	>=app-accessibility/at-spi2-core-2.4.0
38 57
	app-arch/bzip2
39 58
	app-arch/libarchive:=
40 59
	>=app-arch/xz-utils-5.0.0
41
	>=app-text/poppler-0.90.1[cairo]
60
	app-text/iso-codes
61
	>=app-text/poppler-0.69.0[cairo]
42 62
	>=app-text/poppler-data-0.4.9
43 63
	>=dev-libs/appstream-0.16.1:=
44
	>=dev-libs/glib-2.70.0:2
64
	>=dev-libs/glib-2.70.0:2[introspection]
45 65
	>=dev-libs/gobject-introspection-1.82.0-r2
46
	>=dev-libs/json-glib-1.4.4
66
	>=dev-libs/json-glib-1.2.6
47 67
	>=gnome-base/librsvg-2.40.6:2
48
	>=media-gfx/mypaint-brushes-1.3.1:1.0=
49
	>=media-libs/babl-0.1.114[introspection,lcms,vala?]
50
	>=media-libs/fontconfig-2.12.6
51
	>=media-libs/freetype-2.10.2
52
	>=media-libs/gegl-0.4.62:0.4[cairo,introspection,lcms,vala?]
53
	<media-libs/gexiv2-0.15.0
54
	>=media-libs/gexiv2-0.14.0
55
	>=media-libs/harfbuzz-2.6.5:=
56
	>=media-libs/lcms-2.13.1:2
68
	>=media-gfx/exiv2-0.27.4
69
	media-gfx/mypaint-brushes:2.0=
70
	>=media-libs/fontconfig-2.12.4
71
	>=media-libs/freetype-2.1.7
72
	<media-libs/gexiv2-0.15.0[introspection]
73
	>=media-libs/gexiv2-0.14.0[introspection]
74
	>=media-libs/harfbuzz-2.8.2:=
75
	>=media-libs/lcms-2.8:2
57 76
	media-libs/libjpeg-turbo:=
58
	>=media-libs/libmypaint-1.6.1:=
59
	>=media-libs/libpng-1.6.37:0=
60
	>=media-libs/tiff-4.1.0:=
77
	>=media-libs/libmypaint-1.5.0:=
78
	>=media-libs/libpng-1.6.25:0=
79
	>=media-libs/tiff-4.0.0:=
61 80
	net-libs/glib-networking[ssl]
62 81
	virtual/zlib:=
63
	>=x11-libs/cairo-1.16.0[X?]
64
	>=x11-libs/gdk-pixbuf-2.40.0:2[introspection]
65
	>=x11-libs/gtk+-3.24.48:3[introspection,wayland?,X?]
66
	>=x11-libs/pango-1.50.0[X?]
82
	>=x11-libs/cairo-1.14.0[introspection(+),X?]
83
	>=x11-libs/gdk-pixbuf-2.30.8:2[introspection]
84
	>=x11-libs/gtk+-3.24.0:3[introspection,wayland?,X?]
85
	>=x11-libs/pango-1.50.0[introspection,X?]
67 86
	aalib? ( media-libs/aalib )
68 87
	alsa? ( >=media-libs/alsa-lib-1.0.0 )
69 88
	fits? ( sci-libs/cfitsio:= )
70
	heif? ( >=media-libs/libheif-1.13.0:= )
89
	heif? ( >=media-libs/libheif-1.15.1:= )
71 90
	javascript? ( dev-libs/gjs )
72
	jpeg2k? ( >=media-libs/openjpeg-2.3.1:2= )
73
	jpegxl? ( >=media-libs/libjxl-0.6.1:= )
91
	jpeg2k? ( >=media-libs/openjpeg-2.1.0:2= )
92
	jpegxl? ( >=media-libs/libjxl-0.7.0:= )
74 93
	lua? (
75 94
		${LUA_DEPS}
76 95
		$(lua_gen_cond_dep '
......
78 97
		')
79 98
	)
80 99
	mng? ( media-libs/libmng:= )
81
	openexr? ( >=media-libs/openexr-2.3.0:= )
100
	openexr? ( >=media-libs/openexr-1.6.1:= )
82 101
	postscript? ( app-text/ghostscript-gpl:= )
83 102
	udev? ( >=dev-libs/libgudev-167:= )
84 103
	unwind? ( >=sys-libs/libunwind-1.1.0:= )
......
93 112
	)
94 113
	xpm? ( x11-libs/libXpm )
95 114
"
115
if [[ ${PV} == 9999 ]]; then
116
	COMMON_DEPEND+="
117
		>=media-libs/babl-9999[introspection,lcms,vala?]
118
		>=media-libs/gegl-9999[cairo,introspection,lcms,vala?]
119
	"
120
else
121
	COMMON_DEPEND+="
122
		>=media-libs/babl-0.1.118[introspection,lcms,vala?]
123
		>=media-libs/gegl-0.4.66:0.4[cairo,introspection,lcms,vala?]
124
	"
125
fi
96 126

  
97 127
RDEPEND="
98 128
	${COMMON_DEPEND}
......
100 130
	gnome? ( gnome-base/gvfs )
101 131
"
102 132

  
103
DEPEND="
104
	${COMMON_DEPEND}
105
	test? (
106
		sys-apps/dbus
107
		x11-misc/xvfb-run
108
	)
109
	vala? ( $(vala_depend) )
110
"
133
DEPEND="${COMMON_DEPEND}"
111 134

  
112
# TODO: there are probably more atoms in DEPEND which should be in BDEPEND now
113 135
BDEPEND="
114 136
	>=dev-lang/perl-5.30.3
115 137
	dev-libs/libxslt
116 138
	>=dev-util/gdbus-codegen-2.80.5-r1
117 139
	>=sys-devel/gettext-0.21
140
	virtual/pkgconfig
141
	bash-completion? (
142
		app-shells/bash-completion
143
		app-shells/bash
144
	)
118 145
	doc? (
119 146
		>=dev-libs/gobject-introspection-1.82.0-r2[doctool]
120 147
		dev-util/gi-docgen
121 148
	)
122
	virtual/pkgconfig
149
	vala? ( $(vala_depend) )
150
	vector-icons? ( x11-misc/shared-mime-info )
123 151
"
152
#	X? ( test? (
153
#		sys-apps/dbus
154
#		x11-misc/xvfb-run
155
#	) )
124 156

  
125 157
DOCS=( "AUTHORS" "NEWS" "README" "README.i18n" )
126 158

  
127
PATCHES=(
128
	"${FILESDIR}"/gimp-3.0.6-fix-tests.patch
129
	"${FILESDIR}"/gimp-3.0.6-respect-NM.patch
130
)
131

  
132 159
pkg_pretend() {
133 160
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
134 161
}
......
137 164
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
138 165
	python-single-r1_pkg_setup
139 166
	use lua && lua-single_pkg_setup
167

  
168
	if has_version ">=media-libs/babl-9999" || has_version ">=media-libs/gegl-9999"; then
169
		ewarn "Please make sure to rebuild media-libs/babl-9999 and media-libs/gegl-9999 packages"
170
		ewarn "before building media-gfx/gimp-9999 to have their latest master branch versions."
171
	fi
140 172
}
141 173

  
142 174
src_prepare() {
......
152 184
	sed -i -e 's/@PYTHON_EXE@/'${EPYTHON}'/' plug-ins/python/pygimp.interp.in || die
153 185

  
154 186
	# Set proper intallation path of documentation logo
155
	sed -i -e "s/'gimp-@0@'.format(gimp_app_version)/'gimp-${PVR}'/" gimp-data/images/logo/meson.build || die
187
	sed -i -e "s/'gimp-' + gimp_api_version/'gimp-${PVR}'/" gimp-data/images/logo/meson.build || die
156 188

  
157 189
	# Force disable x11_target if USE="-X" is setup. See bug 943164 for additional info
158 190
	use !X && { sed -i -e 's/x11_target = /x11_target = false #/' meson.build || die; }
......
172 204
		-Ddebug-self-in-build=false
173 205
		-Denable-multiproc=true
174 206
		-Dappdata-test=disabled
175
		-Dbug-report-url=https://bugs.gentoo.org/
207
		-Dbug-report-url="${BRANDING_OS_BUG_REPORT_URL}"
176 208
		-Dilbm=disabled
177 209
		-Dlibbacktrace=false
178 210
		-Dwebkit-unmaintained=false
179 211
		$(meson_feature aalib aa)
180 212
		$(meson_feature alsa)
213
		$(meson_feature bash-completion)
181 214
		$(meson_feature doc gi-docgen)
182 215
		$(meson_feature fits)
183 216
		$(meson_feature heif)
......
188 221
		$(meson_feature openexr)
189 222
		$(meson_feature openmp)
190 223
		$(meson_feature postscript ghostscript)
191
		$(meson_feature test headless-tests)
224
		# https://gitlab.gnome.org/GNOME/gimp/-/issues/15763
225
		-Dheadless-tests=disabled
226
		#$(usex X $(meson_feature test headless-tests) -Dheadless-tests=disabled )
192 227
		$(meson_feature udev gudev)
193 228
		$(meson_feature vala)
194 229
		$(meson_feature webp)
......
228 263

  
229 264
src_test() {
230 265
	local -x LD_LIBRARY_PATH="${BUILD_DIR}/libgimp:${LD_LIBRARY_PATH}"
266

  
231 267
	# Try hard to avoid system installed gimp causing issues
232 268
	local -x GIMP3_DIRECTORY="${BUILD_DIR}/"
233 269
	local -x GIMP3_PLUGINDIR="${BUILD_DIR}/plug-ins/"
234 270
	local -x GIMP3_SYSCONFDIR="${BUILD_DIR}/etc/"
235
	meson_src_test
271

  
272
	# Flakyness is possible
273
	meson_src_test -j1
236 274
}
237 275

  
238 276
src_install() {
......
242 280
	python_fix_shebang "${ED}/usr/$(get_libdir)/gimp"
243 281

  
244 282
	# Create symlinks for Gimp exec in /usr/bin
245
	dosym "${ESYSROOT}"/usr/bin/gimp-3.0 /usr/bin/gimp
246
	dosym "${ESYSROOT}"/usr/bin/gimp-console-3.0 /usr/bin/gimp-console
247
	dosym "${ESYSROOT}"/usr/bin/gimp-script-fu-interpreter-3.0 /usr/bin/gimp-script-fu-interpreter
248
	dosym "${ESYSROOT}"/usr/bin/gimp-test-clipboard-3.0 /usr/bin/gimp-test-clipboard
249
	dosym "${ESYSROOT}"/usr/bin/gimptool-3.0 /usr/bin/gimptool
283
	# gimp-$(ver_cut 1-2) -> gimp-$(ver_cut 1) -> gimp
284
	dosym "${ESYSROOT}"/usr/bin/gimp-${MAJOR_VERSION} /usr/bin/gimp
285
	dosym "${ESYSROOT}"/usr/bin/gimp-console-${MAJOR_VERSION} /usr/bin/gimp-console
286
	dosym "${ESYSROOT}"/usr/bin/gimp-script-fu-interpreter-${MAJOR_VERSION} /usr/bin/gimp-script-fu-interpreter
287
	dosym "${ESYSROOT}"/usr/bin/gimp-test-clipboard-${MAJOR_VERSION} /usr/bin/gimp-test-clipboard
288
	dosym "${ESYSROOT}"/usr/bin/gimptool-${MAJOR_VERSION} /usr/bin/gimptool
289

  
290
	if use bash-completion; then
291
		bashcomp_alias gimp-3.0 gimp{,-3} gimp-console{,-3,-3.0}
292
	fi
250 293

  
251 294
	_rename_plugins || die
252 295
}
253

  
254
pkg_postinst() {
255
	xdg_pkg_postinst
256
}
257

  
258
pkg_postrm() {
259
	xdg_pkg_postrm
260
}
Thank you!