blob: 8d5edb7ee80177ed66c187c521a5a3a7dfb86ae3 [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
9DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010 gdk-pixbuf-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
12LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
13
Brad Bishop6dbb3162019-11-25 09:41:34 -050014inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings features_check gobject-introspection
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015
Brad Bishop19323692019-04-05 15:28:33 -040016BBCLASSEXTEND = "native nativesdk"
17
18GSETTINGS_PACKAGE_class-native = ""
19
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020# versions >= 3.90 are development versions, otherwise like upstream-version-is-even
21UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar"
22
Patrick Williamsf1e5d692016-03-30 15:21:19 -050023ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024
25# This should be in autotools.bbclass, but until something elses uses it putting
26# it here avoids rebuilding everything.
27export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
28
29do_configure_prepend() {
30 # Do this because the configure script is running ./libtool directly
31 rm -f libtool
32 ln -s ${TARGET_PREFIX}libtool libtool
Patrick Williamsc0f7c042017-02-23 20:41:17 -060033 #delete a file that will get confused with generated one in ${B}
34 rm -f ${S}/gtk/gtktypefuncs.c
Andrew Geissler475cb722020-07-10 16:00:51 -050035
36 # These files are generated by wayland-scanner but will race over modification
37 # time between the copies in the sysroot from wayland-protocols and the copy
38 # in the source tree. Solve the race by deleting so they need to be regenerated.
39 # 3.24.22 will not be shipping these files so this can be deleted then:
40 # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2183
41 rm -f ${S}/modules/input/text-input-unstable-v3*.[ch]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042}
43
44EXTRA_OECONF += " \
45 --disable-glibtest \
46 --disable-xinerama \
47 --enable-modules \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \
49 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050051do_compile_prepend() {
52 export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
53}
54
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
56 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050057PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
58PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059
60PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060061# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
62PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050063PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
Brad Bishopa34c0302019-09-23 22:34:48 -040064PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/egl virtual/libgles2 wayland-native"
Brad Bishop19323692019-04-05 15:28:33 -040065PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
Andrew Geissler82c905d2020-04-13 13:39:40 -050066PACKAGECONFIG[cloudprint] = "--enable-cloudprint,--disable-cloudprint,rest json-glib"
67PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
Brad Bishop19323692019-04-05 15:28:33 -040069prepare_gtk_scripts() {
70 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071
72 # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache
73 mkdir -p ${D}${libexecdir}
74 ln ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075}
76
Brad Bishop19323692019-04-05 15:28:33 -040077do_install_append_class-target() {
78 prepare_gtk_scripts
79}
80
81do_install_append_class-nativesdk() {
82 prepare_gtk_scripts
83}
84
85do_install_append_class-native() {
86 create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
87 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
88 create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
89 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
90}
91
92PROVIDES += "gtk-icon-utils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093PACKAGES =+ "${PN}-demo"
94LIBV = "3.0.0"
95
96FILES_${PN}-demo = "${bindir}/gtk3-demo \
97 ${bindir}/gtk3-demo-application \
98 ${bindir}/gtk3-icon-browser \
99 ${bindir}/gtk3-widget-factory \
100 ${datadir}/gtk-3.0/demo \
101 ${datadir}/applications/gtk3-demo.desktop \
102 ${datadir}/applications/gtk3-icon-browser.desktop \
103 ${datadir}/applications/gtk3-widget-factory.desktop \
104 ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
105 ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
106
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500107FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 ${bindir}/gtk-query-immodules-3.0 \
109 ${bindir}/gtk-launch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110 ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
111 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
112 ${libdir}/gtk-3.0/modules/*.so"
113
114FILES_${PN}-dev += " \
115 ${datadir}/gtk-3.0/gtkbuilder.rng \
116 ${datadir}/gtk-3.0/include \
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500117 ${datadir}/gtk-3.0/valgrind \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600118 ${datadir}/gettext/its \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500119 ${libdir}/gtk-3.0/include \
120 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
121 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
122 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
123 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
124 ${libdir}/gtk-3.0/modules/*.la \
125 ${bindir}/gtk-builder-convert \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500126 ${bindir}/gtk-encode-symbolic-svg \
127 ${bindir}/gtk-builder-tool \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600128 ${bindir}/gtk-query-settings \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500129 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600131GTKBASE_RRECOMMENDS ?= "liberation-fonts \
132 gdk-pixbuf-loader-png \
133 gdk-pixbuf-loader-jpeg \
134 gdk-pixbuf-loader-gif \
135 gdk-pixbuf-loader-xpm \
136 shared-mime-info \
137 adwaita-icon-theme-symbolic \
138 "
Brad Bishop19323692019-04-05 15:28:33 -0400139
140GTKBASE_RRECOMMENDS_class-native ?= "\
141 "
142
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600143GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
144
145RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
146RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
147RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500148
149PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
150
151ALTERNATIVE_${PN} = "gtk-update-icon-cache"
152ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500153ALTERNATIVE_PRIORITY = "30"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500154
155python populate_packages_prepend () {
156 import os.path
157
158 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
159 immodules_root = os.path.join(gtk_libdir, 'immodules')
160 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
161
Brad Bishop19323692019-04-05 15:28:33 -0400162 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 -0500163 if immodules:
164 d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
165
Brad Bishop19323692019-04-05 15:28:33 -0400166 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500168 if (d.getVar('DEBIAN_NAMES')):
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500169 d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500170}