summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-gnome')
-rw-r--r--meta/recipes-gnome/gtk+/gtk+3/cross.patch284
-rw-r--r--meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb111
2 files changed, 395 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gtk+/gtk+3/cross.patch b/meta/recipes-gnome/gtk+/gtk+3/cross.patch
new file mode 100644
index 0000000000..7b2a1583b6
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3/cross.patch
@@ -0,0 +1,284 @@
1Upstream-Status: Submitted [#691301]
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 2ce72e5d53e84a2eba8c3f2cb6af25ffffc46ea9 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Mon, 7 Jan 2013 12:49:27 +0000
7Subject: [PATCH] build: support cross-compilation by natively building
8 gtk-update-icon-cache
9
10When cross-compiling, instead of depending on a natively built GTK+ (which means
11building Glib, ATK, Pango, gdk-pixbuf, libX11...) for gtk-update-icon-cache,
12find the host compiler and gdk-pixbuf, and build another gtk-update-icon-cache
13with that.
14
15This uses AX_PROG_CC_FOR_BUILD from autostars to find the host compiler, and
16assumes that you'd set PKG_CONFIG_FOR_BUILD to a host pkg-config binary.
17
18https://bugzilla.gnome.org/show_bug.cgi?id=691301
19---
20 configure.ac | 25 +++++++--
21 gtk/Makefile.am | 12 ++++-
22 gtk/native/Makefile.am | 12 +++++
23 m4/ax_prog_cc_for_build.m4 | 125 ++++++++++++++++++++++++++++++++++++++++++++
24 4 files changed, 168 insertions(+), 6 deletions(-)
25 create mode 100644 gtk/native/Makefile.am
26 create mode 100644 m4/ax_prog_cc_for_build.m4
27
28diff --git a/configure.ac b/configure.ac
29index 0069a9f..35b5f27 100644
30--- a/configure.ac
31+++ b/configure.ac
32@@ -29,6 +29,9 @@ AC_CONFIG_SRCDIR([gdk/gdktypes.h])
33 AC_CONFIG_MACRO_DIR([m4])
34 AC_CONFIG_AUX_DIR([build-aux])
35
36+AC_CANONICAL_HOST
37+AC_CANONICAL_TARGET
38+
39 # Define a string for the earliest version that this release has
40 # backwards binary compatibility with for all interfaces a module
41 # might. Unless we add module-only API with lower stability
42@@ -123,6 +126,7 @@ AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
43
44 # Checks for programs.
45 AC_PROG_CC
46+AX_PROG_CC_FOR_BUILD
47 AC_PROG_CC_C_O
48 AC_PROG_CC_STDC
49 AC_PROG_MKDIR_P
50@@ -135,8 +139,6 @@ AC_SUBST(GETTEXT_PACKAGE)
51 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
52 [The prefix for our gettext translation domains.])
53
54-AC_CANONICAL_HOST
55-
56 MATH_LIB=-lm
57 AC_MSG_CHECKING([for native Win32])
58 LIB_EXE_MACHINE_FLAG=X86
59@@ -868,14 +870,28 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
60
61 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
62
63-if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
64+if test "x$enable_gtk2_dependency" = xyes; then
65 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
66 if test x$GTK_UPDATE_ICON_CACHE = xno; then
67 REBUILD_PNGS=#
68 fi
69+elif test "x$cross_compiling" = xyes; then
70+ # If no GTK+2 dependency and cross compiling, we need to find a host gdk-pixbuf.
71+ # pkg.m4 blocks all variable starting with PKG, so allow this one
72+ m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
73+ AC_MSG_CHECKING([for native gdk-pixbuf])
74+ if AC_RUN_LOG([$PKG_CONFIG_FOR_BUILD --exists --print-errors gdk-pixbuf-2.0]); then
75+ AC_MSG_RESULT([yes])
76+ else
77+ AC_MSG_ERROR([native gdk-pixbuf not found])
78+ fi
79+ NATIVE_GDKPIXBUF_CFLAGS=`$PKG_CONFIG_FOR_BUILD --cflags gdk-pixbuf-2.0`
80+ NATIVE_GDKPIXBUF_LIBS=`$PKG_CONFIG_FOR_BUILD --libs gdk-pixbuf-2.0`
81+ AC_SUBST(NATIVE_GDKPIXBUF_CFLAGS)
82+ AC_SUBST(NATIVE_GDKPIXBUF_LIBS)
83 fi
84
85-AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
86+AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$enable_gtk2_dependency" = xyes])
87
88 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
89
90@@ -1742,6 +1758,7 @@ gtk/makefile.msc
91 gtk/gtkversion.h
92 gtk/gtk-win32.rc
93 gtk/a11y/Makefile
94+gtk/native/Makefile
95 gtk/tests/Makefile
96 libgail-util/Makefile
97 modules/Makefile
98diff --git a/gtk/Makefile.am b/gtk/Makefile.am
99index e763ca8..6b1ec65 100644
100--- a/gtk/Makefile.am
101+++ b/gtk/Makefile.am
102@@ -16,7 +16,7 @@ else
103 GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
104 endif
105
106-SUBDIRS = a11y . tests
107+SUBDIRS = a11y native . tests
108
109 if HAVE_PAPI_CUPS
110 GTK_PRINT_BACKENDS=file,papi,cups
111@@ -1569,12 +1569,20 @@ stamp-icons: $(STOCK_ICONS)
112 if USE_EXTERNAL_ICON_CACHE
113 gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
114 else
115+if CROSS_COMPILING
116+gtk_update_icon_cache_program = ./native/native-update-icon-cache
117+else
118 gtk_update_icon_cache_program = ./gtk-update-icon-cache
119 endif
120+endif
121
122 gtkbuiltincache.h: @REBUILD@ stamp-icons
123 if !USE_EXTERNAL_ICON_CACHE
124- $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
125+if CROSS_COMPILING
126+ $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) -C native/
127+else
128+ $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
129+endif
130 endif
131 $(AM_V_GEN) $(gtk_update_icon_cache_program) --quiet --force --ignore-theme-index \
132 --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
133diff --git a/gtk/native/Makefile.am b/gtk/native/Makefile.am
134new file mode 100644
135index 0000000..4f029f6
136--- /dev/null
137+++ b/gtk/native/Makefile.am
138@@ -0,0 +1,12 @@
139+CC = @CC_FOR_BUILD@
140+CFLAGS = @CFLAGS_FOR_BUILD@
141+CPP = @CPP_FOR_BUILD@
142+CPPFLAGS = @CPPFLAGS_FOR_BUILD@
143+LDFLAGS = @LDFLAGS_FOR_BUILD@
144+
145+if CROSS_COMPILING
146+noinst_PROGRAMS = native-update-icon-cache
147+native_update_icon_cache_CFLAGS = $(NATIVE_GDKPIXBUF_CFLAGS)
148+native_update_icon_cache_LDADD = $(NATIVE_GDKPIXBUF_LIBS)
149+native_update_icon_cache_SOURCES = $(srcdir)/../updateiconcache.c
150+endif
151diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4
152new file mode 100644
153index 0000000..96cd98a
154--- /dev/null
155+++ b/m4/ax_prog_cc_for_build.m4
156@@ -0,0 +1,125 @@
157+# ===========================================================================
158+# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
159+# ===========================================================================
160+#
161+# SYNOPSIS
162+#
163+# AX_PROG_CC_FOR_BUILD
164+#
165+# DESCRIPTION
166+#
167+# This macro searches for a C compiler that generates native executables,
168+# that is a C compiler that surely is not a cross-compiler. This can be
169+# useful if you have to generate source code at compile-time like for
170+# example GCC does.
171+#
172+# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
173+# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
174+# The value of these variables can be overridden by the user by specifying
175+# a compiler with an environment variable (like you do for standard CC).
176+#
177+# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
178+# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
179+# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
180+# substituted in the Makefile.
181+#
182+# LICENSE
183+#
184+# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
185+#
186+# Copying and distribution of this file, with or without modification, are
187+# permitted in any medium without royalty provided the copyright notice
188+# and this notice are preserved. This file is offered as-is, without any
189+# warranty.
190+
191+#serial 7
192+
193+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
194+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
195+AC_REQUIRE([AC_PROG_CC])dnl
196+AC_REQUIRE([AC_PROG_CPP])dnl
197+AC_REQUIRE([AC_EXEEXT])dnl
198+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
199+
200+dnl Use the standard macros, but make them use other variable names
201+dnl
202+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
203+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
204+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
205+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
206+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
207+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
208+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
209+pushdef([ac_exeext], ac_build_exeext)dnl
210+pushdef([ac_objext], ac_build_objext)dnl
211+pushdef([CC], CC_FOR_BUILD)dnl
212+pushdef([CPP], CPP_FOR_BUILD)dnl
213+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
214+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
215+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
216+pushdef([host], build)dnl
217+pushdef([host_alias], build_alias)dnl
218+pushdef([host_cpu], build_cpu)dnl
219+pushdef([host_vendor], build_vendor)dnl
220+pushdef([host_os], build_os)dnl
221+pushdef([ac_cv_host], ac_cv_build)dnl
222+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
223+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
224+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
225+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
226+pushdef([ac_cpp], ac_build_cpp)dnl
227+pushdef([ac_compile], ac_build_compile)dnl
228+pushdef([ac_link], ac_build_link)dnl
229+
230+save_cross_compiling=$cross_compiling
231+save_ac_tool_prefix=$ac_tool_prefix
232+cross_compiling=no
233+ac_tool_prefix=
234+
235+AC_PROG_CC
236+AC_PROG_CPP
237+AC_EXEEXT
238+
239+ac_tool_prefix=$save_ac_tool_prefix
240+cross_compiling=$save_cross_compiling
241+
242+dnl Restore the old definitions
243+dnl
244+popdef([ac_link])dnl
245+popdef([ac_compile])dnl
246+popdef([ac_cpp])dnl
247+popdef([ac_cv_host_os])dnl
248+popdef([ac_cv_host_vendor])dnl
249+popdef([ac_cv_host_cpu])dnl
250+popdef([ac_cv_host_alias])dnl
251+popdef([ac_cv_host])dnl
252+popdef([host_os])dnl
253+popdef([host_vendor])dnl
254+popdef([host_cpu])dnl
255+popdef([host_alias])dnl
256+popdef([host])dnl
257+popdef([LDFLAGS])dnl
258+popdef([CPPFLAGS])dnl
259+popdef([CFLAGS])dnl
260+popdef([CPP])dnl
261+popdef([CC])dnl
262+popdef([ac_objext])dnl
263+popdef([ac_exeext])dnl
264+popdef([ac_cv_objext])dnl
265+popdef([ac_cv_exeext])dnl
266+popdef([ac_cv_prog_cc_g])dnl
267+popdef([ac_cv_prog_cc_cross])dnl
268+popdef([ac_cv_prog_cc_works])dnl
269+popdef([ac_cv_prog_gcc])dnl
270+popdef([ac_cv_prog_CPP])dnl
271+
272+dnl Finally, set Makefile variables
273+dnl
274+BUILD_EXEEXT=$ac_build_exeext
275+BUILD_OBJEXT=$ac_build_objext
276+AC_SUBST(BUILD_EXEEXT)dnl
277+AC_SUBST(BUILD_OBJEXT)dnl
278+AC_SUBST([CFLAGS_FOR_BUILD])dnl
279+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
280+AC_SUBST([LDFLAGS_FOR_BUILD])dnl
281+])
282--
2831.7.10.4
284
diff --git a/meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb b/meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb
new file mode 100644
index 0000000000..e6243877dd
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb
@@ -0,0 +1,111 @@
1SUMMARY = "Multi-platform toolkit for creating GUIs"
2DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
3set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
4HOMEPAGE = "http://www.gtk.org"
5BUGTRACKER = "https://bugzilla.gnome.org/"
6SECTION = "libs"
7
8DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor \
9 docbook-utils-native libxrandr libgcrypt \
10 libxdamage libxrender libxcomposite libxi cairo gdk-pixbuf gdk-pixbuf-native"
11
12LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
15 file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
16 file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
17 file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
18
19SRC_URI = "http://download.gnome.org/sources/gtk+/3.4/gtk+-${PV}.tar.xz \
20 file://cross.patch"
21SRC_URI[md5sum] = "1b2cf29502a6394e8d4b30f7f5bb9131"
22SRC_URI[sha256sum] = "f154e460075034da4c0ce89c320025dcd459da2a1fdf32d92a09522eaca242c7"
23
24inherit autotools pkgconfig gtk-doc update-alternatives
25
26S = "${WORKDIR}/gtk+-${PV}"
27
28# This should be in autotools.bbclass, but until something elses uses it putting
29# it here avoids rebuilding everything.
30export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
31
32do_configure_prepend() {
33 # Do this because the configure script is running ./libtool directly
34 ln -s ${TARGET_PREFIX}libtool libtool || true
35}
36
37# Forcibly disable the GTK+ 2 dependency as we don't want to natively build the
38# entire GTK+ stack, or need GTK+ 2 for gtk-update-icon-cache.
39EXTRA_OECONF += " \
40 --disable-gtk2-dependency \
41 --disable-glibtest \
42 --enable-modules \
43 --disable-cups \
44"
45
46do_install_append() {
47 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
48}
49
50PACKAGES =+ "${PN}-demo"
51LIBV = "3.0.0"
52
53FILES_${PN}-demo = "${bindir}/gtk3-demo \
54 ${bindir}/gtk3-demo-application \
55 ${bindir}/gtk3-widget-factory \
56 ${datadir}/gtk-3.0/demo"
57
58FILES_${PN} = "${bindir}/gtk-update-icon-cache-3.0 \
59 ${bindir}/gtk-query-immodules-3.0 \
60 ${bindir}/gtk-launch \
61 ${libdir}/lib*${SOLIBS} \
62 ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
63 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
64 ${libdir}/gtk-3.0/modules/*.so"
65
66FILES_${PN}-dev += " \
67 ${datadir}/gtk-3.0/gtkbuilder.rng \
68 ${datadir}/gtk-3.0/include \
69 ${libdir}/gtk-3.0/include \
70 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
71 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
72 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
73 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
74 ${libdir}/gtk-3.0/modules/*.la \
75 ${bindir}/gtk-builder-convert"
76
77FILES_${PN}-dbg += " \
78 ${libdir}/gtk-3.0/${LIBV}/loaders/.debug \
79 ${libdir}/gtk-3.0/${LIBV}/immodules/.debug \
80 ${libdir}/gtk-3.0/${LIBV}/engines/.debug \
81 ${libdir}/gtk-3.0/${LIBV}/printbackends/.debug \
82 ${libdir}/gtk-3.0/modules/.debug"
83
84
85PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
86
87ALTERNATIVE_${PN} = "gtk-update-icon-cache"
88ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
89
90python populate_packages_prepend () {
91 import os.path
92
93 prologue = d.getVar("postinst_prologue", 1)
94
95 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
96 immodules_root = os.path.join(gtk_libdir, 'immodules')
97 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
98
99 do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-3.0 > /etc/gtk-3.0/gtk.immodules')
100 do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
101
102 if (d.getVar('DEBIAN_NAMES', 1)):
103 d.setVar('PKG_${PN}', 'libgtk-3.0')
104}
105
106postinst_prologue() {
107if [ "x$D" != "x" ]; then
108 exit 1
109fi
110
111}