blob: dcebd0de5ada2a94be5c1f3b6595f1aa12470564 [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "Multi-platform toolkit for creating GUIs"
2DESCRIPTION = "GTK is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
3set of widgets, GTK is suitable for projects ranging from small one-off projects to complete application suites."
4HOMEPAGE = "http://www.gtk.org"
5BUGTRACKER = "https://bugzilla.gnome.org/"
6SECTION = "libs"
7
8DEPENDS = " \
9 sassc-native \
10 glib-2.0 \
11 libepoxy \
12 graphene \
13 cairo \
14 pango \
15 atk \
16 jpeg \
17 libpng \
Patrick Williams45852732022-04-02 08:58:32 -050018 librsvg \
19 tiff \
Andrew Geissler595f6302022-01-24 19:11:47 +000020 gdk-pixbuf-native gdk-pixbuf \
21"
22
23LICENSE = "LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-or-later"
24LIC_FILES_CHKSUM = " \
25 file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
26 file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
27 file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
28 file://tests/testgtk.c;endline=25;md5=49d06770681b8322466b52ed19d29fb2 \
29"
30
31MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
32
33UPSTREAM_CHECK_REGEX = "gtk-(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)\.tar.xz"
34
35SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk/${MAJ_VER}/gtk-${PV}.tar.xz"
Andrew Geissler615f2f12022-07-15 14:00:58 -050036SRC_URI[sha256sum] = "7bbfe4d13569f7c297ed49834ac7263e318b7bf102d3271cb466d5971f59ae70"
Andrew Geissler595f6302022-01-24 19:11:47 +000037
38S = "${WORKDIR}/gtk-${PV}"
39
40inherit meson gettext pkgconfig gtk-doc update-alternatives gsettings features_check gobject-introspection
41
42# TBD: nativesdk
43# gobject-introspection.bbclass pins introspection off for nativesk. As long as
44# we do not remove this wisdom or hack gtk4, it is not possible to build
45# nativesdk-gtk4
46BBCLASSEXTEND = "native"
47
48GSETTINGS_PACKAGE:class-native = ""
49
50ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
51REQUIRED_DISTRO_FEATURES = "opengl"
52
53GIR_MESON_ENABLE_FLAG = 'enabled'
54GIR_MESON_DISABLE_FLAG = 'disabled'
55GTKDOC_MESON_OPTION = 'gtk_doc'
56
Patrick Williams45852732022-04-02 08:58:32 -050057EXTRA_OEMESON = " -Dbuild-tests=false"
Andrew Geissler595f6302022-01-24 19:11:47 +000058
59PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
60PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
61PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
62
63PACKAGECONFIG[x11] = "-Dx11-backend=true,-Dx11-backend=false,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes xinerama"
64PACKAGECONFIG[wayland] = "-Dwayland-backend=true,-Dwayland-backend=false,wayland wayland-protocols libxkbcommon virtual/egl virtual/libgles2 wayland-native"
65PACKAGECONFIG[cups] = "-Dprint-cups=enabled,-Dprint-cups=disabled,cups"
66PACKAGECONFIG[colord] = "-Dcolord=enabled,-Dcolord=disabled,colord"
67# gtk4 wants gstreamer-player-1.0 -> gstreamer1.0-plugins-bad
68PACKAGECONFIG[gstreamer] = "-Dmedia-gstreamer=enabled,-Dmedia-gstreamer=disabled,gstreamer1.0-plugins-bad"
69PACKAGECONFIG[tracker] = "-Dtracker=enabled,-Dtracker=disabled,tracker"
70
71
72do_compile:prepend() {
73 export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
74}
75
76
77PACKAGES =+ "${PN}-demo"
78LIBV = "4.0.0"
79
80FILES:${PN}-demo = " \
81 ${datadir}/applications/org.gtk.Demo4.desktop \
82 ${datadir}/applications/org.gtk.IconBrowser4.desktop \
83 ${datadir}/applications/org.gtk.WidgetFactory4.desktop \
84 ${datadir}/icons/hicolor/*/apps/org.gtk.Demo4*.* \
85 ${datadir}/icons/hicolor/*/apps/org.gtk.IconBrowser4*.* \
86 ${datadir}/icons/hicolor/*/apps/org.gtk.WidgetFactory4*.* \
87 ${bindir}/gtk4-demo \
88 ${bindir}/gtk4-demo-application \
89 ${bindir}/gtk4-icon-browser \
90 ${bindir}/gtk4-widget-factory \
91"
92
93FILES:${PN}:append = " \
94 ${datadir}/glib-2.0/schemas/ \
95 ${datadir}/gtk-4.0/emoji/ \
96 ${datadir}/metainfo/ \
97 ${datadir}/icons/hicolor/*/apps/org.gtk.PrintEditor4*.* \
98 ${libdir}/gtk-4.0/${LIBV}/printbackends \
99 ${bindir}/gtk4-update-icon-cache \
100 ${bindir}/gtk4-launch \
101"
102
103FILES:${PN}-dev += " \
104 ${datadir}/gtk-4.0/gtk4builder.rng \
105 ${datadir}/gtk-4.0/include \
106 ${datadir}/gtk-4.0/valgrind \
107 ${datadir}/gettext/its \
108 ${bindir}/gtk4-builder-tool \
109 ${bindir}/gtk4-encode-symbolic-svg \
110 ${bindir}/gtk4-query-settings \
111"
112
113GTKBASE_RRECOMMENDS ?= " \
114 liberation-fonts \
115 gdk-pixbuf-loader-png \
116 gdk-pixbuf-loader-jpeg \
117 gdk-pixbuf-loader-gif \
118 gdk-pixbuf-loader-xpm \
119 shared-mime-info \
120 adwaita-icon-theme-symbolic \
121"
122
123GTKBASE_RRECOMMENDS:class-native ?= ""
124
125GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
126
127RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}"
128RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
129RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
130
131PACKAGES_DYNAMIC += "^gtk4-printbackend-.*"
132python populate_packages:prepend () {
133 import os.path
134
135 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
136 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
137
138 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk4-printbackend-%s', 'GTK printbackend module for %s')
139
140 if (d.getVar('DEBIAN_NAMES')):
141 d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-4.0')
142}