blob: b367cb066b3cd4e43a47350db9926f02bce95583 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "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 atk \
10 cairo \
11 fribidi \
12 gdk-pixbuf \
13 gdk-pixbuf-native \
14 gi-docgen \
15 glib-2.0 \
16 graphene \
17 harfbuzz \
18 jpeg \
19 libepoxy \
20 libpng \
21 librsvg \
22 libxkbcommon \
23 pango \
24 tiff \
25"
26
27LICENSE = "LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-or-later"
28LIC_FILES_CHKSUM = " \
29 file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
30 file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
31 file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
32 file://tests/testgtk.c;endline=25;md5=49d06770681b8322466b52ed19d29fb2 \
33"
34
35MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
36
37UPSTREAM_CHECK_REGEX = "gtk-(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)\.tar.xz"
38
39SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk/${MAJ_VER}/gtk-${PV}.tar.xz"
40SRC_URI[sha256sum] = "b362f968d085b4d3d9340d4d38c706377ded9d5374e694a2b6b7e6292e3cba74"
41
42S = "${WORKDIR}/gtk-${PV}"
43
44inherit meson gettext pkgconfig gi-docgen update-alternatives gsettings features_check gobject-introspection
45
46# TBD: nativesdk
47# gobject-introspection.bbclass pins introspection off for nativesk. As long as
48# we do not remove this wisdom or hack gtk4, it is not possible to build
49# nativesdk-gtk4
50BBCLASSEXTEND = "native"
51
52GSETTINGS_PACKAGE:class-native = ""
53
54ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
55REQUIRED_DISTRO_FEATURES = "opengl"
56GTKDOC_MESON_OPTION = "gtk_doc"
57GIR_MESON_ENABLE_FLAG = 'enabled'
58GIR_MESON_DISABLE_FLAG = 'disabled'
59
60EXTRA_OEMESON = " -Dbuild-tests=false -Ddemos=false"
61
62PACKAGECONFIG ??= "gstreamer ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11 vulkan', d)}"
63PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
64PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
65
66PACKAGECONFIG[x11] = "-Dx11-backend=true,-Dx11-backend=false,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes xinerama"
67PACKAGECONFIG[wayland] = "-Dwayland-backend=true,-Dwayland-backend=false,wayland wayland-protocols virtual/egl virtual/libgles2 wayland-native"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060068PACKAGECONFIG[cloudproviders] = "-Dcloudproviders=enabled,-Dcloudproviders=disabled,libcloudproviders"
69PACKAGECONFIG[cups] = "-Dprint-cups=enabled,-Dprint-cups=disabled,cups,cups"
Andrew Geissler517393d2023-01-13 08:55:19 -060070PACKAGECONFIG[colord] = "-Dcolord=enabled,-Dcolord=disabled,colord"
71PACKAGECONFIG[iso-codes] = ",,iso-codes,iso-codes"
72PACKAGECONFIG[ffmpeg] = "-Dmedia-ffmpeg=enabled,-Dmedia-ffmpeg=disabled,ffmpeg"
73# gtk4 wants gstreamer-player-1.0 -> gstreamer1.0-plugins-bad
74PACKAGECONFIG[gstreamer] = "-Dmedia-gstreamer=enabled,-Dmedia-gstreamer=disabled,gstreamer1.0-plugins-bad"
75PACKAGECONFIG[tracker] = "-Dtracker=enabled,-Dtracker=disabled,tracker,tracker-miners"
76PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled, vulkan-loader vulkan-headers shaderc-native"
77
78LIBV = "4.0.0"
79
80FILES:${PN}:append = " \
81 ${datadir}/glib-2.0/schemas/ \
82 ${datadir}/gtk-4.0/emoji/ \
83 ${datadir}/metainfo/ \
84 ${datadir}/icons/hicolor/*/apps/org.gtk.PrintEditor4*.* \
85 ${libdir}/gtk-4.0/${LIBV}/media \
86 ${bindir}/gtk4-update-icon-cache \
87 ${bindir}/gtk4-launch \
88"
89
90FILES:${PN}-dev += " \
91 ${datadir}/gtk-4.0/gtk4builder.rng \
92 ${datadir}/gtk-4.0/include \
93 ${datadir}/gtk-4.0/valgrind \
94 ${datadir}/gettext/its \
95 ${bindir}/gtk4-builder-tool \
96 ${bindir}/gtk4-encode-symbolic-svg \
97 ${bindir}/gtk4-query-settings \
98"
99
100GTKBASE_RRECOMMENDS ?= " \
101 liberation-fonts \
102 gdk-pixbuf-loader-png \
103 gdk-pixbuf-loader-jpeg \
104 gdk-pixbuf-loader-gif \
105 gdk-pixbuf-loader-xpm \
106 shared-mime-info \
107 adwaita-icon-theme-symbolic \
108"
109
110GTKBASE_RRECOMMENDS:class-native ?= ""
111
112GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
113
114RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}"
115RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
116RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
117
118PACKAGES_DYNAMIC += "^gtk4-printbackend-.*"
119python populate_packages:prepend () {
120 import os.path
121
122 gtk_libdir = d.expand('${libdir}/gtk-4.0/${LIBV}')
123 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
124
125 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk4-printbackend-%s', 'GTK printbackend module for %s')
126
127 if (d.getVar('DEBIAN_NAMES')):
128 d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-4.0')
129}