blob: 8d01e6077fdc365c30d5c043c46d62cbc5a4da17 [file] [log] [blame]
Andrew Geissler475cb722020-07-10 16:00:51 -05001
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002SUMMARY = "Multi-platform toolkit for creating GUIs"
3DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
4set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
5HOMEPAGE = "http://www.gtk.org"
6BUGTRACKER = "https://bugzilla.gnome.org/"
7SECTION = "libs"
8
Andrew Geissler517393d2023-01-13 08:55:19 -06009DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf gdk-pixbuf-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000011LICENSE = "LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-or-later"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
Andrew Geissler517393d2023-01-13 08:55:19 -060013inherit meson gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings features_check gobject-introspection
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014
Brad Bishop19323692019-04-05 15:28:33 -040015BBCLASSEXTEND = "native nativesdk"
16
Patrick Williams213cb262021-08-07 19:21:33 -050017GSETTINGS_PACKAGE:class-native = ""
Brad Bishop19323692019-04-05 15:28:33 -040018
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019# versions >= 3.90 are development versions, otherwise like upstream-version-is-even
20UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar"
21
Patrick Williamsf1e5d692016-03-30 15:21:19 -050022ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023
Patrick Williams213cb262021-08-07 19:21:33 -050024do_configure:prepend() {
Andrew Geissler475cb722020-07-10 16:00:51 -050025 # These files are generated by wayland-scanner but will race over modification
26 # time between the copies in the sysroot from wayland-protocols and the copy
27 # in the source tree. Solve the race by deleting so they need to be regenerated.
Andrew Geissler517393d2023-01-13 08:55:19 -060028 rm -f ${S}/modules/input/*-text-input-*.[ch]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029}
30
Andrew Geissler517393d2023-01-13 08:55:19 -060031GTKDOC_MESON_OPTION = 'gtk_doc'
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032
Andrew Geissler517393d2023-01-13 08:55:19 -060033EXTRA_OEMESON = "-Dxinerama=no -Dtests=false"
34EXTRA_OEMESON:append:class-native = " -Ddemos=false -Dexamples=false"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050035
Andrew Geissler9aee5002022-03-30 16:27:02 +000036PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -050037PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
38PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Andrew Geissler517393d2023-01-13 08:55:19 -060040PACKAGECONFIG[x11] = "-Dx11_backend=true,-Dx11_backend=false,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060041# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
Andrew Geissler517393d2023-01-13 08:55:19 -060042PACKAGECONFIG[opengl] = "-Dopengl=true,-Dopengl=false,libepoxy"
43PACKAGECONFIG[wayland] = "-Dwayland_backend=true,-Dwayland_backend=false,wayland wayland-protocols libxkbcommon virtual/egl virtual/libgles2 wayland-native"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060044PACKAGECONFIG[cups] = ",,cups,cups"
Andrew Geissler517393d2023-01-13 08:55:19 -060045PACKAGECONFIG[colord] = "-Dcolord=yes,-Dcolord=no,colord"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060046PACKAGECONFIG[cloudproviders] = "-Dcloudproviders=true,-Dcloudproviders=false,libcloudproviders"
47PACKAGECONFIG[tracker3] = "-Dtracker3=true,-Dtracker3=false,tracker,tracker-miners"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048
Brad Bishop19323692019-04-05 15:28:33 -040049prepare_gtk_scripts() {
50 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051
52 # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache
53 mkdir -p ${D}${libexecdir}
54 ln ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055}
56
Patrick Williams213cb262021-08-07 19:21:33 -050057do_install:append:class-target() {
Brad Bishop19323692019-04-05 15:28:33 -040058 prepare_gtk_scripts
59}
60
Patrick Williams213cb262021-08-07 19:21:33 -050061do_install:append:class-nativesdk() {
Brad Bishop19323692019-04-05 15:28:33 -040062 prepare_gtk_scripts
63}
64
Patrick Williams213cb262021-08-07 19:21:33 -050065do_install:append:class-native() {
Brad Bishop19323692019-04-05 15:28:33 -040066 create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
67 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
68 create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
69 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
70}
71
72PROVIDES += "gtk-icon-utils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073PACKAGES =+ "${PN}-demo"
74LIBV = "3.0.0"
75
Patrick Williams213cb262021-08-07 19:21:33 -050076FILES:${PN}-demo = "${bindir}/gtk3-demo \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 ${bindir}/gtk3-demo-application \
78 ${bindir}/gtk3-icon-browser \
79 ${bindir}/gtk3-widget-factory \
80 ${datadir}/gtk-3.0/demo \
81 ${datadir}/applications/gtk3-demo.desktop \
82 ${datadir}/applications/gtk3-icon-browser.desktop \
83 ${datadir}/applications/gtk3-widget-factory.desktop \
84 ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
85 ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
86
Patrick Williams213cb262021-08-07 19:21:33 -050087FILES:${PN}:append = " ${bindir}/gtk-update-icon-cache-3.0 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088 ${bindir}/gtk-query-immodules-3.0 \
89 ${bindir}/gtk-launch \
Andrew Geissler517393d2023-01-13 08:55:19 -060090 ${datadir}/themes ${datadir}/gtk-3.0/emoji \
91 ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
93 ${libdir}/gtk-3.0/modules/*.so"
94
Patrick Williams213cb262021-08-07 19:21:33 -050095FILES:${PN}-dev += " \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096 ${datadir}/gtk-3.0/gtkbuilder.rng \
97 ${datadir}/gtk-3.0/include \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050098 ${datadir}/gtk-3.0/valgrind \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060099 ${datadir}/gettext/its \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100 ${libdir}/gtk-3.0/include \
101 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
102 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
103 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
104 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
105 ${libdir}/gtk-3.0/modules/*.la \
106 ${bindir}/gtk-builder-convert \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500107 ${bindir}/gtk-encode-symbolic-svg \
108 ${bindir}/gtk-builder-tool \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600109 ${bindir}/gtk-query-settings \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500110 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600112GTKBASE_RRECOMMENDS ?= "liberation-fonts \
113 gdk-pixbuf-loader-png \
114 gdk-pixbuf-loader-jpeg \
115 gdk-pixbuf-loader-gif \
116 gdk-pixbuf-loader-xpm \
117 shared-mime-info \
118 adwaita-icon-theme-symbolic \
119 "
Brad Bishop19323692019-04-05 15:28:33 -0400120
Patrick Williams213cb262021-08-07 19:21:33 -0500121GTKBASE_RRECOMMENDS:class-native ?= "\
Brad Bishop19323692019-04-05 15:28:33 -0400122 "
123
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600124GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
125
Patrick Williams213cb262021-08-07 19:21:33 -0500126RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}"
127RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
128RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129
130PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
131
Patrick Williams213cb262021-08-07 19:21:33 -0500132ALTERNATIVE:${PN} = "gtk-update-icon-cache"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500133ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500134ALTERNATIVE_PRIORITY = "30"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135
Patrick Williams213cb262021-08-07 19:21:33 -0500136python populate_packages:prepend () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 import os.path
138
139 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
140 immodules_root = os.path.join(gtk_libdir, 'immodules')
141 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
142
Brad Bishop19323692019-04-05 15:28:33 -0400143 immodules = do_split_packages(d, immodules_root, r'^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500144 if immodules:
145 d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
146
Brad Bishop19323692019-04-05 15:28:33 -0400147 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500148
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500149 if (d.getVar('DEBIAN_NAMES')):
Patrick Williams213cb262021-08-07 19:21:33 -0500150 d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-3.0')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151}