blob: bd29300d50777d4f5c64284c9fa9993fc79fe626 [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 \
9 docbook-utils-native gdk-pixbuf-native libepoxy"
10
11LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
12
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013inherit autotools pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check upstream-version-is-even gobject-introspection
Patrick Williamsf1e5d692016-03-30 15:21:19 -050014ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
16# This should be in autotools.bbclass, but until something elses uses it putting
17# it here avoids rebuilding everything.
18export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
19
20do_configure_prepend() {
21 # Do this because the configure script is running ./libtool directly
22 rm -f libtool
23 ln -s ${TARGET_PREFIX}libtool libtool
24}
25
26EXTRA_OECONF += " \
27 --disable-glibtest \
28 --disable-xinerama \
29 --enable-modules \
30 --disable-cups \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050031 --disable-colord \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032"
33
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034do_compile_prepend() {
35 export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
36}
37
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050039 ${@bb.utils.contains("DISTRO_FEATURES", "opengl x11", "glx", "", d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}"
41
42PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050043PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland libxkbcommon virtual/mesa wayland-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
46do_install_append() {
47 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
48}
49
50PACKAGES =+ "${PN}-demo"
51LIBV = "3.0.0"
52
53FILES_${PN}-demo = "${bindir}/gtk3-demo \
54 ${bindir}/gtk3-demo-application \
55 ${bindir}/gtk3-icon-browser \
56 ${bindir}/gtk3-widget-factory \
57 ${datadir}/gtk-3.0/demo \
58 ${datadir}/applications/gtk3-demo.desktop \
59 ${datadir}/applications/gtk3-icon-browser.desktop \
60 ${datadir}/applications/gtk3-widget-factory.desktop \
61 ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
62 ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
63
64# The demo uses PNG files and mime type sniffing, so ensure that these
65# dependencies are present.
66RDEPENDS_${PN}-demo += "gdk-pixbuf-loader-png shared-mime-info"
67
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050068FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069 ${bindir}/gtk-query-immodules-3.0 \
70 ${bindir}/gtk-launch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
72 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
73 ${libdir}/gtk-3.0/modules/*.so"
74
75FILES_${PN}-dev += " \
76 ${datadir}/gtk-3.0/gtkbuilder.rng \
77 ${datadir}/gtk-3.0/include \
78 ${libdir}/gtk-3.0/include \
79 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
80 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
81 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
82 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
83 ${libdir}/gtk-3.0/modules/*.la \
84 ${bindir}/gtk-builder-convert \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050085 ${bindir}/gtk-encode-symbolic-svg \
86 ${bindir}/gtk-builder-tool \
87 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088
89RRECOMMENDS_${PN} = "adwaita-icon-theme-symbolic"
90
91PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
92
93ALTERNATIVE_${PN} = "gtk-update-icon-cache"
94ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050095ALTERNATIVE_PRIORITY = "30"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096
97python populate_packages_prepend () {
98 import os.path
99
100 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
101 immodules_root = os.path.join(gtk_libdir, 'immodules')
102 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
103
104 immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s')
105 if immodules:
106 d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
107
108 do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
109
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500110 if (d.getVar('DEBIAN_NAMES', True)):
111 d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112}
113