From 335e3e1d359369e6f56b438394baf388eefafe2d Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Wed, 1 Oct 2014 01:51:27 +0300 Subject: [PATCH] glib-2.0: add and enable 2.40.2 --- .../angstrom-2008-preferred-versions.inc | 6 +- ...not-use-readlink-when-cross-compilin.patch | 31 ++++++ .../glib-2.0/glib-2.0/Makefile-ptest.patch | 61 ------------ ...march-i486-into-CFLAGS-automatically.patch | 39 ++++++++ ...dia-sdX-drive-mount-if-username-root.patch | 39 ++++++++ .../glib-2.0-configure-readlink.patch | 29 ++++++ recipes/glib-2.0/glib-2.0/ptest-paths.patch | 30 ++++++ recipes/glib-2.0/glib-2.0/run-ptest | 4 +- recipes/glib-2.0/glib-2.0/uclibc.patch | 20 ++++ recipes/glib-2.0/glib-2.0_2.40.2.bb | 99 +++++++++++++++++++ 10 files changed, 292 insertions(+), 66 deletions(-) create mode 100644 recipes/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch delete mode 100644 recipes/glib-2.0/glib-2.0/Makefile-ptest.patch create mode 100644 recipes/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch create mode 100644 recipes/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch create mode 100644 recipes/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch create mode 100644 recipes/glib-2.0/glib-2.0/ptest-paths.patch create mode 100644 recipes/glib-2.0/glib-2.0/uclibc.patch create mode 100644 recipes/glib-2.0/glib-2.0_2.40.2.bb diff --git a/conf/distro/include/angstrom-2008-preferred-versions.inc b/conf/distro/include/angstrom-2008-preferred-versions.inc index 074dd02a38..aa3e1a4f91 100644 --- a/conf/distro/include/angstrom-2008-preferred-versions.inc +++ b/conf/distro/include/angstrom-2008-preferred-versions.inc @@ -8,9 +8,9 @@ PREFERRED_VERSION_cairo = "1.8.10" PREFERRED_VERSION_dbus = "1.2.22" PREFERRED_VERSION_dropbear = "0.51" PREFERRED_VERSION_fontconfig = "2.8.0" -PREFERRED_VERSION_glib-2.0 = "2.24.0" -PREFERRED_VERSION_glib-2.0-native = "2.24.0" -PREFERRED_VERSION_glibmm = "2.24.0" +PREFERRED_VERSION_glib-2.0 = "2.40.2" +PREFERRED_VERSION_glib-2.0-native = "2.40.2" +PREFERRED_VERSION_glibmm = "2.40.2" PREFERRED_VERSION_gst-pulse = "0.9.7" PREFERRED_VERSION_gtk+ = "2.20.0" PREFERRED_VERSION_gtk+-native = "2.20.0" diff --git a/recipes/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch b/recipes/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch new file mode 100644 index 0000000000..0be36316b9 --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch @@ -0,0 +1,31 @@ +commit 9b38d507ec37b3d7d4df6095fa7ed16b47d399f7 +Author: Drew Moseley +Date: Sat Mar 29 21:10:43 2014 -0400 + + configure.ac: Do not use readlink when cross compiling. + + Do not use readlink to set ABS_GLIB_RUNTIME_LIBDIR when cross + compiling. Doing so causes host paths to potentially pollute + the target. + + Note that in this case the path is not converted to absolute if + it contains any ".." references so it's not completely correct. + + Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=727575] + Signed-off-by: Drew Moseley + +diff -rub glib-2.38.2.orig/configure.ac glib-2.38.2/configure.ac +--- glib-2.38.2.orig/configure.ac 2014-04-03 20:17:13.035567143 -0400 ++++ glib-2.38.2/configure.ac 2014-04-03 20:19:07.071566057 -0400 +@@ -275,7 +275,11 @@ + [], + [with_runtime_libdir=""]) + GLIB_RUNTIME_LIBDIR="$with_runtime_libdir" ++AS_IF([ test $cross_compiling = yes ], [ ++ABS_GLIB_RUNTIME_LIBDIR="$libdir/$with_runtime_libdir" ++], [ + ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`" ++]) + AC_SUBST(GLIB_RUNTIME_LIBDIR) + AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR) + AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"]) diff --git a/recipes/glib-2.0/glib-2.0/Makefile-ptest.patch b/recipes/glib-2.0/glib-2.0/Makefile-ptest.patch deleted file mode 100644 index cb36c09bce..0000000000 --- a/recipes/glib-2.0/glib-2.0/Makefile-ptest.patch +++ /dev/null @@ -1,61 +0,0 @@ -Add 'ptest' target to Makefile, to run tests without checking dependencies. -Add 'install-ptest' target, to copy needed files to ptest dir. - -Signed-off-by: Björn Stenberg -Upstream-status: Pending ---- - Makefile.decl | 43 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 43 insertions(+) - ---- a/Makefile.decl 2012-03-12 01:42:39.000000000 +0100 -+++ b/Makefile.decl 2012-11-26 13:42:08.436865192 +0100 -@@ -25,6 +25,49 @@ - test-nonrecursive: - endif - -+ptest: ptest-nonrecursive -+ @ for subdir in $(SUBDIRS) .; do \ -+ test -d "$$subdir" -a "$$subdir" != "." -a "$$subdir" != "po" && \ -+ ( test -d $$subdir && cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) \ -+ done -+ -+ptest-nonrecursive: -+ @test -z "${TEST_PROGS}" || ${GTESTER} --keep-going --verbose ${TEST_PROGS} -+ -+install-ptest: install-ptest-nonrecursive -+ @test -z "$(SUBDIRS)" || for subdir in $(SUBDIRS); do \ -+ test "$$subdir" == "." || \ -+ (cd $$subdir && $(MAKE) DESTDIR=$(DESTDIR)/$$subdir $@ ) \ -+ done -+ -+# install files used for ptest: -+# - copy EXTRA_DIST (for test data in glib/tests) -+# - run dist-hook (for glib/tests/bookmarks/ and glib/tests/markups) -+# - copy TEST_PROGS (the test programs) -+# - copy INSTALL_PROGS (for glib/gtester) -+# - avoid libtool wrappers by copying binaries from .libs -+# - strip Makefile: target from all Makefiles -+install-ptest-nonrecursive: -+ @mkdir -p $(DESTDIR) -+ @if [ -n "${TEST_PROGS}" ]; then \ -+ if [ -n "${EXTRA_DIST}" ]; then \ -+ cp ${EXTRA_DIST} $(DESTDIR); \ -+ fi; \ -+ grep -q dist-hook: Makefile && \ -+ $(MAKE) distdir=$(DESTDIR) dist-hook; \ -+ if [ -d .libs ] ; then \ -+ cd .libs; \ -+ fi; \ -+ cp ${TEST_PROGS} $(DESTDIR); \ -+ fi; -+ @if [ -n "${INSTALL_PROGS}" ]; then \ -+ if [ -d .libs ] ; then \ -+ cd .libs; \ -+ fi; \ -+ cp ${INSTALL_PROGS} $(DESTDIR); \ -+ fi -+ @test -f Makefile && sed 's/^Makefile:/_Makefile:/' $(DESTDIR)/Makefile -+ - # test-report: run tests in subdirs and generate report - # perf-report: run tests in subdirs with -m perf and generate report - # full-report: like test-report: with -m perf and -m slow diff --git a/recipes/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch b/recipes/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch new file mode 100644 index 0000000000..3aac35a5d3 --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch @@ -0,0 +1,39 @@ +From 55253b55b9c65f3e0efbbe03cbab2a4c4014a16b Mon Sep 17 00:00:00 2001 +From: Song.Li +Date: Thu, 5 Jul 2012 15:09:41 +0800 +Subject: [PATCH] add -march=i486 into CFLAGS automatically + +Upstream-Status: Inappropriate [configuration] + +glib configure will check if current gcc need -march=i486, +when gcc need -march=i486 but CFLAGS don't have, +glib configure will abort and advise the user to add -march=i486 or later. +This will break the build process,it's not good for automatic build system. +so change this to adding -march=i485 automatically when it is needed. +--- + configure.ac | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +Index: glib-2.36.0/configure.ac +=================================================================== +--- glib-2.36.0.orig/configure.ac ++++ glib-2.36.0/configure.ac +@@ -2378,7 +2378,7 @@ dnl + dnl Note that the atomic ops are only available with GCC on x86 when + dnl using -march=i486 or higher. If we detect that the atomic ops are + dnl not available but would be available given the right flags, we want +-dnl to abort and advise the user to fix their CFLAGS. It's better to do ++dnl to add -march=i486 automatically to fix their CFLAGS. It's better to do + dnl that then to silently fall back on emulated atomic ops just because + dnl the user had the wrong build environment. + +@@ -2401,7 +2401,8 @@ AC_CACHE_CHECK([for lock-free atomic int + AC_TRY_COMPILE([], + [volatile int atomic = 2;\ + __sync_bool_compare_and_swap (&atomic, 2, 3);], +- [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])], ++ [AC_MSG_WARN([GLib must be build with -march=i486 or later.]) ++ SAVE_CFLAGS="${SAVE_CFLAGS} -march=i486"], + []) + CFLAGS="${SAVE_CFLAGS}" + fi diff --git a/recipes/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch b/recipes/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch new file mode 100644 index 0000000000..3d0c008bbe --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch @@ -0,0 +1,39 @@ +From c53e94a520b573aa0dcf12903e9563fe8badc34c Mon Sep 17 00:00:00 2001 +From: Marius Avram +Date: Wed, 27 Aug 2014 12:10:41 +0300 +Subject: [PATCH] Allow /run/media/sdX drive mount if username root + +In case that the username logged in the system is root +the drives are directly mounted in /run/media/sdX and +not /run/media//sdX as the function +g_unix_mount_guess_should_display() expects. + +Without this change USB stick mounts are not accesible from +graphical applications such as the File Manager (pcmanfm). + +Upstream-Status: Inappropriate + +Signed-off-by: Marius Avram +--- + gio/gunixmounts.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c +index 4999354..f6c1472 100644 +--- a/gio/gunixmounts.c ++++ b/gio/gunixmounts.c +@@ -2136,6 +2136,11 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry) + mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/') + is_in_runtime_dir = TRUE; + ++ /* Allow no username in path in /run/media if current user is root */ ++ if (strcmp(user_name, "root") == 0 && ++ strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0) ++ is_in_runtime_dir = TRUE; ++ + if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/")) + { + char *path; +-- +1.7.9.5 + diff --git a/recipes/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch b/recipes/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch new file mode 100644 index 0000000000..9759d11e3c --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch @@ -0,0 +1,29 @@ +configure.ac: change readlink -f to -m + +Change "readlink -f" to "readlink -m" since $libdir/$with_runtime_libdir +may not exist. + +This patch should go to the upstream, I will send it sooner. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -271,7 +271,7 @@ AC_ARG_WITH(runtime-libdir, + [], + [with_runtime_libdir=""]) + GLIB_RUNTIME_LIBDIR="$with_runtime_libdir" +-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`" ++ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`" + AC_SUBST(GLIB_RUNTIME_LIBDIR) + AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR) + AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"]) +-- +1.8.1.2 + diff --git a/recipes/glib-2.0/glib-2.0/ptest-paths.patch b/recipes/glib-2.0/glib-2.0/ptest-paths.patch new file mode 100644 index 0000000000..f3be02770c --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/ptest-paths.patch @@ -0,0 +1,30 @@ +Instead of writing the temporary mapping files in the mappedfile test to the +user runtime directory, write them to $TMP. The runtime directory may not +currently exist if the test is executed on a non-desktop system and the test +doesn't attempt to create the directory structure. + +Upstream-Status: Pending +Signed-off-by: Ross Burton + +diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c +index 40e0e60..27a24be 100644 +--- a/glib/tests/mappedfile.c ++++ b/glib/tests/mappedfile.c +@@ -81,7 +81,7 @@ test_writable (void) + const gchar *new = "abcdefghijklmnopqrstuvxyz"; + gchar *tmp_copy_path; + +- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL); ++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL); + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error); + g_assert_no_error (error); +@@ -125,7 +125,7 @@ test_writable_fd (void) + int fd; + gchar *tmp_copy_path; + +- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL); ++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL); + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error); + g_assert_no_error (error); diff --git a/recipes/glib-2.0/glib-2.0/run-ptest b/recipes/glib-2.0/glib-2.0/run-ptest index 3deb586999..130ae09b6c 100644 --- a/recipes/glib-2.0/glib-2.0/run-ptest +++ b/recipes/glib-2.0/glib-2.0/run-ptest @@ -1,3 +1,3 @@ -#!/bin/sh +#! /bin/sh -make -k ptest +gnome-desktop-testing-runner glib diff --git a/recipes/glib-2.0/glib-2.0/uclibc.patch b/recipes/glib-2.0/glib-2.0/uclibc.patch new file mode 100644 index 0000000000..2a154fdd4a --- /dev/null +++ b/recipes/glib-2.0/glib-2.0/uclibc.patch @@ -0,0 +1,20 @@ +Fix DATADIRNAME on uclibc/Linux + +translation files are always installed under PREFIX/share/locale in uclibc +based systems therefore lets set DATADIRNAME to "share". + +Signed-off-by: Khem Raj +Upstream-Status: Pending +Index: glib-2.38.2/m4macros/glib-gettext.m4 +=================================================================== +--- glib-2.38.2.orig/m4macros/glib-gettext.m4 2013-11-07 07:29:13.000000000 -0800 ++++ glib-2.38.2/m4macros/glib-gettext.m4 2014-03-15 14:51:54.712135644 -0700 +@@ -239,7 +239,7 @@ + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; +- *-*-openbsd*) ++ *-*-openbsd* | *-*-linux-uclibc*) + CATOBJEXT=.mo + DATADIRNAME=share + ;; diff --git a/recipes/glib-2.0/glib-2.0_2.40.2.bb b/recipes/glib-2.0/glib-2.0_2.40.2.bb new file mode 100644 index 0000000000..c910f221ff --- /dev/null +++ b/recipes/glib-2.0/glib-2.0_2.40.2.bb @@ -0,0 +1,99 @@ +DESCRIPTION = "GLib is a general-purpose utility library, \ +which provides many useful data types, macros, \ +type conversions, string utilities, file utilities, a main \ +loop abstraction, and so on. It works on many \ +UNIX-like platforms, Windows, OS/2 and BeOS." +LICENSE = "LGPLv2+" +SECTION = "libs" +PRIORITY = "optional" +PR = "r2" +DEPENDS += "glib-2.0-native virtual/libiconv gtk-doc zlib" +DEPENDS_virtclass-native += "gtk-doc-native" +DEPENDS += "libffi python-argparse-native zlib" +DEPENDS_virtclass-native += "pkgconfig-native gettext-native libffi-native zlib-native" +DEPENDS_virtclass-nativesdk += "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib ${BPN}-native" + +SRC_URI = "\ + http://ftp.gnome.org/pub/GNOME/sources/glib/2.40/glib-${PV}.tar.xz \ + file://configure-libtool.patch;patch=1 \ + file://fix-conflicting-rand.patch;patch=1 \ + file://add-march-i486-into-CFLAGS-automatically.patch;patch=1 \ + file://glib-2.0-configure-readlink.patch;patch=1 \ + file://uclibc.patch;patch=1 \ + file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch;patch=1 \ + file://allow-run-media-sdX-drive-mount-if-username-root.patch;patch=1 \ +" + +SRC_URI[md5sum] = "9023ca0ef1b34ada7e7d811158e4cdf3" +SRC_URI[sha256sum] = "e8ff8af2950897e805408480c454c415d1eade4e670ec5fb507f5e5853726c7a" + +inherit autotools gettext gtk-doc pkgconfig + +S = "${WORKDIR}/glib-${PV}" + +EXTRA_OECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man --enable-included-printf=no --disable-modular-tests --disable-selinux" + +do_configure_prepend() { + sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in +} + +ARM_INSTRUCTION_SET = "arm" +USE_NLS = "yes" + +do_install_append() { + if [ "${PN}" != "glib-2.0-native" ]; then + sed ${D}${bindir}/gtester-report -i -e 's,${STAGING_BINDIR_NATIVE},${bindir},g' + fi + + # remove some unpackaged files + rm -f ${D}${libdir}/gdbus-2.0/codegen/*.pyc + rm -f ${D}${libdir}/gdbus-2.0/codegen/*.pyo + # and empty dirs + rm -rf ${D}${libdir}/gio + + # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location + # for target as /usr/bin/perl, so fix it to /usr/bin/perl. + if [ -f ${D}${bindir}/glib-mkenums ]; then + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums + fi +} + +EXTRA_OECONF_virtclass-native = "--disable-dtrace --disable-systemtap" + +do_configure_prepend_virtclass-native() { + if [ -e ${S}/${TARGET_SYS}-libtool ] ; then + echo "${TARGET_SYS}-libtool already present" + else + cp ${STAGING_BINDIR}/${TARGET_SYS}-libtool ${S} + fi + +} + +#BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" + +PACKAGES =+ "gobject-2.0 gmodule-2.0 gthread-2.0 gio-2.0 glib-2.0-utils ${PN}-bash-completion ${PN}-codegen" +LEAD_SONAME = "libglib-2.0.*" +FILES_${PN}-utils = "${bindir}/* ${datadir}/glib-2.0/gettext" +FILES_${PN} = "${libdir}/lib*so.* ${libdir}/gio/modules/*.so \ + ${datadir}/glib-2.0/schemas \ + ${datadir}/glib-2.0/gettext/mkinstalldirs ${datadir}/glib-2.0/gettext/po/Makefile.in.in" +FILES_${PN}-dev += "${libdir}/glib-2.0/include \ + ${libdir}/gio/modules/*.la" +FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb \ + ${libdir}/gio/modules/.debug" + +FILES_gmodule-2.0 = "${libdir}/libgmodule-2.0.so.*" +FILES_gobject-2.0 = "${libdir}/libgobject-2.0.so.*" +FILES_gio-2.0 = "${libdir}/libgio-2.0.so.*" +FILES_gthread-2.0 = "${libdir}/libgthread-2.0.so.*" +FILES_${PN}-codegen = "${libdir}/gdbus-2.0/codegen/*.py" +FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d \ + ${datadir}/bash-completion" + +# Let various glib components end up in glib package +# for compatibility (with binary packages from Maemo). +FILES_gthread-2.0_chinook-compat = "" +FILES_gmodule-2.0_chinook-compat = "" +FILES_gobject-2.0_chinook-compat = "" +FILES_gio-2.0_chinook-compat = "" -- 2.39.5