1 |
# enable_gtkdoc: Toggle if gtk-doc files should be rebuilt. |
2 |
# 0 = no |
3 |
# 1 = yes |
4 |
%define enable_gtkdoc 0 |
5 |
|
6 |
# enable_bootstrap: Toggle if bootstrapping package |
7 |
# 0 = no |
8 |
# 1 = yes |
9 |
%define enable_bootstrap 0 |
10 |
|
11 |
# enable_tests: Run test suite in build |
12 |
# 0 = no |
13 |
# 1 = yes |
14 |
%define enable_tests 0 |
15 |
|
16 |
%{?_without_gtkdoc: %{expand: %%define enable_gtkdoc 0}} |
17 |
%{?_without_bootstrap: %{expand: %%define enable_bootstrap 0}} |
18 |
%{?_without_tests: %{expand: %%define enable_tests 0}} |
19 |
|
20 |
%{?_with_gtkdoc: %{expand: %%define enable_gtkdoc 1}} |
21 |
%{?_with_bootstrap: %{expand: %%define enable_bootstrap 1}} |
22 |
%{?_with_tests: %{expand: %%define enable_tests 1}} |
23 |
|
24 |
# required version of various libraries |
25 |
%global glib2_version 2.66.0 |
26 |
%global pango_version 1.47.0 |
27 |
%global atk_version 2.15.1 |
28 |
%global cairo_version 1.14.0 |
29 |
%global gdk_pixbuf_version 2.30.0 |
30 |
%global wayland_protocols_version 1.20 |
31 |
%global wayland_version 1.14.91 |
32 |
|
33 |
|
34 |
%define pkgname gtk |
35 |
%define api 4 |
36 |
%define api_version 4.0 |
37 |
%define binary_version 4.0.0 |
38 |
%define lib_major 1 |
39 |
%define libname %mklibname %{pkgname} %{api} %{lib_major} |
40 |
%define girname %mklibname gtk-gir %{api_version} |
41 |
%define develname %mklibname -d %{pkgname} %{api_version} |
42 |
|
43 |
%define url_ver %(echo %{version}|cut -d. -f1,2) |
44 |
|
45 |
# "fix" underlinking: |
46 |
%define _disable_ld_no_undefined 1 |
47 |
|
48 |
|
49 |
Name: %{pkgname}%{api_version} |
50 |
Version: 4.1.1 |
51 |
Release: %mkrel 1 |
52 |
Summary: GTK graphical user interface library |
53 |
License: LGPLv2+ |
54 |
Group: System/Libraries |
55 |
Source0: https://download.gnome.org/sources/%{pkgname}/%{url_ver}/%{pkgname}-%{version}.tar.xz |
56 |
# (tv) fix misplaced tooltips in drakx/installer (mga#11893, bgo#698730): |
57 |
Source1: 0001-tooltip-Fix-possibly-briefly-appearing-at-0x0.patch |
58 |
URL: https://www.gtk.org |
59 |
Requires: common-licenses |
60 |
BuildRequires: autoconf-archive |
61 |
BuildRequires: cups-devel |
62 |
BuildRequires: gettext-devel |
63 |
BuildRequires: git |
64 |
BuildRequires: gtk-doc |
65 |
BuildRequires: meson |
66 |
BuildRequires: pkgconfig(atk) >= %{atk_version} |
67 |
BuildRequires: pkgconfig(atk-bridge-2.0) |
68 |
BuildRequires: pkgconfig(avahi-gobject) |
69 |
BuildRequires: pkgconfig(cairo) >= %{cairo_version} |
70 |
BuildRequires: pkgconfig(cairo-gobject) >= %{cairo_version} |
71 |
BuildRequires: pkgconfig(colord) |
72 |
BuildRequires: pkgconfig(egl) |
73 |
BuildRequires: pkgconfig(epoxy) |
74 |
BuildRequires: pkgconfig(gdk-pixbuf-2.0) >= %{gdk_pixbuf_version} |
75 |
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} |
76 |
BuildRequires: pkgconfig(gobject-introspection-1.0) |
77 |
BuildRequires: pkgconfig(graphene-gobject-1.0) |
78 |
BuildRequires: pkgconfig(gstreamer-player-1.0) |
79 |
BuildRequires: pkgconfig(iso-codes) |
80 |
BuildRequires: pkgconfig(json-glib-1.0) |
81 |
BuildRequires: pkgconfig(pango) >= %{pango_version} |
82 |
BuildRequires: pkgconfig(rest-0.7) |
83 |
BuildRequires: pkgconfig(vulkan) |
84 |
BuildRequires: pkgconfig(wayland-client) >= %{wayland_version} |
85 |
BuildRequires: pkgconfig(wayland-cursor) >= %{wayland_version} |
86 |
BuildRequires: pkgconfig(wayland-egl) >= %{wayland_version} |
87 |
BuildRequires: pkgconfig(wayland-protocols) >= %{wayland_protocols_version} |
88 |
BuildRequires: pkgconfig(xcomposite) |
89 |
BuildRequires: pkgconfig(xcursor) |
90 |
BuildRequires: pkgconfig(xdamage) |
91 |
BuildRequires: pkgconfig(xfixes) |
92 |
BuildRequires: pkgconfig(xi) |
93 |
BuildRequires: pkgconfig(xinerama) |
94 |
BuildRequires: pkgconfig(xkbcommon) |
95 |
BuildRequires: pkgconfig(xrandr) |
96 |
BuildRequires: pkgconfig(xrender) |
97 |
BuildRequires: sassc |
98 |
%rename gtk+4.0 |
99 |
|
100 |
%if %enable_tests |
101 |
BuildRequires: x11-server-xvfb |
102 |
%endif |
103 |
|
104 |
%if %enable_gtkdoc |
105 |
BuildRequires: gtk-doc >= 1.99 |
106 |
BuildRequires: sgml-tools |
107 |
BuildRequires: texinfo |
108 |
%endif |
109 |
|
110 |
# gw tests will fail without this |
111 |
BuildRequires: fonts-ttf-dejavu |
112 |
|
113 |
%if !%{enable_bootstrap} |
114 |
Recommends: xdg-user-dirs-gtk |
115 |
%endif |
116 |
Recommends: %mklibname gvfs 0 |
117 |
|
118 |
Requires: %{libname} = %{version} |
119 |
Provides: %{pkgname}%{api} = %{version}-%{release} |
120 |
|
121 |
%description |
122 |
GTK is a multi-platform toolkit for creating graphical user |
123 |
interfaces. Offering a complete set of widgets, GTK is suitable for |
124 |
projects ranging from small one-off tools to complete application |
125 |
suites. |
126 |
|
127 |
This package contains version 4 of GTK. |
128 |
|
129 |
#-------------------------------------------------------------------- |
130 |
|
131 |
%package -n %{libname} |
132 |
Summary: %{summary} |
133 |
Group: %{group} |
134 |
Provides: lib%{pkgname}%{api} = %{version}-%{release} |
135 |
Provides: lib%{name} = %{version}-%{release} |
136 |
Requires: libglib2.0 >= %{glib2_version} |
137 |
Requires: libpango1.0 >= %{pango_version} |
138 |
Requires: libatk1.0 >= %{atk_version} |
139 |
Requires: gtk4.0 = %{version}-%{release} |
140 |
Requires: glib2.0-common |
141 |
Obsoletes: %{mklibname gtk+4.0 %{api} %{lib_major} } <= %{version}-%{release} |
142 |
Provides: %{mklibname gtk+4.0 %{api} %{lib_major} } = %{version}-%{release} |
143 |
|
144 |
# standard icons |
145 |
Requires: adwaita-icon-theme |
146 |
# required for icon theme apis to work |
147 |
Requires: hicolor-icon-theme |
148 |
|
149 |
Requires(posttrans): gtk4.0 |
150 |
Requires(posttrans): libmesagl >= 10.2.3-1 |
151 |
|
152 |
%description -n %{libname} |
153 |
This package contains the library needed to run programs dynamically |
154 |
linked with gtk. |
155 |
|
156 |
#-------------------------------------------------------------------- |
157 |
|
158 |
%package -n %{girname} |
159 |
Summary: GObject introspection interface library for %{name} |
160 |
Group: System/Libraries |
161 |
Requires: %{libname} = %{version}-%{release} |
162 |
|
163 |
%description -n %{girname} |
164 |
GObject introspection interface library for %{name}. |
165 |
|
166 |
#-------------------------------------------------------------------- |
167 |
|
168 |
%package -n %{develname} |
169 |
Summary: Development files for GTK |
170 |
Group: Development/GNOME and GTK+ |
171 |
Provides: %{pkgname}%{api}-devel = %{version}-%{release} |
172 |
Provides: lib%{pkgname}%{api}-devel = %{version}-%{release} |
173 |
Provides: lib%{pkgname}%{api_version}-devel = %{version}-%{release} |
174 |
Provides: lib%{pkgname}-x11-%{api_version}-devel = %{version}-%{release} |
175 |
Provides: %{name}-devel = %{version}-%{release} |
176 |
Provides: gtk4-devel = %{version}-%{release} |
177 |
Requires: %{libname} = %{version} |
178 |
Requires: %{girname} = %{version} |
179 |
Requires: libgdk_pixbuf2.0-devel >= %gdk_pixbuf_version |
180 |
Requires: libatk1.0-devel >= %{atk_version} |
181 |
Requires: libpango1.0-devel >= %{pango_version} |
182 |
|
183 |
%description -n %{develname} |
184 |
This package contains the libraries and header files that are needed |
185 |
for writing applications with version 4 of the GTK widget toolkit. |
186 |
|
187 |
#-------------------------------------------------------------------- |
188 |
|
189 |
%prep |
190 |
%autosetup -p1 -n gtk-%{version} |
191 |
|
192 |
# (ovitters) prevent subprojects from being used, caused an issue with gtk-doc |
193 |
# https://gitlab.gnome.org/GNOME/gtk/-/issues/3219 |
194 |
rm -rf subprojects |
195 |
|
196 |
%build |
197 |
export CFLAGS='-fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT %optflags' |
198 |
%meson \ |
199 |
-Dx11-backend=true \ |
200 |
-Dwayland-backend=true \ |
201 |
-Dbroadway-backend=true \ |
202 |
-Dmedia-ffmpeg=disabled \ |
203 |
-Dmedia-gstreamer=enabled \ |
204 |
-Dxinerama=enabled \ |
205 |
-Dcolord=enabled \ |
206 |
-Dgtk_doc=false \ |
207 |
-Dman-pages=true \ |
208 |
-Dinstall-tests=false |
209 |
|
210 |
%meson_build |
211 |
|
212 |
%install |
213 |
%meson_install |
214 |
|
215 |
%find_lang gtk40 |
216 |
%find_lang gtk40-properties |
217 |
|
218 |
mkdir -p $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/modules |
219 |
|
220 |
# Adwaita is the default theme but it's not installed and neither was |
221 |
# Raleigh before it as far as I can tell. |
222 |
# Most of this is compiled into GTK binaries but it causes the theme not to be |
223 |
# "seen" by theme choosers - e.g. gnome-tweak-tool, so you cannot switch from |
224 |
# e.g. oxygen-gtk (the Mageia default) to Adwaita (the upstream default) without |
225 |
# these files in place or a fix to gnome-tweak-tool and other theme choosers to |
226 |
# hard-code Adwaita. |
227 |
# See https://bugzilla.gnome.org/show_bug.cgi?id=733420 |
228 |
mkdir -p %{buildroot}%{_datadir}/themes/Adwaita/gtk-4.0 |
229 |
cp -a gtk/theme/Adwaita/gtk{,-dark}.css %{buildroot}%{_datadir}/themes/Adwaita/gtk-4.0 |
230 |
|
231 |
%check |
232 |
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop |
233 |
%if %enable_tests |
234 |
XDISPLAY=$(i=1; while [ -f /tmp/.X$i-lock ]; do i=$(($i+1)); done; echo $i) |
235 |
%{_bindir}/Xvfb :$XDISPLAY & |
236 |
export DISPLAY=:$XDISPLAY |
237 |
make check |
238 |
kill $(cat /tmp/.X$XDISPLAY-lock) ||: |
239 |
%endif |
240 |
|
241 |
%files -f gtk40.lang -f gtk40-properties.lang |
242 |
%doc README.md |
243 |
%{_bindir}/gtk4-query-settings |
244 |
%{_bindir}/gtk4-launch |
245 |
%{_bindir}/gtk4-update-icon-cache |
246 |
%{_mandir}/man1/gtk4-launch.1* |
247 |
%{_mandir}/man1/gtk4-update-icon-cache.1* |
248 |
%{_datadir}/themes |
249 |
%{_datadir}/glib-2.0/schemas/org.gtk.gtk4.Settings.ColorChooser.gschema.xml |
250 |
%{_datadir}/glib-2.0/schemas/org.gtk.gtk4.Settings.Debug.gschema.xml |
251 |
%{_datadir}/glib-2.0/schemas/org.gtk.gtk4.Settings.EmojiChooser.gschema.xml |
252 |
%{_datadir}/glib-2.0/schemas/org.gtk.gtk4.Settings.FileChooser.gschema.xml |
253 |
%{_datadir}/gtk-%{api_version}/emoji/*.gresource |
254 |
%{_bindir}/gtk4-broadwayd |
255 |
%{_mandir}/man1/gtk4-broadwayd.1* |
256 |
|
257 |
%files -n %{libname} |
258 |
%doc README.md |
259 |
%dir %{_libdir}/gtk-%{api_version} |
260 |
%dir %{_libdir}/gtk-%{api_version}/modules |
261 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version} |
262 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}/printbackends |
263 |
%{_libdir}/gtk-%{api_version}/%{binary_version}/printbackends/*.so |
264 |
%{_libdir}/libgtk-4.so.%{lib_major}.* |
265 |
%{_libdir}/libgtk-4.so.%{lib_major} |
266 |
%{_libdir}/gtk-%{api_version}/%{binary_version}/media/libmedia-gstreamer.so |
267 |
|
268 |
%files -n %{girname} |
269 |
%{_libdir}/girepository-1.0/Gdk-%{api_version}.typelib |
270 |
%{_libdir}/girepository-1.0/GdkX11-%{api_version}.typelib |
271 |
%{_libdir}/girepository-1.0/GdkWayland-%{api_version}.typelib |
272 |
%{_libdir}/girepository-1.0/Gsk-%{api_version}.typelib |
273 |
%{_libdir}/girepository-1.0/Gtk-%{api_version}.typelib |
274 |
|
275 |
%files -n %{develname} |
276 |
%doc docs/*.txt AUTHORS NEWS README.md |
277 |
%{_includedir}/* |
278 |
%{_libdir}/pkgconfig/* |
279 |
%{_bindir}/gtk4-builder-tool |
280 |
%{_bindir}/gtk4-demo |
281 |
%{_bindir}/gtk4-demo-application |
282 |
%{_bindir}/gtk4-encode-symbolic-svg |
283 |
%{_bindir}/gtk4-icon-browser |
284 |
%{_bindir}/gtk4-print-editor |
285 |
%{_bindir}/gtk4-widget-factory |
286 |
%{_libdir}/libgtk-%{api}.so |
287 |
%{_datadir}/applications/org.gtk.Demo4.desktop |
288 |
%{_datadir}/applications/org.gtk.IconBrowser4.desktop |
289 |
%{_datadir}/applications/org.gtk.PrintEditor4.desktop |
290 |
%{_datadir}/applications/org.gtk.WidgetFactory4.desktop |
291 |
%{_datadir}/icons/hicolor/*/apps/org.gtk.Demo4*.svg |
292 |
%{_datadir}/icons/hicolor/*/apps/org.gtk.IconBrowser4*.svg |
293 |
%{_datadir}/icons/hicolor/*/apps/org.gtk.PrintEditor4*.svg |
294 |
%{_datadir}/icons/hicolor/*/apps/org.gtk.WidgetFactory4*.svg |
295 |
%{_datadir}/gettext/ |
296 |
%{_datadir}/gir-1.0 |
297 |
%{_datadir}/glib-2.0/schemas/org.gtk.Demo4.gschema.xml |
298 |
%dir %{_datadir}/gtk-4.0 |
299 |
%{_datadir}/gtk-4.0/gtk4builder.rng |
300 |
%{_datadir}/gtk-4.0/valgrind/ |
301 |
%{_datadir}/metainfo/org.gtk.Demo4.appdata.xml |
302 |
%{_datadir}/metainfo/org.gtk.IconBrowser4.appdata.xml |
303 |
%{_datadir}/metainfo/org.gtk.PrintEditor4.appdata.xml |
304 |
%{_datadir}/metainfo/org.gtk.WidgetFactory4.appdata.xml |
305 |
%{_mandir}/man1/gtk4-builder-tool.1* |
306 |
%{_mandir}/man1/gtk4-demo.1* |
307 |
%{_mandir}/man1/gtk4-demo-application.1* |
308 |
%{_mandir}/man1/gtk4-encode-symbolic-svg.1* |
309 |
%{_mandir}/man1/gtk4-icon-browser.1* |
310 |
%{_mandir}/man1/gtk4-query-settings.1* |
311 |
%{_mandir}/man1/gtk4-widget-factory.1* |