blob: 61019051287fcc420ac99b11c2b13359f064c13d [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"
68PACKAGECONFIG[cups] = "-Dprint-cups=enabled,-Dprint-cups=disabled,cups"
69PACKAGECONFIG[colord] = "-Dcolord=enabled,-Dcolord=disabled,colord"
70PACKAGECONFIG[iso-codes] = ",,iso-codes,iso-codes"
71PACKAGECONFIG[ffmpeg] = "-Dmedia-ffmpeg=enabled,-Dmedia-ffmpeg=disabled,ffmpeg"
72# gtk4 wants gstreamer-player-1.0 -> gstreamer1.0-plugins-bad
73PACKAGECONFIG[gstreamer] = "-Dmedia-gstreamer=enabled,-Dmedia-gstreamer=disabled,gstreamer1.0-plugins-bad"
74PACKAGECONFIG[tracker] = "-Dtracker=enabled,-Dtracker=disabled,tracker,tracker-miners"
75PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled, vulkan-loader vulkan-headers shaderc-native"
76
77LIBV = "4.0.0"
78
79FILES:${PN}:append = " \
80 ${datadir}/glib-2.0/schemas/ \
81 ${datadir}/gtk-4.0/emoji/ \
82 ${datadir}/metainfo/ \
83 ${datadir}/icons/hicolor/*/apps/org.gtk.PrintEditor4*.* \
84 ${libdir}/gtk-4.0/${LIBV}/media \
85 ${bindir}/gtk4-update-icon-cache \
86 ${bindir}/gtk4-launch \
87"
88
89FILES:${PN}-dev += " \
90 ${datadir}/gtk-4.0/gtk4builder.rng \
91 ${datadir}/gtk-4.0/include \
92 ${datadir}/gtk-4.0/valgrind \
93 ${datadir}/gettext/its \
94 ${bindir}/gtk4-builder-tool \
95 ${bindir}/gtk4-encode-symbolic-svg \
96 ${bindir}/gtk4-query-settings \
97"
98
99GTKBASE_RRECOMMENDS ?= " \
100 liberation-fonts \
101 gdk-pixbuf-loader-png \
102 gdk-pixbuf-loader-jpeg \
103 gdk-pixbuf-loader-gif \
104 gdk-pixbuf-loader-xpm \
105 shared-mime-info \
106 adwaita-icon-theme-symbolic \
107"
108
109GTKBASE_RRECOMMENDS:class-native ?= ""
110
111GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
112
113RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}"
114RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
115RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
116
117PACKAGES_DYNAMIC += "^gtk4-printbackend-.*"
118python populate_packages:prepend () {
119 import os.path
120
121 gtk_libdir = d.expand('${libdir}/gtk-4.0/${LIBV}')
122 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
123
124 do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk4-printbackend-%s', 'GTK printbackend module for %s')
125
126 if (d.getVar('DEBIAN_NAMES')):
127 d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-4.0')
128}