blob: 77b6c31536b8144f67affe66b9b761171e647d0a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "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 = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 gdk-pixbuf-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
12
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check gobject-introspection
14
Brad Bishop19323692019-04-05 15:28:33 -040015BBCLASSEXTEND = "native nativesdk"
16
17GSETTINGS_PACKAGE_class-native = ""
18
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
24# This should be in autotools.bbclass, but until something elses uses it putting
25# it here avoids rebuilding everything.
26export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
27
28do_configure_prepend() {
29 # Do this because the configure script is running ./libtool directly
30 rm -f libtool
31 ln -s ${TARGET_PREFIX}libtool libtool
Patrick Williamsc0f7c042017-02-23 20:41:17 -060032 #delete a file that will get confused with generated one in ${B}
33 rm -f ${S}/gtk/gtktypefuncs.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034}
35
36EXTRA_OECONF += " \
37 --disable-glibtest \
38 --disable-xinerama \
39 --enable-modules \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040 --disable-colord \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060041 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \
42 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044do_compile_prepend() {
45 export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
46}
47
Brad Bishop6e60e8b2018-02-01 10:27:11 -050048PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
49 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
51PACKAGECONFIG[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 -060052# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
53PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050054PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060055PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/mesa wayland-native"
Brad Bishop19323692019-04-05 15:28:33 -040056PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057
Brad Bishop19323692019-04-05 15:28:33 -040058prepare_gtk_scripts() {
59 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080060
61 # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache
62 mkdir -p ${D}${libexecdir}
63 ln ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064}
65
Brad Bishop19323692019-04-05 15:28:33 -040066do_install_append_class-target() {
67 prepare_gtk_scripts
68}
69
70do_install_append_class-nativesdk() {
71 prepare_gtk_scripts
72}
73
74do_install_append_class-native() {
75 create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
76 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
77 create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
78 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
79}
80
81PROVIDES += "gtk-icon-utils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082PACKAGES =+ "${PN}-demo"
83LIBV = "3.0.0"
84
85FILES_${PN}-demo = "${bindir}/gtk3-demo \
86 ${bindir}/gtk3-demo-application \
87 ${bindir}/gtk3-icon-browser \
88 ${bindir}/gtk3-widget-factory \
89 ${datadir}/gtk-3.0/demo \
90 ${datadir}/applications/gtk3-demo.desktop \
91 ${datadir}/applications/gtk3-icon-browser.desktop \
92 ${datadir}/applications/gtk3-widget-factory.desktop \
93 ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
94 ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
95
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050096FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097 ${bindir}/gtk-query-immodules-3.0 \
98 ${bindir}/gtk-launch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099 ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
100 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
101 ${libdir}/gtk-3.0/modules/*.so"
102
103FILES_${PN}-dev += " \
104 ${datadir}/gtk-3.0/gtkbuilder.rng \
105 ${datadir}/gtk-3.0/include \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600106 ${datadir}/gettext/its \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107 ${libdir}/gtk-3.0/include \
108 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
109 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
110 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
111 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
112 ${libdir}/gtk-3.0/modules/*.la \
113 ${bindir}/gtk-builder-convert \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500114 ${bindir}/gtk-encode-symbolic-svg \
115 ${bindir}/gtk-builder-tool \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600116 ${bindir}/gtk-query-settings \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500117 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500118
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600119GTKBASE_RRECOMMENDS ?= "liberation-fonts \
120 gdk-pixbuf-loader-png \
121 gdk-pixbuf-loader-jpeg \
122 gdk-pixbuf-loader-gif \
123 gdk-pixbuf-loader-xpm \
124 shared-mime-info \
125 adwaita-icon-theme-symbolic \
126 "
Brad Bishop19323692019-04-05 15:28:33 -0400127
128GTKBASE_RRECOMMENDS_class-native ?= "\
129 "
130
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600131GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
132
133RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
134RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
135RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500136
137PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
138
139ALTERNATIVE_${PN} = "gtk-update-icon-cache"
140ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500141ALTERNATIVE_PRIORITY = "30"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500142
143python populate_packages_prepend () {
144 import os.path
145
146 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
147 immodules_root = os.path.join(gtk_libdir, 'immodules')
148 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
149
Brad Bishop19323692019-04-05 15:28:33 -0400150 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 -0500151 if immodules:
152 d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
153
Brad Bishop19323692019-04-05 15:28:33 -0400154 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500156 if (d.getVar('DEBIAN_NAMES')):
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500157 d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500158}