From b610145b1aadb093ced72a7958d8df00ef1250b6 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Wed, 22 Jun 2016 14:52:20 +0300 Subject: gtk+3: Upgrade 3.18.8 -> 3.20.6 * Remove a patch that's no longer needed (as we don't have a problem with client side decorations anymore) * Wayland build now depends on wayland-protocols: Use same WAYLAND_PROTOCOLS_SYSROOT_DIR trick as weston so protocols are found and multilib build does not break * Add new binary gtk-query-settings to -dev package * Rebase patches * Modify 0003-Add-disable-opengl-configure-option.patch so that gdkx.h really is generated whenever it changes * Depend on wayland-protocols in gtk+3-dev if Wayland is enabled as otherwise the pkg-config files can't be used - RB Signed-off-by: Jussi Kukkonen Signed-off-by: Ross Burton gtk+3: depend on wayland-protocols if wayland enabled --- meta/recipes-gnome/gtk+/gtk+3.inc | 10 +- .../0001-Add-disable-opengl-configure-option.patch | 965 --------------------- .../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 | 832 ++++++++++++++++++ ...4-configure.ac-Fix-wayland-protocols-path.patch | 36 + ...Do-not-try-to-initialize-GL-without-libGL.patch | 60 -- meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch | 118 --- .../gtk+/gtk+3/hardcoded_libtool.patch | 35 - meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb | 20 - meta/recipes-gnome/gtk+/gtk+3_3.20.6.bb | 19 + .../gtk+/gtk-icon-utils-native_3.18.8.bb | 60 -- .../gtk+/gtk-icon-utils-native_3.20.6.bb | 60 ++ 13 files changed, 1061 insertions(+), 1261 deletions(-) delete mode 100644 meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch create mode 100644 meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch create mode 100644 meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch create mode 100644 meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch create mode 100644 meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch delete mode 100644 meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch delete mode 100644 meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch delete mode 100644 meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch delete mode 100644 meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb create mode 100644 meta/recipes-gnome/gtk+/gtk+3_3.20.6.bb delete mode 100644 meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb create mode 100644 meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.6.bb (limited to 'meta/recipes-gnome') diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc index 959fb441b2..132955797c 100644 --- a/meta/recipes-gnome/gtk+/gtk+3.inc +++ b/meta/recipes-gnome/gtk+/gtk+3.inc @@ -31,7 +31,9 @@ EXTRA_OECONF += " \ --enable-modules \ --disable-cups \ --disable-colord \ -" + WAYLAND_PROTOCOLS_SYSROOT_DIR=${STAGING_DIR}/${MACHINE} \ + " +EXTRA_OECONF[vardepsexclude] = "MACHINE" do_compile_prepend() { export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs" @@ -46,7 +48,7 @@ PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fon # 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 libxkbcommon virtual/mesa wayland-native" +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 @@ -76,6 +78,7 @@ FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \ 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 \ @@ -85,6 +88,7 @@ FILES_${PN}-dev += " \ ${bindir}/gtk-builder-convert \ ${bindir}/gtk-encode-symbolic-svg \ ${bindir}/gtk-builder-tool \ + ${bindir}/gtk-query-settings \ " GTKBASE_RRECOMMENDS ?= "liberation-fonts \ @@ -99,6 +103,7 @@ 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-.*" @@ -122,4 +127,3 @@ python populate_packages_prepend () { if (d.getVar('DEBIAN_NAMES', True)): d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0') } - diff --git a/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch b/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch deleted file mode 100644 index a963334d94..0000000000 --- a/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch +++ /dev/null @@ -1,965 +0,0 @@ -From c77afa19881d955d759879aeae8bbd88613dd4fe Mon Sep 17 00:00:00 2001 -From: Jussi Kukkonen -Date: Thu, 16 Jun 2016 15:11:34 +0300 -Subject: [PATCH] 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. -Long-term it would be good to find an alternative solution to this -(maybe a no-op backend for libepoxy?) - -Upstream-Status: Inappropriate [Evil eye expected from upstream] -Signed-off-by: Jussi Kukkonen ---- - configure.ac | 13 +++++++-- - demos/gtk-demo/glarea.c | 13 +++++++++ - 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 | 14 +++++++++- - gdk/x11/Makefile.am | 28 ++++++++++++++++--- - 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-with-gl-context.h | 59 +++++++++++++++++++++++++++++++++++++++ - gdk/x11/gdkx-without-gl-context.h | 58 ++++++++++++++++++++++++++++++++++++++ - gdk/x11/gdkx.h | 59 --------------------------------------- - gtk/Makefile.am | 3 +- - gtk/gtkglarea.c | 20 ++++++++++++- - gtk/inspector/general.c | 6 ++++ - tests/Makefile.am | 10 +++++-- - testsuite/gtk/objects-finalize.c | 2 ++ - 21 files changed, 257 insertions(+), 78 deletions(-) - create mode 100644 gdk/x11/gdkx-with-gl-context.h - create mode 100644 gdk/x11/gdkx-without-gl-context.h - delete mode 100644 gdk/x11/gdkx.h - -diff --git a/configure.ac b/configure.ac -index c280543..32da151 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -340,6 +340,15 @@ AC_ARG_ENABLE(mir-backend, - [enable the Mir gdk backend])], - [backend_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])]) -@@ -1330,7 +1339,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" -+GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends $EPOXY_PACKAGES" - - PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES) - GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB" -@@ -1364,7 +1373,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 c267706..b3bac86 100644 ---- a/demos/gtk-demo/glarea.c -+++ b/demos/gtk-demo/glarea.c -@@ -5,7 +5,9 @@ - - #include - #include -+#if HAVE_OPENGL - #include -+#endif - - static GtkWidget *demo_window = NULL; - -@@ -23,6 +25,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, -@@ -213,6 +217,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 -@@ -223,8 +228,10 @@ realize (GtkWidget *widget) - if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) - return; - -+#ifdef HAVE_OPENGL - init_buffers (&position_buffer, NULL); - init_shaders (&program, &mvp_location); -+#endif - } - - /* We should tear down the state when unrealizing */ -@@ -236,10 +243,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) - { -@@ -272,6 +282,7 @@ draw_triangle (void) - glBindBuffer (GL_ARRAY_BUFFER, 0); - glUseProgram (0); - } -+#endif - - static gboolean - render (GtkGLArea *area, -@@ -280,6 +291,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); -@@ -289,6 +301,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 892d6a7..8323768 100644 ---- a/gdk/gdkdisplay.c -+++ b/gdk/gdkdisplay.c -@@ -2285,7 +2285,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 85ce63d..d76e8dc 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) - { -@@ -205,6 +208,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data) - glUseProgram (paint_data->current_program->program); - } - } -+#endif - - void - gdk_gl_texture_quads (GdkGLContext *paint_context, -@@ -212,6 +216,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, - int n_quads, - GdkTexturedQuad *quads) - { -+#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); -@@ -275,6 +280,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 -@@ -323,6 +329,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; -@@ -643,6 +650,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, - if (clip_region) - cairo_region_destroy (clip_region); - -+#endif - } - - /* This is always called with the paint context current */ -@@ -650,6 +658,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; -@@ -750,4 +759,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 4d71353..9bb55ef 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; -@@ -238,6 +240,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, - int height, - guint texture_target) - { -+#ifdef HAVE_OPENGL - g_return_if_fail (GDK_IS_GL_CONTEXT (context)); - - glPixelStorei (GL_UNPACK_ALIGNMENT, 4); -@@ -245,6 +248,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, - glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, - cairo_image_surface_get_data (image_surface)); - glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); -+#endif - } - - static void -@@ -586,6 +590,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; - -@@ -628,6 +633,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 c34c113..3025e96 100644 ---- a/gdk/gdkwindow.c -+++ b/gdk/gdkwindow.c -@@ -44,7 +44,9 @@ - - #include - -+#ifdef HAVE_OPENGL - #include -+#endif - - /* for the use of round() */ - #include "fallback-c89.c" -@@ -1455,7 +1457,6 @@ gdk_window_new (GdkWindow *parent, - g_signal_connect (device_manager, "device-removed", - G_CALLBACK (device_removed_cb), window); - -- - if ((_gdk_gl_flags & (GDK_GL_ALWAYS | GDK_GL_DISABLE)) == GDK_GL_ALWAYS) - { - GError *error = NULL; -@@ -2761,6 +2762,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 +2965,7 @@ gdk_window_begin_paint_region (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 +2980,7 @@ gdk_window_begin_paint_region (GdkWindow *window, - glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - - glViewport (0, 0, ww, wh); -+#endif - } - } - -@@ -3119,6 +3129,7 @@ gdk_window_end_paint (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); -@@ -3129,6 +3140,7 @@ gdk_window_end_paint (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 c488a31..d0aa7ce 100644 ---- a/gdk/x11/Makefile.am -+++ b/gdk/x11/Makefile.am -@@ -39,8 +39,6 @@ libgdk_x11_la_SOURCES = \ - gdkeventtranslator.c \ - gdkeventtranslator.h \ - gdkgeometry-x11.c \ -- gdkglcontext-x11.c \ -- gdkglcontext-x11.h \ - gdkkeys-x11.c \ - gdkmain-x11.c \ - gdkproperty-x11.c \ -@@ -53,14 +51,30 @@ 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 -+ -+gdkx.h: -+ $(AM_V_GEN) cd $(srcdir) && cp $(GDKX_HEADER) gdkx.h -+ - libgdkx11include_HEADERS = \ - gdkx-autocleanups.h \ - gdkx11applaunchcontext.h \ -@@ -74,7 +88,6 @@ libgdkx11include_HEADERS = \ - gdkx11display.h \ - gdkx11displaymanager.h \ - gdkx11dnd.h \ -- gdkx11glcontext.h \ - gdkx11keys.h \ - gdkx11property.h \ - gdkx11screen.h \ -@@ -83,9 +96,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 5816d18..5d2dae6 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 -@@ -2989,8 +2991,8 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) - display_class->convert_selection = _gdk_x11_display_convert_selection; - 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; -- -+#ifdef HAVE_OPENGL - display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current; -- -+#endif - _gdk_x11_windowing_init (); - } -diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c -index 2bd7f28..30032e0 100644 ---- a/gdk/x11/gdkscreen-x11.c -+++ b/gdk/x11/gdkscreen-x11.c -@@ -1968,3 +1968,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 d08cee0..d354628 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" - -@@ -5768,7 +5770,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-with-gl-context.h b/gdk/x11/gdkx-with-gl-context.h -new file mode 100644 -index 0000000..ae05fa6 ---- /dev/null -+++ b/gdk/x11/gdkx-with-gl-context.h -@@ -0,0 +1,59 @@ -+/* 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 -+ -+#include -+ -+#undef __GDKX_H_INSIDE__ -+ -+#endif /* __GDK_X_H__ */ -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/gdk/x11/gdkx.h b/gdk/x11/gdkx.h -deleted file mode 100644 -index ae05fa6..0000000 ---- a/gdk/x11/gdkx.h -+++ /dev/null -@@ -1,59 +0,0 @@ --/* 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 -- --#include -- --#undef __GDKX_H_INSIDE__ -- --#endif /* __GDK_X_H__ */ -diff --git a/gtk/Makefile.am b/gtk/Makefile.am -index 801c3a5..2d8839d 100644 ---- a/gtk/Makefile.am -+++ b/gtk/Makefile.am -@@ -1246,14 +1246,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 4098409..45fa1d1 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 -@@ -357,9 +359,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 - */ -@@ -467,6 +472,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) - - priv->needs_render = TRUE; - } -+#endif - - /** - * gtk_gl_area_attach_buffers: -@@ -485,6 +491,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)); -@@ -517,11 +524,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) -@@ -553,6 +562,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area) - glDeleteFramebuffersEXT (1, &priv->frame_buffer); - priv->frame_buffer = 0; - } -+#endif - } - - static void -@@ -663,6 +673,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; - -@@ -674,7 +685,6 @@ gtk_gl_area_draw (GtkWidget *widget, - gtk_widget_get_allocated_height (widget)); - return FALSE; - } -- - if (priv->context == NULL) - return FALSE; - -@@ -720,6 +730,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 0611373..4499a29 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" -@@ -146,6 +148,7 @@ append_extension_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, -@@ -155,6 +158,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen, - append_extension_row (gen, ext, epoxy_has_glx_extension (dpy, 0, ext)); - } - #endif -+#endif - - #ifdef GDK_WINDOWING_WAYLAND - static void -@@ -174,6 +178,7 @@ init_gl (GtkInspectorGeneral *gen) - - display = gdk_display_get_default (); - -+#ifdef HAVE_OPENGL - #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_DISPLAY (display)) - { -@@ -199,6 +204,7 @@ init_gl (GtkInspectorGeneral *gen) - } - else - #endif -+#endif - #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (display)) - { -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 50f2986..3b39169 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -78,8 +78,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \ - testfullscreen \ - testgeometry \ - testgiconpixbuf \ -- testglarea \ -- testglblending \ - testgrid \ - testgtk \ - testheaderbar \ -@@ -166,10 +164,16 @@ noinst_PROGRAMS = $(TEST_PROGS) \ - testactionbar \ - testwindowsize \ - testpopover \ -- gdkgears \ - listmodel \ - $(NULL) - -+if HAVE_OPENGL -+noinst_PROGRAMS += -+ testglarea \ -+ testglblending \ -+ gdkgears -+endif -+ - if USE_X11 - noinst_PROGRAMS += testerrors - endif -diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c -index 3568505..682ea10 100644 ---- a/testsuite/gtk/objects-finalize.c -+++ b/testsuite/gtk/objects-finalize.c -@@ -114,8 +114,10 @@ main (int argc, char **argv) - all_types[i] != GDK_TYPE_X11_DISPLAY && - 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 && - all_types[i] != gdk_pixbuf_simple_anim_iter_get_type()) --- -2.8.1 - diff --git a/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch b/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch new file mode 100644 index 0000000000..0bda1f1074 --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch @@ -0,0 +1,47 @@ +From 5a73a5b92566e314bbc8a1bd40f1ec204837c111 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 23d3077..b6931d6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -610,7 +610,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 +@@ -876,7 +876,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/'` +@@ -1630,7 +1630,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.1.4 + diff --git a/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch b/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch new file mode 100644 index 0000000000..989716e513 --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch @@ -0,0 +1,60 @@ +From d63b926f8c8d8b5c9f9ec33d078b775f0409d88a 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 | 7 +++++++ + gdk/x11/gdkvisual-x11.c | 5 +++++ + 2 files changed, 12 insertions(+) + +diff --git a/configure.ac b/configure.ac +index b6931d6..e27da49 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -342,6 +342,13 @@ AC_ARG_ENABLE(mir-backend, + [enable the Mir gdk backend])], + [backend_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 + enable_win32_backend=yes +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.1.4 + diff --git a/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch b/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch new file mode 100644 index 0000000000..8552f53e3e --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch @@ -0,0 +1,832 @@ +From a8fa547fdc1416b330aced805f5343ad912932ae 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. +Long-term it would be good to find an alternative solution to this +(maybe a no-op backend for libepoxy?) + +Upstream-Status: Inappropriate [Evil eye expected from upstream] +Signed-off-by: Jussi Kukkonen +--- + configure.ac | 13 +++++-- + demos/gtk-demo/glarea.c | 13 +++++++ + 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} | 0 + 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, 201 insertions(+), 17 deletions(-) + rename gdk/x11/{gdkx.h => gdkx-with-gl-context.h} (100%) + create mode 100644 gdk/x11/gdkx-without-gl-context.h + +diff --git a/configure.ac b/configure.ac +index e27da49..a3e9beb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -342,6 +342,15 @@ AC_ARG_ENABLE(mir-backend, + [enable the Mir gdk backend])], + [backend_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])]) +@@ -1333,7 +1342,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" ++GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends $EPOXY_PACKAGES" + + PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES) + GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB" +@@ -1367,7 +1376,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 3aba729..c6c79f7 100644 +--- a/demos/gtk-demo/glarea.c ++++ b/demos/gtk-demo/glarea.c +@@ -5,7 +5,9 @@ + + #include + #include ++#if HAVE_OPENGL + #include ++#endif + + static GtkWidget *demo_window = NULL; + +@@ -23,6 +25,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, +@@ -213,6 +217,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 +@@ -223,8 +228,10 @@ realize (GtkWidget *widget) + if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) + return; + ++#ifdef HAVE_OPENGL + init_buffers (&position_buffer, NULL); + init_shaders (&program, &mvp_location); ++#endif + } + + /* We should tear down the state when unrealizing */ +@@ -236,10 +243,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) + { +@@ -272,6 +282,7 @@ draw_triangle (void) + glBindBuffer (GL_ARRAY_BUFFER, 0); + glUseProgram (0); + } ++#endif + + static gboolean + render (GtkGLArea *area, +@@ -280,6 +291,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); +@@ -289,6 +301,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 6150ef7..2223629 100644 +--- a/gdk/gdkdisplay.c ++++ b/gdk/gdkdisplay.c +@@ -2360,7 +2360,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 e8ba770..ba7c84b 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) + { +@@ -254,6 +257,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data) + glUseProgram (paint_data->current_program->program); + } + } ++#endif + + void + gdk_gl_texture_quads (GdkGLContext *paint_context, +@@ -261,6 +265,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, + int n_quads, + GdkTexturedQuad *quads) + { ++#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); +@@ -324,6 +329,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 +@@ -372,6 +378,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; +@@ -692,6 +699,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, + if (clip_region) + cairo_region_destroy (clip_region); + ++#endif + } + + /* This is always called with the paint context current */ +@@ -699,6 +707,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; +@@ -799,4 +808,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 00a33eb..bd8a793 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; +@@ -239,6 +241,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, + int height, + guint texture_target) + { ++#ifdef HAVE_OPENGL + g_return_if_fail (GDK_IS_GL_CONTEXT (context)); + + glPixelStorei (GL_UNPACK_ALIGNMENT, 4); +@@ -246,6 +249,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, + glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + cairo_image_surface_get_data (image_surface)); + glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); ++#endif + } + + static void +@@ -635,6 +639,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; + +@@ -677,6 +682,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 66ebb9d..74a0c3a 100644 +--- a/gdk/gdkwindow.c ++++ b/gdk/gdkwindow.c +@@ -44,7 +44,9 @@ + + #include + ++#ifdef HAVE_OPENGL + #include ++#endif + + /* for the use of round() */ + #include "fallback-c89.c" +@@ -2759,6 +2761,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, +@@ -2955,6 +2964,7 @@ gdk_window_begin_paint_region (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. */ +@@ -2969,6 +2979,7 @@ gdk_window_begin_paint_region (GdkWindow *window, + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + + glViewport (0, 0, ww, wh); ++#endif + } + } + +@@ -3117,6 +3128,7 @@ gdk_window_end_paint (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); +@@ -3127,6 +3139,7 @@ gdk_window_end_paint (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 c488a31..4ce3c07 100644 +--- a/gdk/x11/Makefile.am ++++ b/gdk/x11/Makefile.am +@@ -39,8 +39,6 @@ libgdk_x11_la_SOURCES = \ + gdkeventtranslator.c \ + gdkeventtranslator.h \ + gdkgeometry-x11.c \ +- gdkglcontext-x11.c \ +- gdkglcontext-x11.h \ + gdkkeys-x11.c \ + gdkmain-x11.c \ + gdkproperty-x11.c \ +@@ -53,14 +51,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 \ +@@ -74,7 +90,6 @@ libgdkx11include_HEADERS = \ + gdkx11display.h \ + gdkx11displaymanager.h \ + gdkx11dnd.h \ +- gdkx11glcontext.h \ + gdkx11keys.h \ + gdkx11property.h \ + gdkx11screen.h \ +@@ -83,9 +98,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 de91c64..42d50f6 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 +@@ -2959,7 +2961,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 9d8ed20..bd46b00 100644 +--- a/gdk/x11/gdkscreen-x11.c ++++ b/gdk/x11/gdkscreen-x11.c +@@ -1968,3 +1968,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 9ed087a..30d6eb7 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" + +@@ -5782,7 +5784,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 100% +rename from gdk/x11/gdkx.h +rename to gdk/x11/gdkx-with-gl-context.h +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 6a53a2b..49a35e6 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -1351,14 +1351,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 245fc6b..4214ad1 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 +@@ -357,9 +359,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 + */ +@@ -467,6 +472,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) + + priv->needs_render = TRUE; + } ++#endif + + /** + * gtk_gl_area_attach_buffers: +@@ -485,6 +491,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)); +@@ -517,11 +524,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) +@@ -553,6 +562,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area) + glDeleteFramebuffersEXT (1, &priv->frame_buffer); + priv->frame_buffer = 0; + } ++#endif + } + + static void +@@ -663,6 +673,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; + +@@ -674,7 +685,6 @@ gtk_gl_area_draw (GtkWidget *widget, + gtk_widget_get_allocated_height (widget)); + return FALSE; + } +- + if (priv->context == NULL) + return FALSE; + +@@ -720,6 +730,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 4eab3a7..c4e900e 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" +@@ -147,6 +149,7 @@ append_extension_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, +@@ -156,6 +159,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen, + append_extension_row (gen, ext, epoxy_has_glx_extension (dpy, 0, ext)); + } + #endif ++#endif + + #ifdef GDK_WINDOWING_WAYLAND + static void +@@ -171,6 +175,7 @@ append_egl_extension_row (GtkInspectorGeneral *gen, + static void + init_gl (GtkInspectorGeneral *gen) + { ++#ifdef HAVE_OPENGL + #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) + { +@@ -197,6 +202,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 681807d..2941a36 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 \ +@@ -169,11 +167,17 @@ noinst_PROGRAMS = $(TEST_PROGS) \ + testactionbar \ + testwindowsize \ + testpopover \ +- gdkgears \ + listmodel \ + testpopup \ + $(NULL) + ++if HAVE_OPENGL ++noinst_PROGRAMS += ++ testglarea \ ++ testglblending \ ++ gdkgears ++endif ++ + if USE_X11 + noinst_PROGRAMS += testerrors + endif +diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c +index e0ebee0..703643c 100644 +--- a/testsuite/gtk/objects-finalize.c ++++ b/testsuite/gtk/objects-finalize.c +@@ -115,8 +115,10 @@ 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 && + all_types[i] != gdk_pixbuf_simple_anim_iter_get_type()) +-- +2.1.4 + diff --git a/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch b/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch new file mode 100644 index 0000000000..634b3a46ff --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch @@ -0,0 +1,36 @@ +From 97b78e566634579bbae51be914aeaaa921137a8b Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Thu, 9 Jun 2016 11:21:36 +0300 +Subject: [PATCH 4/4] configure.ac: Fix wayland-protocols path + +The wayland-protocols directory is used during build: Fix the path +to point to sysroot specified in recipe. + +Normally PKG_CONFIG_SYSROOT_DIR could be used in configure.ac but that +breaks multilib gtk+ as it would point to multilib sysroot when the +(allarch) wayland-protocols is actually in the machine sysroot. + +Signed-off-by: Jussi Kukkonen +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Jussi Kukkonen +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index a3e9beb..dde9dc5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -461,7 +461,7 @@ fi + if test "$enable_wayland_backend" = "yes"; then + # For the cairo image backend + cairo_backends="$cairo_backends cairo" +- AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) ++ AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, ${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) + GDK_BACKENDS="$GDK_BACKENDS wayland" + GDK_WINDOWING="$GDK_WINDOWING + #define GDK_WINDOWING_WAYLAND" +-- +2.1.4 + diff --git a/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch b/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch deleted file mode 100644 index c8c480c5eb..0000000000 --- a/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch +++ /dev/null @@ -1,60 +0,0 @@ -From fc22058a10db913534f11348f86681fe9e1838e5 Mon Sep 17 00:00:00 2001 -From: Jussi Kukkonen -Date: Fri, 16 Oct 2015 16:35:16 +0300 -Subject: [PATCH] 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 | 7 +++++++ - gdk/x11/gdkvisual-x11.c | 5 +++++ - 2 files changed, 12 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 729a62e..58cc1ac 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -328,6 +328,13 @@ AC_ARG_ENABLE(mir-backend, - [enable the Mir gdk backend])], - [backend_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 - enable_win32_backend=yes -diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c -index f3b062d..c8243f4 100644 ---- a/gdk/x11/gdkvisual-x11.c -+++ b/gdk/x11/gdkvisual-x11.c -@@ -345,7 +345,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.1.4 - diff --git a/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch b/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch deleted file mode 100644 index 32d8a84792..0000000000 --- a/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch +++ /dev/null @@ -1,118 +0,0 @@ -window: Check if we can use CSD before enabling them - -Upstream-Status: Backport -Signed-off-by: Jussi Kukkonen - - -From c5e5ee67490e7e7af56052d8f8beb75db002c2f1 Mon Sep 17 00:00:00 2001 -From: Emmanuele Bassi -Date: Wed, 3 Jun 2015 14:07:29 +0100 -Subject: window: Check if we can use CSD before enabling them - -The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules -as to when CSD can be enabled, but it also unconditionally enables CSD -with the implicit assumption that client-side shadows were the real -issue, and that we could work around that by drawing our own borders. -This also means that setting a titlebar for a GtkWindow will enable CSD -unconditionally. - -In reality, some window managers (like Matchbox) *only* support -server-side decorations, and will ignore all hints to the contrary, to -the point of drawing decorations at random locations on top of the -window. - -Since CSD are enabled unconditionally, the GTK_CSD environment variable -is also not a suitable escape hatch. - -In the grand tradition of asking ourselves if we should do something -just because we can, we should split the environment checks from the -checks on what the user requested; by doing that, we can also check -when enabling client-side decorations, and ideally bail out if needed. - -https://bugzilla.gnome.org/show_bug.cgi?id=750343 - -diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c -index 423c6bd..9fe882f 100644 ---- a/gtk/gtkwindow.c -+++ b/gtk/gtkwindow.c -@@ -4056,6 +4056,32 @@ gtk_window_supports_client_shadow (GtkWindow *window) - return TRUE; - } - -+static gboolean -+gtk_window_can_use_csd (GtkWindow *window) -+{ -+ const gchar *csd_env; -+ -+#ifdef GDK_WINDOWING_BROADWAY -+ if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -+ return TRUE; -+#endif -+ -+#ifdef GDK_WINDOWING_WAYLAND -+ if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -+ return TRUE; -+#endif -+ -+#ifdef GDK_WINDOWING_MIR -+ if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -+ return TRUE; -+#endif -+ -+ csd_env = g_getenv ("GTK_CSD"); -+ -+ /* If GTK_CSD is unset we default to CSD support */ -+ return csd_env == NULL || (strcmp (csd_env, "1") == 0); -+} -+ - static void - gtk_window_enable_csd (GtkWindow *window) - { -@@ -4063,6 +4089,10 @@ gtk_window_enable_csd (GtkWindow *window) - GtkWidget *widget = GTK_WIDGET (window); - GdkVisual *visual; - -+ /* If the environment does not support CSD, then there's no point in enabling them */ -+ if (!gtk_window_can_use_csd (window)) -+ return; -+ - /* We need a visual with alpha for client shadows */ - if (priv->use_client_shadow) - { -@@ -5839,7 +5869,6 @@ static gboolean - gtk_window_should_use_csd (GtkWindow *window) - { - GtkWindowPrivate *priv = window->priv; -- const gchar *csd_env; - - if (priv->csd_requested) - return TRUE; -@@ -5850,24 +5879,7 @@ gtk_window_should_use_csd (GtkWindow *window) - if (priv->type == GTK_WINDOW_POPUP) - return FALSE; - --#ifdef GDK_WINDOWING_BROADWAY -- if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -- return TRUE; --#endif -- --#ifdef GDK_WINDOWING_WAYLAND -- if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -- return TRUE; --#endif -- --#ifdef GDK_WINDOWING_MIR -- if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) -- return TRUE; --#endif -- -- csd_env = g_getenv ("GTK_CSD"); -- -- return (g_strcmp0 (csd_env, "1") == 0); -+ return gtk_window_can_use_csd (window); - } - - static void --- -cgit v0.10.2 - diff --git a/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch b/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch deleted file mode 100644 index 3b4beeb712..0000000000 --- a/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch +++ /dev/null @@ -1,35 +0,0 @@ -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: Marko Lindqvist - -Index: gtk+-3.8.2/configure.ac -=================================================================== ---- gtk+-3.8.2.orig/configure.ac -+++ gtk+-3.8.2/configure.ac -@@ -531,7 +531,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 -@@ -793,7 +793,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/'` -@@ -1528,7 +1528,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/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb b/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb deleted file mode 100644 index d776b6d40e..0000000000 --- a/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb +++ /dev/null @@ -1,20 +0,0 @@ -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://hardcoded_libtool.patch \ - file://Dont-force-csd.patch \ - file://Do-not-try-to-initialize-GL-without-libGL.patch \ - file://0001-Add-disable-opengl-configure-option.patch \ - " - -SRC_URI[md5sum] = "9671acb41dc13561d19233f1a75cf184" -SRC_URI[sha256sum] = "1c53ef1bb55364698f7183ecd185b547f92f4a3a7abfafd531400232e2e052f8" - -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/meta/recipes-gnome/gtk+/gtk+3_3.20.6.bb b/meta/recipes-gnome/gtk+/gtk+3_3.20.6.bb new file mode 100644 index 0000000000..453a4e296e --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3_3.20.6.bb @@ -0,0 +1,19 @@ +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 \ + file://0004-configure.ac-Fix-wayland-protocols-path.patch \ + " +SRC_URI[md5sum] = "914e55ea053161f4a575c1c8dade7954" +SRC_URI[sha256sum] = "3f8016563a96b1cfef4ac9e795647f6316deb2978ff939b19e4e4f8f936fa4b2" + +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/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb deleted file mode 100644 index 793f14a545..0000000000 --- a/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb +++ /dev/null @@ -1,60 +0,0 @@ -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] = "9671acb41dc13561d19233f1a75cf184" -SRC_URI[sha256sum] = "1c53ef1bb55364698f7183ecd185b547f92f4a3a7abfafd531400232e2e052f8" - -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 upstream-version-is-even - -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/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.6.bb b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.6.bb new file mode 100644 index 0000000000..e870ba3137 --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.6.bb @@ -0,0 +1,60 @@ +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] = "914e55ea053161f4a575c1c8dade7954" +SRC_URI[sha256sum] = "3f8016563a96b1cfef4ac9e795647f6316deb2978ff939b19e4e4f8f936fa4b2" + +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 upstream-version-is-even + +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 +} -- cgit 1.2.3-korg