From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- poky/meta/recipes-gnome/gtk+/gtk+.inc | 103 +++ poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch | 22 + .../gtk+/gtk+/hardcoded_libtool.patch | 36 + .../gtk+/gtk+/strict-prototypes.patch | 24 + poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff | 102 +++ poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch | 20 + poky/meta/recipes-gnome/gtk+/gtk+3.inc | 130 ++++ .../gtk+/gtk+3/0001-Hardcoded-libtool.patch | 47 ++ ...Do-not-try-to-initialize-GL-without-libGL.patch | 60 ++ .../0003-Add-disable-opengl-configure-option.patch | 847 +++++++++++++++++++++ poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb | 18 + poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb | 34 + .../gtk+/gtk-icon-utils-native_3.22.28.bb | 63 ++ ...k-dependency-from-gtk-encode-symbolic-svg.patch | 102 +++ 14 files changed, 1608 insertions(+) create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+.inc create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+3.inc create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb create mode 100644 poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb create mode 100644 poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb create mode 100644 poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch (limited to 'poky/meta/recipes-gnome/gtk+') diff --git a/poky/meta/recipes-gnome/gtk+/gtk+.inc b/poky/meta/recipes-gnome/gtk+/gtk+.inc new file mode 100644 index 0000000000..558bc485ad --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+.inc @@ -0,0 +1,103 @@ +SUMMARY = "Multi-platform toolkit for creating GUIs" +DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \ +set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites." +HOMEPAGE = "http://www.gtk.org" +BUGTRACKER = "https://bugzilla.gnome.org/" + +LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" + +LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7" + +SECTION = "libs" + +inherit distro_features_check +ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}" + +# This picks stable releases in the 2.x series (but not 2.90 onwards, +# which were GNOME 3 betas). +UPSTREAM_CHECK_REGEX = "(?P2\.([0-8]*[02468])+(\.\d+)+)" + +X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite" +DEPENDS = "glib-2.0 pango atk jpeg libpng gdk-pixbuf-native \ + cairo gdk-pixbuf" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb x11', d)}" + +PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}" +# without --with-gdktarget=directfb it will check for cairo-xlib which isn't available without X11 DISTRO_FEATURE +PACKAGECONFIG[directfb] = "--with-gdktarget=directfb,,directfb" +PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native" + +inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache gobject-introspection manpages + +PACKAGES += "libgail gtk-demo" + +FILES_${PN} += "${bindir}/gtk-update-icon-cache-2.0 \ + ${bindir}/gtk-query-immodules-2.0 \ + ${datadir}/themes ${sysconfdir} \ + ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so" + +FILES_${PN}-dev += " \ + ${datadir}/gtk-2.0/include \ + ${libdir}/gtk-2.0/include \ + ${libdir}/gtk-2.0/modules/*.la \ + ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \ + ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \ + ${libdir}/gtk-2.0/${LIBV}/printbackends/*.la \ + ${libdir}/gtk-2.0/${LIBV}/engines/*.la \ + ${bindir}/gtk-builder-convert" + +FILES_gtk-demo = " \ + ${datadir}/gtk-2.0/demo/* \ + ${bindir}/gtk-demo \ + " + +FILES_libgail = " \ + ${libdir}/gtk-2.0/modules/libgail.so \ + ${libdir}/gtk-2.0/modules/libferret.so \ + " + +GTKBASE_RRECOMMENDS ?= "liberation-fonts \ + gdk-pixbuf-loader-png \ + gdk-pixbuf-loader-jpeg \ + gdk-pixbuf-loader-gif \ + gdk-pixbuf-loader-xpm \ + shared-mime-info \ + gnome-theme-adwaita \ + " +GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" + +RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}" +RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}" + +ALTERNATIVE_${PN} = "gtk-update-icon-cache" +ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-2.0" + +do_compile_prepend() { + export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs" +} + +do_install () { + autotools_do_install + + install -d ${D}${sysconfdir}/gtk-2.0 + + mkdir -p ${D}${libdir}/gtk-2.0/include + install -m 0644 gdk/gdkconfig.h ${D}${libdir}/gtk-2.0/include/gdkconfig.h + + install -m 0644 ${S}/gtk/gtkfilechooserprivate.h ${D}${includedir}/gtk-2.0/gtk/ + install -m 0644 ${S}/gtk/gtkfilechooserutils.h ${D}${includedir}/gtk-2.0/gtk/ + install -m 0644 ${S}/gtk/gtkfilesystemmodel.h ${D}${includedir}/gtk-2.0/gtk/ + + mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-2.0 +} + +SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess" + +gtk_sysroot_preprocess () { + if [ -e ${D}${bindir}/gtk-builder-convert ]; then + install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 755 ${D}${bindir}/gtk-builder-convert ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + fi +} + diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch b/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch new file mode 100644 index 0000000000..74e479fd1b --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch @@ -0,0 +1,22 @@ +There are issues building the gtk+ tutorial and faq documentation. +Since they were removed in gtk+ upstream and are superfluous in +embedded applications, just don't build them. + +Thanks to Joshua Lock for suggesting this approach. + +Signed-off-by: Scott Garman + +Upstream-Status: Inappropriate [embedded specific] + +diff -urN gtk+-2.22.1.orig/docs/Makefile.am gtk+-2.22.1/docs/Makefile.am +--- gtk+-2.22.1.orig/docs/Makefile.am 2010-11-15 04:13:09.000000000 -0800 ++++ gtk+-2.22.1/docs/Makefile.am 2011-02-23 19:25:16.914815097 -0800 +@@ -1,7 +1,7 @@ + ## Process this file with automake to produce Makefile.in + include $(top_srcdir)/Makefile.decl + +-SUBDIRS = tutorial faq reference tools ++SUBDIRS = reference tools + + EXTRA_DIST += \ + defsformat.txt \ diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch b/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch new file mode 100644 index 0000000000..9eb7f6bf5c --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch @@ -0,0 +1,36 @@ +Upstream-Status: Inappropriate [embedded specific] + +Updated to apply to gtk+-2.24.15 + +Signed-off-by: Marko Lindqvist +Index: gtk+-2.24.31/configure.ac +=================================================================== +--- gtk+-2.24.31.orig/configure.ac ++++ gtk+-2.24.31/configure.ac +@@ -415,7 +415,7 @@ AC_MSG_CHECKING([Whether to write depend + case $enable_explicit_deps in + auto) + export SED +- deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh` ++ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh` + if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then + enable_explicit_deps=yes + else +@@ -772,7 +772,7 @@ else + dnl Now we check to see if our libtool supports shared lib deps + dnl (in a rather ugly way even) + if $dynworks; then +- module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config" ++ module_libtool_config="${CONFIG_SHELL-/bin/sh} $host_alias-libtool --config" + module_deplibs_check=`$module_libtool_config | \ + grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \ + sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'` +@@ -1579,7 +1579,7 @@ fi + # We are using gmodule-no-export now, but I'm leaving the stripping + # code in place for now, since pango and atk still require gmodule. + export SED +-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` ++export_dynamic=`($host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` + if test -n "$export_dynamic"; then + GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"` + GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"` diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch b/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch new file mode 100644 index 0000000000..96e1f5feac --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch @@ -0,0 +1,24 @@ +Fixes + +include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] + typedef void (*GtkItemFactoryCallback) (); + +gcc5 has -Wstrict-prototypes on by default for -Werror so this becomes a build failure for consumers +of this header e.g. matchbox-panel-2 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Index: gtk+-2.24.27/gtk/gtkitemfactory.h +=================================================================== +--- gtk+-2.24.27.orig/gtk/gtkitemfactory.h ++++ gtk+-2.24.27/gtk/gtkitemfactory.h +@@ -44,7 +44,7 @@ typedef void (*GtkPrintFunc) (gpoint + * (Note that if we are included from a C++ program () will mean + * (void) so an explicit cast will be needed.) + */ +-typedef void (*GtkItemFactoryCallback) (); ++typedef void (*GtkItemFactoryCallback) (void); + typedef void (*GtkItemFactoryCallback1) (gpointer callback_data, + guint callback_action, + GtkWidget *widget); diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff b/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff new file mode 100644 index 0000000000..340d12008b --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff @@ -0,0 +1,102 @@ +Upstream-Status: Pending + +Index: gtk/gtkcellrenderertoggle.c +=================================================================== +--- gtk/gtkcellrenderertoggle.c.orig 2010-06-22 18:11:33.000000000 +0800 ++++ gtk/gtkcellrenderertoggle.c 2010-06-22 18:11:43.000000000 +0800 +@@ -71,6 +71,8 @@ + PROP_INDICATOR_SIZE + }; + ++/* This is a hard-coded default which promptly gets overridden by a size ++ calculated from the font size. */ + #define TOGGLE_WIDTH 13 + + static guint toggle_cell_signals[LAST_SIGNAL] = { 0 }; +@@ -80,8 +82,9 @@ + typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate; + struct _GtkCellRendererTogglePrivate + { +- gint indicator_size; +- ++ gint indicator_size; /* This is the real size */ ++ gint override_size; /* This is the size set from the indicator-size property */ ++ GtkWidget *cached_widget; + guint inconsistent : 1; + }; + +@@ -104,6 +107,7 @@ + GTK_CELL_RENDERER (celltoggle)->ypad = 2; + + priv->indicator_size = TOGGLE_WIDTH; ++ priv->override_size = 0; + priv->inconsistent = FALSE; + } + +@@ -210,7 +214,7 @@ + g_value_set_boolean (value, celltoggle->radio); + break; + case PROP_INDICATOR_SIZE: +- g_value_set_int (value, priv->indicator_size); ++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); +@@ -245,7 +249,7 @@ + celltoggle->radio = g_value_get_boolean (value); + break; + case PROP_INDICATOR_SIZE: +- priv->indicator_size = g_value_get_int (value); ++ priv->override_size = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); +@@ -273,6 +277,27 @@ + } + + static void ++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data) ++{ ++ GtkCellRendererTogglePrivate *priv = user_data; ++ PangoContext *context; ++ PangoFontMetrics *metrics; ++ int height; ++ ++ context = gtk_widget_get_pango_context (widget); ++ metrics = pango_context_get_metrics (context, ++ widget->style->font_desc, ++ pango_context_get_language (context)); ++ ++ height = pango_font_metrics_get_ascent (metrics) + ++ pango_font_metrics_get_descent (metrics); ++ ++ pango_font_metrics_unref (metrics); ++ ++ priv->indicator_size = PANGO_PIXELS (height * 0.85); ++} ++ ++static void + gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell, + GtkWidget *widget, + GdkRectangle *cell_area, +@@ -287,6 +312,20 @@ + + priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell); + ++ if (priv->override_size) { ++ priv->indicator_size = priv->override_size; ++ } else if (priv->cached_widget != widget) { ++ if (priv->cached_widget) { ++ g_object_remove_weak_pointer (widget, &priv->cached_widget); ++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv); ++ } ++ priv->cached_widget = widget; ++ g_object_add_weak_pointer (widget, &priv->cached_widget); ++ g_signal_connect (widget, "style-set", on_widget_style_set, priv); ++ ++ on_widget_style_set (widget, NULL, priv); ++ } ++ + calc_width = (gint) cell->xpad * 2 + priv->indicator_size; + calc_height = (gint) cell->ypad * 2 + priv->indicator_size; + diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch b/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch new file mode 100644 index 0000000000..d0a970ad4d --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch @@ -0,0 +1,20 @@ +Upstream-Status: Pending + +Index: gtk+-2.21.2/gdk/x11/gdkevents-x11.c +=================================================================== +--- gtk+-2.21.2.orig/gdk/x11/gdkevents-x11.c 2010-06-22 17:28:04.000000000 +0800 ++++ gtk+-2.21.2/gdk/x11/gdkevents-x11.c 2010-06-22 17:28:06.000000000 +0800 +@@ -3062,10 +3062,9 @@ + { + GdkScreenX11 *screen = data; + +- if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent)) +- return GDK_FILTER_REMOVE; +- else +- return GDK_FILTER_CONTINUE; ++ xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent); ++ ++ return GDK_FILTER_CONTINUE; + } + + static Bool diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3.inc b/poky/meta/recipes-gnome/gtk+/gtk+3.inc new file mode 100644 index 0000000000..420ead2ca2 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+3.inc @@ -0,0 +1,130 @@ +SUMMARY = "Multi-platform toolkit for creating GUIs" +DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \ +set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites." +HOMEPAGE = "http://www.gtk.org" +BUGTRACKER = "https://bugzilla.gnome.org/" +SECTION = "libs" + +DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \ + gdk-pixbuf-native" + +LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" + +inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check gobject-introspection + +# versions >= 3.90 are development versions, otherwise like upstream-version-is-even +UPSTREAM_CHECK_REGEX = "[^\d\.](?P3\.([1-8]?[02468])+(\.\d+)+)\.tar" + +ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" + +# This should be in autotools.bbclass, but until something elses uses it putting +# it here avoids rebuilding everything. +export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native" + +do_configure_prepend() { + # Do this because the configure script is running ./libtool directly + rm -f libtool + ln -s ${TARGET_PREFIX}libtool libtool + #delete a file that will get confused with generated one in ${B} + rm -f ${S}/gtk/gtktypefuncs.c +} + +EXTRA_OECONF += " \ + --disable-glibtest \ + --disable-xinerama \ + --enable-modules \ + --disable-cups \ + --disable-colord \ + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \ + " + +do_compile_prepend() { + export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs" +} + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}" + +PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes" +# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build +PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy" +PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl" +PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/mesa wayland-native" + +do_install_append() { + mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0 +} + +PACKAGES =+ "${PN}-demo" +LIBV = "3.0.0" + +FILES_${PN}-demo = "${bindir}/gtk3-demo \ + ${bindir}/gtk3-demo-application \ + ${bindir}/gtk3-icon-browser \ + ${bindir}/gtk3-widget-factory \ + ${datadir}/gtk-3.0/demo \ + ${datadir}/applications/gtk3-demo.desktop \ + ${datadir}/applications/gtk3-icon-browser.desktop \ + ${datadir}/applications/gtk3-widget-factory.desktop \ + ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \ + ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png" + +FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \ + ${bindir}/gtk-query-immodules-3.0 \ + ${bindir}/gtk-launch \ + ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \ + ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \ + ${libdir}/gtk-3.0/modules/*.so" + +FILES_${PN}-dev += " \ + ${datadir}/gtk-3.0/gtkbuilder.rng \ + ${datadir}/gtk-3.0/include \ + ${datadir}/gettext/its \ + ${libdir}/gtk-3.0/include \ + ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \ + ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \ + ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \ + ${libdir}/gtk-3.0/${LIBV}/engines/*.la \ + ${libdir}/gtk-3.0/modules/*.la \ + ${bindir}/gtk-builder-convert \ + ${bindir}/gtk-encode-symbolic-svg \ + ${bindir}/gtk-builder-tool \ + ${bindir}/gtk-query-settings \ + " + +GTKBASE_RRECOMMENDS ?= "liberation-fonts \ + gdk-pixbuf-loader-png \ + gdk-pixbuf-loader-jpeg \ + gdk-pixbuf-loader-gif \ + gdk-pixbuf-loader-xpm \ + shared-mime-info \ + adwaita-icon-theme-symbolic \ + " +GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" + +RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}" +RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}" +RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}" + +PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*" + +ALTERNATIVE_${PN} = "gtk-update-icon-cache" +ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0" +ALTERNATIVE_PRIORITY = "30" + +python populate_packages_prepend () { + import os.path + + gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') + immodules_root = os.path.join(gtk_libdir, 'immodules') + printmodules_root = os.path.join(gtk_libdir, 'printbackends'); + + immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s') + if immodules: + d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules)) + + do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s') + + if (d.getVar('DEBIAN_NAMES')): + d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0') +} diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch new file mode 100644 index 0000000000..c210bbc7d5 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch @@ -0,0 +1,47 @@ +From 0ecaa5bab162abf0cb2057d77beeb7b89d5873b4 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Tue, 21 Jun 2016 14:53:56 +0300 +Subject: [PATCH 1/4] Hardcoded libtool + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Marko Lindqvist +Signed-off-by: Jussi Kukkonen +--- + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 6628e21..f43ac09 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -617,7 +617,7 @@ AC_MSG_CHECKING([whether to write dependencies into .pc files]) + case $enable_explicit_deps in + auto) + export SED +- deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh` ++ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh` + if test "x$deplibs_check_method" != xpass_all || test "x$enable_static" = xyes ; then + enable_explicit_deps=yes + else +@@ -895,7 +895,7 @@ else + dnl Now we check to see if our libtool supports shared lib deps + dnl (in a rather ugly way even) + if $dynworks; then +- module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config" ++ module_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config" + module_deplibs_check=`$module_libtool_config | \ + grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \ + sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'` +@@ -1649,7 +1649,7 @@ AC_SUBST(GTK_PRINT_BACKENDS) + # We are using gmodule-no-export now, but I'm leaving the stripping + # code in place for now, since pango and atk still require gmodule. + export SED +-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` ++export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` + if test -n "$export_dynamic"; then + GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"` + GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"` +-- +2.12.0 + diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch new file mode 100644 index 0000000000..cc7edf7607 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch @@ -0,0 +1,60 @@ +From 23a563155406980dfc8cf6f7c2da6cce0ac310f0 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Fri, 16 Oct 2015 16:35:16 +0300 +Subject: [PATCH 2/4] Do not try to initialize GL without libGL + +_gdk_x11_screen_update_visuals_for_gl() will end up calling epoxys +GLX api which will exit() if libGL.so.1 is not present. We do not +want that to happen and we don't want every app to have to set +"GDK_GL=disabled" environment variable: so use #ifdef set based on +opengl distro feature. + +Upstream is not interested in the fix as it is: Either epoxy should be +fixed (to not exit) or GTK+ possibly could do some additional probing +before calling epoxy APIs. + +Upstream-Status: Denied +Signed-off-by: Jussi Kukkonen + +--- + configure.ac | 6 ++++++ + gdk/x11/gdkvisual-x11.c | 5 +++++ + 2 files changed, 11 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 757fd7c..0a48875 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -351,6 +351,12 @@ AC_ARG_ENABLE(cloudproviders, + [AS_HELP_STRING([--enable-cloudproviders], + [enable libcloudproviders integration])], + [cloudproviders_set=yes]) ++AC_ARG_ENABLE(glx, ++ [AS_HELP_STRING([--enable-glx], ++ [When enabled Gdk will try to initialize GLX])]) ++AS_IF([test "x$enable_glx" != "xno"], [ ++ AC_DEFINE([HAVE_GLX], [], [GLX will be available at runtime]) ++]) + + if test -z "$backend_set"; then + if test "$platform_win32" = yes; then +diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c +index 81479d8..3c8c5c0 100644 +--- a/gdk/x11/gdkvisual-x11.c ++++ b/gdk/x11/gdkvisual-x11.c +@@ -306,7 +306,12 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen) + /* If GL is available we want to pick better default/rgba visuals, + as we care about glx details such as alpha/depth/stencil depth, + stereo and double buffering */ ++ /* update_visuals_for_gl() will end up calling epoxy GLX api which ++ will exit if libgl is not there: so only do this if we know GL ++ is available */ ++#ifdef HAVE_GLX + _gdk_x11_screen_update_visuals_for_gl (screen); ++#endif + } + + gint +-- +2.14.1 + diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch new file mode 100644 index 0000000000..d2f12dc7ff --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch @@ -0,0 +1,847 @@ +From de36df70d87ba3453ed4f2b92e990021c67238f5 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Tue, 21 Jun 2016 15:11:39 +0300 +Subject: [PATCH 3/4] Add --disable-opengl configure option + +--disable-opengl will remove the dependency on libepoxy and on the +OpenGL APIs. This is useful for those who want to keep using gtk+3 +without the "opengl" distro feature. + +GtkGLArea is still part of the API (it just doesn't work) even when +OpenGL is disabled. GdkX11GLContext was removed from the Gtk API +completely: that object exposes GL API elements so it had to be at +the very least modified. + +The patch is _not_ great from a maintenance point of view and +modifying the library API is also a fairly nasty thing to do. +Next long term release (4.0) will require alternative solutions +as it actually will depend on OpenGL. + +Upstream-Status: Inappropriate [Evil eye expected from upstream] +Signed-off-by: Jussi Kukkonen + +--- + configure.ac | 13 +++++-- + demos/gtk-demo/glarea.c | 14 ++++++++ + docs/tools/Makefile.am | 9 +++-- + docs/tools/widgets.c | 4 ++- + gdk/gdkdisplay.c | 4 ++- + gdk/gdkgl.c | 10 ++++++ + gdk/gdkglcontext.c | 6 ++++ + gdk/gdkwindow.c | 13 +++++++ + gdk/x11/Makefile.am | 30 +++++++++++++--- + gdk/x11/gdkdisplay-x11.c | 6 +++- + gdk/x11/gdkscreen-x11.c | 5 +++ + gdk/x11/gdkwindow-x11.c | 4 +++ + gdk/x11/gdkx-autocleanups.h | 2 ++ + gdk/x11/{gdkx.h => gdkx-with-gl-context.h} | 1 - + gdk/x11/gdkx-without-gl-context.h | 58 ++++++++++++++++++++++++++++++ + gtk/Makefile.am | 3 +- + gtk/gtkglarea.c | 20 ++++++++++- + gtk/inspector/general.c | 6 ++++ + tests/Makefile.am | 10 ++++-- + testsuite/gtk/objects-finalize.c | 2 ++ + 20 files changed, 202 insertions(+), 18 deletions(-) + rename gdk/x11/{gdkx.h => gdkx-with-gl-context.h} (98%) + create mode 100644 gdk/x11/gdkx-without-gl-context.h + +diff --git a/configure.ac b/configure.ac +index 0a48875..6f0a3a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -351,6 +351,15 @@ AC_ARG_ENABLE(cloudproviders, + [AS_HELP_STRING([--enable-cloudproviders], + [enable libcloudproviders integration])], + [cloudproviders_set=yes]) ++AC_ARG_ENABLE(opengl, ++ [AS_HELP_STRING([--enable-opengl], ++ [When enabled, Gtk+ will use libepoxy and exposes GtkGLArea widget ])]) ++AS_IF([test "x$enable_opengl" != "xno"], [ ++ AC_DEFINE([HAVE_OPENGL], [1], [libepoxy and opengl APIs are available at buildtime]) ++ EPOXY_PACKAGES="epoxy >= epoxy_required_version" ++]) ++AM_CONDITIONAL([HAVE_OPENGL],[test "x$enable_opengl" != "xno"]) ++ + AC_ARG_ENABLE(glx, + [AS_HELP_STRING([--enable-glx], + [When enabled Gdk will try to initialize GLX])]) +@@ -1372,7 +1381,7 @@ CFLAGS="$saved_cflags" + LDFLAGS="$saved_ldflags" + + GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version" +-GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES" ++GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends $EPOXY_PACKAGES $CLOUDPROVIDER_PACKAGES" + + PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES) + GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB" +@@ -1406,7 +1415,7 @@ fi + PKG_CHECK_MODULES(ATK, $ATK_PACKAGES) + + GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version" +-GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version" ++GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $EPOXY_PACKAGES" + if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then + GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2" + fi +diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c +index b51e4ae..82409c7 100644 +--- a/demos/gtk-demo/glarea.c ++++ b/demos/gtk-demo/glarea.c +@@ -3,9 +3,12 @@ + * GtkGLArea is a widget that allows custom drawing using OpenGL calls. + */ + ++#include "config.h" + #include + #include ++#if HAVE_OPENGL + #include ++#endif + + static GtkWidget *demo_window = NULL; + +@@ -23,6 +26,8 @@ enum { + /* Rotation angles on each axis */ + static float rotation_angles[N_AXIS] = { 0.0 }; + ++#ifdef HAVE_OPENGL ++ + /* The object we are drawing */ + static const GLfloat vertex_data[] = { + 0.f, 0.5f, 0.f, 1.f, +@@ -215,6 +220,7 @@ compute_mvp (float *res, + static GLuint position_buffer; + static GLuint program; + static GLuint mvp_location; ++#endif + + /* We need to set up our state when we realize the GtkGLArea widget */ + static void +@@ -241,8 +247,10 @@ realize (GtkWidget *widget) + fragment_path = "/glarea/glarea-gl.fs.glsl"; + } + ++#ifdef HAVE_OPENGL + init_buffers (&position_buffer, NULL); + init_shaders (vertex_path, fragment_path, &program, &mvp_location); ++#endif + } + + /* We should tear down the state when unrealizing */ +@@ -254,10 +262,13 @@ unrealize (GtkWidget *widget) + if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) + return; + ++#ifdef HAVE_OPENGL + glDeleteBuffers (1, &position_buffer); + glDeleteProgram (program); ++#endif + } + ++#ifdef HAVE_OPENGL + static void + draw_triangle (void) + { +@@ -290,6 +301,7 @@ draw_triangle (void) + glBindBuffer (GL_ARRAY_BUFFER, 0); + glUseProgram (0); + } ++#endif + + static gboolean + render (GtkGLArea *area, +@@ -298,6 +310,7 @@ render (GtkGLArea *area, + if (gtk_gl_area_get_error (area) != NULL) + return FALSE; + ++#ifdef HAVE_OPENGL + /* Clear the viewport */ + glClearColor (0.5, 0.5, 0.5, 1.0); + glClear (GL_COLOR_BUFFER_BIT); +@@ -307,6 +320,7 @@ render (GtkGLArea *area, + + /* Flush the contents of the pipeline */ + glFlush (); ++#endif + + return TRUE; + } +diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am +index 6a6d70f..5cdf312 100644 +--- a/docs/tools/Makefile.am ++++ b/docs/tools/Makefile.am +@@ -9,13 +9,18 @@ AM_CPPFLAGS = \ + $(GTK_DEBUG_FLAGS) \ + $(GTK_DEP_CFLAGS) + ++if HAVE_OPENGL ++GEARS_LDADD = $(top_builddir)/tests/gtkgears.o ++endif ++ + DEPS = \ +- $(top_builddir)/gtk/libgtk-3.la ++ $(top_builddir)/gtk/libgtk-3.la \ ++ $(GEARS_LDADD) + + LDADDS = \ + $(top_builddir)/gtk/libgtk-3.la \ + $(top_builddir)/gdk/libgdk-3.la \ +- $(top_builddir)/tests/gtkgears.o \ ++ $(GEARS_LDADD) \ + $(GTK_DEP_LIBS) \ + $(GDK_DEP_LIBS) \ + -lm +diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c +index 932daf1..54239d6 100644 +--- a/docs/tools/widgets.c ++++ b/docs/tools/widgets.c +@@ -1526,9 +1526,11 @@ create_gl_area (void) + widget = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN); + ++#ifdef HAVE_OPENGL + gears = gtk_gears_new (); + gtk_container_add (GTK_CONTAINER (widget), gears); +- ++#endif ++ + info = new_widget_info ("glarea", widget, MEDIUM); + + return info; +diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c +index 40225e9..c55e1de 100644 +--- a/gdk/gdkdisplay.c ++++ b/gdk/gdkdisplay.c +@@ -2406,7 +2406,9 @@ gboolean + gdk_display_make_gl_context_current (GdkDisplay *display, + GdkGLContext *context) + { +- return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context); ++ if (GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current) ++ return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context); ++ return FALSE; + } + + GdkRenderingMode +diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c +index 8e7b8c2..b579b22 100644 +--- a/gdk/gdkgl.c ++++ b/gdk/gdkgl.c +@@ -22,7 +22,9 @@ + + #include "gdkinternals.h" + ++#ifdef HAVE_OPENGL + #include ++#endif + #include + #include + +@@ -36,6 +38,7 @@ gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface, + g_object_ref (window), g_object_unref); + } + ++#ifdef HAVE_OPENGL + static const char * + get_vertex_type_name (int type) + { +@@ -208,6 +211,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data) + glUseProgram (paint_data->current_program->program); + } + } ++#endif + + void + gdk_gl_texture_quads (GdkGLContext *paint_context, +@@ -216,6 +220,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, + GdkTexturedQuad *quads, + gboolean flip_colors) + { ++#ifdef HAVE_OPENGL + GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context); + GdkGLContextProgram *program; + GdkWindow *window = gdk_gl_context_get_window (paint_context); +@@ -289,6 +294,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, + + glDisableVertexAttribArray (program->position_location); + glDisableVertexAttribArray (program->uv_location); ++#endif + } + + /* x,y,width,height describes a rectangle in the gl render buffer +@@ -337,6 +343,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, + int width, + int height) + { ++#ifdef HAVE_OPENGL + GdkGLContext *paint_context; + cairo_surface_t *image; + cairo_matrix_t matrix; +@@ -707,6 +714,7 @@ out: + if (clip_region) + cairo_region_destroy (clip_region); + ++#endif + } + + /* This is always called with the paint context current */ +@@ -714,6 +722,7 @@ void + gdk_gl_texture_from_surface (cairo_surface_t *surface, + cairo_region_t *region) + { ++#ifdef HAVE_OPENGL + GdkGLContext *paint_context; + cairo_surface_t *image; + double device_x_offset, device_y_offset; +@@ -814,4 +823,5 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, + + glDisable (GL_SCISSOR_TEST); + glDeleteTextures (1, &texture_id); ++#endif + } +diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c +index c79dca0..8a7bec2 100644 +--- a/gdk/gdkglcontext.c ++++ b/gdk/gdkglcontext.c +@@ -85,7 +85,9 @@ + #include "gdkintl.h" + #include "gdk-private.h" + ++#ifdef HAVE_OPENGL + #include ++#endif + + typedef struct { + GdkDisplay *display; +@@ -243,6 +245,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, + int height, + guint texture_target) + { ++#ifdef HAVE_OPENGL + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + + g_return_if_fail (GDK_IS_GL_CONTEXT (context)); +@@ -286,6 +289,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, + glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (unsigned char*) data + (i * stride)); + } + } ++#endif + } + + static gboolean +@@ -774,6 +778,7 @@ gdk_gl_context_realize (GdkGLContext *context, + static void + gdk_gl_context_check_extensions (GdkGLContext *context) + { ++#ifdef HAVE_OPENGL + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + gboolean has_npot, has_texture_rectangle; + +@@ -847,6 +852,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context) + priv->use_texture_rectangle ? "yes" : "no")); + + priv->extensions_checked = TRUE; ++#endif + } + + /** +diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c +index c0e0a7d..437ab03 100644 +--- a/gdk/gdkwindow.c ++++ b/gdk/gdkwindow.c +@@ -45,7 +45,9 @@ + + #include + ++#ifdef HAVE_OPENGL + #include ++#endif + + /* for the use of round() */ + #include "fallback-c89.c" +@@ -2822,6 +2824,13 @@ gdk_window_get_paint_gl_context (GdkWindow *window, + { + GError *internal_error = NULL; + ++#ifndef HAVE_OPENGL ++ g_set_error_literal (error, GDK_GL_ERROR, ++ GDK_GL_ERROR_NOT_AVAILABLE, ++ _("GL support disabled with --disable-opengl")); ++ return NULL; ++#endif ++ + if (_gdk_gl_flags & GDK_GL_DISABLE) + { + g_set_error_literal (error, GDK_GL_ERROR, +@@ -2957,6 +2966,7 @@ gdk_window_begin_paint_internal (GdkWindow *window, + } + else + { ++#ifdef HAVE_OPENGL + gdk_gl_context_make_current (context); + /* With gl we always need a surface to combine the gl + drawing with the native drawing. */ +@@ -2971,6 +2981,7 @@ gdk_window_begin_paint_internal (GdkWindow *window, + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + + glViewport (0, 0, ww, wh); ++#endif + } + } + +@@ -3034,6 +3045,7 @@ gdk_window_end_paint_internal (GdkWindow *window) + + gdk_gl_context_make_current (window->gl_paint_context); + ++#ifdef HAVE_OPENGL + if (!cairo_region_is_empty (opaque_region)) + gdk_gl_texture_from_surface (window->current_paint.surface, + opaque_region); +@@ -3044,6 +3056,7 @@ gdk_window_end_paint_internal (GdkWindow *window) + window->current_paint.need_blend_region); + glDisable(GL_BLEND); + } ++#endif + + cairo_region_destroy (opaque_region); + +diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am +index 6289f3a..cbbac79 100644 +--- a/gdk/x11/Makefile.am ++++ b/gdk/x11/Makefile.am +@@ -40,8 +40,6 @@ libgdk_x11_la_SOURCES = \ + gdkeventtranslator.c \ + gdkeventtranslator.h \ + gdkgeometry-x11.c \ +- gdkglcontext-x11.c \ +- gdkglcontext-x11.h \ + gdkkeys-x11.c \ + gdkmain-x11.c \ + gdkmonitor-x11.c \ +@@ -56,14 +54,32 @@ libgdk_x11_la_SOURCES = \ + gdkwindow-x11.h \ + gdkxftdefaults.c \ + gdkxid.c \ +- gdkx.h \ + gdkprivate-x11.h \ + xsettings-client.h \ + xsettings-client.c + ++if HAVE_OPENGL ++libgdk_x11_la_SOURCES += \ ++ gdkglcontext-x11.c \ ++ gdkglcontext-x11.h ++endif ++ + libgdkinclude_HEADERS = \ + gdkx.h + ++if HAVE_OPENGL ++GDKX_HEADER = gdkx-with-gl-context.h ++else ++GDKX_HEADER = gdkx-without-gl-context.h ++endif ++ ++BUILT_SOURCES = gdkx.h ++ ++.PHONY: gdkx.h ++gdkx.h: ++ $(AM_V_GEN) cd $(srcdir) \ ++ && (cmp -s $(GDKX_HEADER) gdkx.h || cp $(GDKX_HEADER) gdkx.h ) ++ + libgdkx11include_HEADERS = \ + gdkx-autocleanups.h \ + gdkx11applaunchcontext.h \ +@@ -77,7 +93,6 @@ libgdkx11include_HEADERS = \ + gdkx11display.h \ + gdkx11displaymanager.h \ + gdkx11dnd.h \ +- gdkx11glcontext.h \ + gdkx11keys.h \ + gdkx11monitor.h \ + gdkx11property.h \ +@@ -87,9 +102,16 @@ libgdkx11include_HEADERS = \ + gdkx11visual.h \ + gdkx11window.h + ++if HAVE_OPENGL ++libgdkx11include_HEADERS += gdkx11glcontext.h ++endif ++ + # We need to include all these C files here since the conditionals + # don't seem to be correctly expanded for the dist files. + EXTRA_DIST += \ ++ gdkx.h \ + gdksettings.c + ++MAINTAINERCLEANFILES = gdkx.h ++ + -include $(top_srcdir)/git.mk +diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c +index e9a263f..2829a31 100644 +--- a/gdk/x11/gdkdisplay-x11.c ++++ b/gdk/x11/gdkdisplay-x11.c +@@ -37,7 +37,9 @@ + #include "gdkdisplay-x11.h" + #include "gdkprivate-x11.h" + #include "gdkscreen-x11.h" ++#ifdef HAVE_OPENGL + #include "gdkglcontext-x11.h" ++#endif + #include "gdk-private.h" + + #include +@@ -3169,7 +3171,9 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) + display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list; + display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target; + +- display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current; ++#ifdef HAVE_OPENGL ++ display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current; ++#endif + + display_class->get_default_seat = gdk_x11_display_get_default_seat; + +diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c +index 7bf9979..cd1cc9d 100644 +--- a/gdk/x11/gdkscreen-x11.c ++++ b/gdk/x11/gdkscreen-x11.c +@@ -1643,3 +1643,8 @@ gdk_x11_screen_get_current_desktop (GdkScreen *screen) + { + return get_netwm_cardinal_property (screen, "_NET_CURRENT_DESKTOP"); + } ++ ++#ifndef HAVE_OPENGL ++/* Function from in gdk/x11/gdkglcontext-x11.c */ ++void _gdk_x11_screen_update_visuals_for_gl (GdkScreen *screen) {} ++#endif +diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c +index 3d6fd3b..2bd5c87 100644 +--- a/gdk/x11/gdkwindow-x11.c ++++ b/gdk/x11/gdkwindow-x11.c +@@ -36,7 +36,9 @@ + #include "gdkasync.h" + #include "gdkeventsource.h" + #include "gdkdisplay-x11.h" ++#ifdef HAVE_OPENGL + #include "gdkglcontext-x11.h" ++#endif + #include "gdkprivate-x11.h" + #include "gdk-private.h" + +@@ -5801,7 +5803,9 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) + impl_class->set_opaque_region = gdk_x11_window_set_opaque_region; + impl_class->set_shadow_width = gdk_x11_window_set_shadow_width; + impl_class->show_window_menu = gdk_x11_window_show_window_menu; ++#ifdef HAVE_OPENGL + impl_class->create_gl_context = gdk_x11_window_create_gl_context; + impl_class->invalidate_for_new_frame = gdk_x11_window_invalidate_for_new_frame; ++#endif + impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size; + } +diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h +index edb0ea7..a317d61 100644 +--- a/gdk/x11/gdkx-autocleanups.h ++++ b/gdk/x11/gdkx-autocleanups.h +@@ -30,7 +30,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DeviceXI2, g_object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Display, g_object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DisplayManager, g_object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DragContext, g_object_unref) ++#ifdef HAVE_OPENGL + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11GLContext, g_object_unref) ++#endif + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Keymap, g_object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Screen, g_object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Visual, g_object_unref) +diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx-with-gl-context.h +similarity index 98% +rename from gdk/x11/gdkx.h +rename to gdk/x11/gdkx-with-gl-context.h +index 1f64bcc..ae05fa6 100644 +--- a/gdk/x11/gdkx.h ++++ b/gdk/x11/gdkx-with-gl-context.h +@@ -45,7 +45,6 @@ + #include + #include + #include +-#include + #include + #include + #include +diff --git a/gdk/x11/gdkx-without-gl-context.h b/gdk/x11/gdkx-without-gl-context.h +new file mode 100644 +index 0000000..c9e2617 +--- /dev/null ++++ b/gdk/x11/gdkx-without-gl-context.h +@@ -0,0 +1,58 @@ ++/* GDK - The GIMP Drawing Kit ++ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library. If not, see . ++ */ ++ ++/* ++ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS ++ * file for a list of people on the GTK+ Team. See the ChangeLog ++ * files for a list of changes. These files are distributed with ++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. ++ */ ++ ++#ifndef __GDK_X_H__ ++#define __GDK_X_H__ ++ ++#include ++ ++#include ++#include ++ ++#define __GDKX_H_INSIDE__ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#undef __GDKX_H_INSIDE__ ++ ++#endif /* __GDK_X_H__ */ +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 842c2f9..0921bc7 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -1416,14 +1416,13 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins. + && cp xgen-gptbc gtkprivatetypebuiltins.c \ + && rm -f xgen-gptbc + +- + gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile + $(AM_V_GEN) (echo '#undef GTK_COMPILATION' && echo '#include ') > xgen-gtfsrc.c && \ + echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \ + ${CPP} $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \ + $(GREP) -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \ + sort | uniq | \ +- $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' >> xgen-gtf \ ++ $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; s/^.*gdk_x11_gl.*$$/#ifdef HAVE_OPENGL\n&\n#endif/; }' >> xgen-gtf \ + && cp xgen-gtf $@ && rm -f xgen-gtf + gtktestutils.c: gtktypefuncs.c + +diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c +index 094378e..f7c7f47 100644 +--- a/gtk/gtkglarea.c ++++ b/gtk/gtkglarea.c +@@ -28,7 +28,9 @@ + #include "gtkprivate.h" + #include "gtkrender.h" + ++#ifdef HAVE_OPENGL + #include ++#endif + + /** + * SECTION:gtkglarea +@@ -368,9 +370,12 @@ gtk_gl_area_real_create_context (GtkGLArea *area) + static void + gtk_gl_area_resize (GtkGLArea *area, int width, int height) + { ++#ifdef HAVE_OPENGL + glViewport (0, 0, width, height); ++#endif + } + ++#ifdef HAVE_OPENGL + /* + * Creates all the buffer objects needed for rendering the scene + */ +@@ -482,6 +487,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) + + priv->needs_render = TRUE; + } ++#endif + + /** + * gtk_gl_area_attach_buffers: +@@ -500,6 +506,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) + void + gtk_gl_area_attach_buffers (GtkGLArea *area) + { ++#ifdef HAVE_OPENGL + GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); + + g_return_if_fail (GTK_IS_GL_AREA (area)); +@@ -532,11 +539,13 @@ gtk_gl_area_attach_buffers (GtkGLArea *area) + glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer); + } ++#endif + } + + static void + gtk_gl_area_delete_buffers (GtkGLArea *area) + { ++#ifdef HAVE_OPENGL + GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); + + if (priv->context == NULL) +@@ -568,6 +577,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area) + glDeleteFramebuffersEXT (1, &priv->frame_buffer); + priv->frame_buffer = 0; + } ++#endif + } + + static void +@@ -678,6 +688,7 @@ gtk_gl_area_draw (GtkWidget *widget, + GtkGLArea *area = GTK_GL_AREA (widget); + GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); + gboolean unused; ++#ifdef HAVE_OPENGL + int w, h, scale; + GLenum status; + +@@ -689,7 +700,6 @@ gtk_gl_area_draw (GtkWidget *widget, + gtk_widget_get_allocated_height (widget)); + return FALSE; + } +- + if (priv->context == NULL) + return FALSE; + +@@ -735,6 +745,14 @@ gtk_gl_area_draw (GtkWidget *widget, + } + + return TRUE; ++#else ++ if (priv->error != NULL) ++ gtk_gl_area_draw_error_screen (area, ++ cr, ++ gtk_widget_get_allocated_width (widget), ++ gtk_widget_get_allocated_height (widget)); ++ return FALSE; ++#endif + } + + static gboolean +diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c +index c241ec8..24576dd 100644 +--- a/gtk/inspector/general.c ++++ b/gtk/inspector/general.c +@@ -33,8 +33,10 @@ + + #ifdef GDK_WINDOWING_X11 + #include "x11/gdkx.h" ++#ifdef HAVE_OPENGL + #include + #endif ++#endif + + #ifdef GDK_WINDOWING_WIN32 + #include "win32/gdkwin32.h" +@@ -196,6 +198,7 @@ add_label_row (GtkInspectorGeneral *gen, + gtk_size_group_add_widget (GTK_SIZE_GROUP (gen->priv->labels), label); + } + ++#ifdef HAVE_OPENGL + #ifdef GDK_WINDOWING_X11 + static void + append_glx_extension_row (GtkInspectorGeneral *gen, +@@ -205,6 +208,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen, + add_check_row (gen, GTK_LIST_BOX (gen->priv->gl_box), ext, epoxy_has_glx_extension (dpy, 0, ext), 0); + } + #endif ++#endif + + #ifdef GDK_WINDOWING_WAYLAND + static void +@@ -254,6 +258,7 @@ wayland_get_display (struct wl_display *wl_display) + static void + init_gl (GtkInspectorGeneral *gen) + { ++#ifdef HAVE_OPENGL + #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) + { +@@ -280,6 +285,7 @@ init_gl (GtkInspectorGeneral *gen) + } + else + #endif ++#endif + #ifdef GDK_WINDOWING_WAYLAND + if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + { +diff --git a/tests/Makefile.am b/tests/Makefile.am +index e2db6e4..e51cf34 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -80,8 +80,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \ + testfullscreen \ + testgeometry \ + testgiconpixbuf \ +- testglarea \ +- testglblending \ + testgrid \ + testgtk \ + testheaderbar \ +@@ -170,12 +168,18 @@ noinst_PROGRAMS = $(TEST_PROGS) \ + testactionbar \ + testwindowsize \ + testpopover \ +- gdkgears \ + listmodel \ + testpopup \ + testpopupat \ + $(NULL) + ++if HAVE_OPENGL ++noinst_PROGRAMS += ++ testglarea \ ++ testglblending \ ++ gdkgears ++endif ++ + if USE_WAYLAND + noinst_PROGRAMS += testforeign + endif +diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c +index 0b3a519..07b096f 100644 +--- a/testsuite/gtk/objects-finalize.c ++++ b/testsuite/gtk/objects-finalize.c +@@ -115,7 +115,9 @@ main (int argc, char **argv) + all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_CORE && + all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_XI2 && + all_types[i] != GDK_TYPE_X11_DISPLAY_MANAGER && ++#ifdef HAVE_OPENGL + all_types[i] != GDK_TYPE_X11_GL_CONTEXT && ++#endif + #endif + /* Not allowed to finalize a GdkPixbufLoader without calling gdk_pixbuf_loader_close() */ + all_types[i] != GDK_TYPE_PIXBUF_LOADER && +-- +2.14.1 + diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb b/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb new file mode 100644 index 0000000000..864e8260c8 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb @@ -0,0 +1,18 @@ +require gtk+3.inc + +MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}" + +SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \ + file://0001-Hardcoded-libtool.patch \ + file://0002-Do-not-try-to-initialize-GL-without-libGL.patch \ + file://0003-Add-disable-opengl-configure-option.patch \ + " +SRC_URI[md5sum] = "8c1f5ab987ddc7dab3e59660f89dcd9b" +SRC_URI[sha256sum] = "d299612b018cfed7b2c689168ab52b668023708e17c335eb592260d186f15e1f" + +S = "${WORKDIR}/gtk+-${PV}" + +LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \ + file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \ + file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \ + file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1" diff --git a/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb b/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb new file mode 100644 index 0000000000..20703588c3 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb @@ -0,0 +1,34 @@ +require gtk+.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \ + file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \ + file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \ + file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c" +SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \ + file://xsettings.patch \ + file://hardcoded_libtool.patch \ + file://toggle-font.diff;striplevel=0 \ + file://doc-fixes.patch \ + file://strict-prototypes.patch \ + " + +SRC_URI[md5sum] = "d5742aa42275203a499b59b4c382a784" +SRC_URI[sha256sum] = "b6c8a93ddda5eabe3bfee1eb39636c9a03d2a56c7b62828b359bf197943c582e" + +EXTRA_OECONF = "--enable-xkb --disable-glibtest --disable-cups --disable-xinerama" + +LIBV = "2.10.0" + +PACKAGES_DYNAMIC += "^gtk-immodule-.* ^gtk-printbackend-.*" + +python populate_packages_prepend () { + gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}') + immodules_root = os.path.join(gtk_libdir, 'immodules') + printmodules_root = os.path.join(gtk_libdir, 'printbackends'); + + d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s'))) + do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s') + + if (d.getVar('DEBIAN_NAMES')): + d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0') +} diff --git a/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb new file mode 100644 index 0000000000..942c047179 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb @@ -0,0 +1,63 @@ +SUMMARY = "Native icon utils for GTK+" +DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution." +SECTION = "libs" + +DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native" + +LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" + +MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}" + +SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \ + file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch" +SRC_URI[md5sum] = "8c1f5ab987ddc7dab3e59660f89dcd9b" +SRC_URI[sha256sum] = "d299612b018cfed7b2c689168ab52b668023708e17c335eb592260d186f15e1f" + +LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \ + file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \ + file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \ + file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1" + +S = "${WORKDIR}/gtk+-${PV}" + +inherit pkgconfig native + +# versions >= 3.90 are development versions, otherwise like upstream-version-is-even +UPSTREAM_CHECK_REGEX = "[^\d\.](?P3\.([1-8]?[02468])+(\.\d+)+)\.tar" + +PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native" + +do_configure() { + # Quite ugly but defines enough to compile the tools. + if ! test -f gtk/config.h; then + echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h + echo "#define HAVE_UNISTD_H 1" >> gtk/config.h + echo "#define HAVE_FTW_H 1" >> gtk/config.h + fi + if ! test -f gdk/config.h; then + touch gdk/config.h + fi +} + +do_compile() { + ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \ + ${S}/gtk/updateiconcache.c \ + $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \ + -o gtk-update-icon-cache + + ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \ + ${S}/gtk/encodesymbolic.c \ + $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \ + -o gtk-encode-symbolic-svg +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir} + install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir} + + create_wrapper ${D}/${bindir}/gtk-update-icon-cache \ + GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache + create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \ + GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache +} diff --git a/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch new file mode 100644 index 0000000000..237f803755 --- /dev/null +++ b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch @@ -0,0 +1,102 @@ +From 4d09ff324419fe4e671233044e424378da53969b Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Tue, 9 Jun 2015 14:20:30 +0300 +Subject: [PATCH] Remove Gdk-dependency from gtk-encode-symbolic-svg + +Building gtk-encode-symbolic-svg without building Gdk is useful +as only the icon tools are needed on the native build: this makes +native build much faster and requires much less dependencies. + +Upstream-Status: Pending + +Signed-off-by: Jussi Kukkonen +--- + gtk/encodesymbolic.c | 36 ++++++++++-------------------------- + 1 file changed, 10 insertions(+), 26 deletions(-) + +diff --git a/gtk/encodesymbolic.c b/gtk/encodesymbolic.c +index 9f7d015..1f07563 100644 +--- a/gtk/encodesymbolic.c ++++ b/gtk/encodesymbolic.c +@@ -19,7 +19,6 @@ + + #include + #include +-#include + #include + + #ifdef HAVE_UNISTD_H +@@ -43,30 +42,18 @@ static GdkPixbuf * + load_symbolic_svg (char *file_data, gsize file_len, + int width, + int height, +- const GdkRGBA *fg, +- const GdkRGBA *success_color, +- const GdkRGBA *warning_color, +- const GdkRGBA *error_color, ++ const char *css_fg, ++ const char *css_success, ++ const char *css_warning, ++ const char *css_error, + GError **error) + { + GInputStream *stream; + GdkPixbuf *pixbuf; +- gchar *css_fg; +- gchar *css_success; +- gchar *css_warning; +- gchar *css_error; + gchar *data; + gchar *svg_width, *svg_height; + gchar *escaped_file_data; + +- css_fg = gdk_rgba_to_string (fg); +- +- css_success = css_warning = css_error = NULL; +- +- css_warning = gdk_rgba_to_string (warning_color); +- css_error = gdk_rgba_to_string (error_color); +- css_success = gdk_rgba_to_string (success_color); +- + /* Fetch size from the original icon */ + stream = g_memory_input_stream_new_from_data (file_data, file_len, NULL); + pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error); +@@ -105,10 +92,6 @@ load_symbolic_svg (char *file_data, gsize file_len, + "", + NULL); + g_free (escaped_file_data); +- g_free (css_fg); +- g_free (css_warning); +- g_free (css_error); +- g_free (css_success); + g_free (svg_width); + g_free (svg_height); + +@@ -167,7 +150,8 @@ make_symbolic_pixbuf (char *file, + GError **error) + + { +- GdkRGBA r = { 1,0,0,1}, g = {0,1,0,1}; ++ const char r[] = "rgba(255,0,0,1)"; ++ const char g[] = "rgba(0,255,0,1)"; + GdkPixbuf *loaded; + GdkPixbuf *pixbuf; + int plane; +@@ -196,10 +180,10 @@ make_symbolic_pixbuf (char *file, + * the "rest", as all color fractions should add up to 1. + */ + loaded = load_symbolic_svg (file_data, file_len, width, height, +- &g, +- plane == 0 ? &r : &g, +- plane == 1 ? &r : &g, +- plane == 2 ? &r : &g, ++ g, ++ plane == 0 ? r : g, ++ plane == 1 ? r : g, ++ plane == 2 ? r : g, + error); + if (loaded == NULL) + return NULL; +-- +2.1.4 + -- cgit v1.2.3