public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/hardened-dev:musl commit in: dev-libs/glib/files/, dev-libs/glib/
@ 2013-07-29 13:28 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2013-07-29 13:28 UTC (permalink / raw
  To: gentoo-commits

commit:     627e4ea816e415131619a7c150b21a09be8149e3
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 29 13:30:41 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 13:30:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=627e4ea8

dev-libs/glib: unconditionally include fcntl.h

---
 dev-libs/glib/files/glib-2.12.12-fbsd.patch        |  21 ++
 .../files/glib-2.31.x-external-gdbus-codegen.patch |  99 +++++++++
 .../glib/files/glib-2.32.4-CVE-2012-3524.patch     | 247 +++++++++++++++++++++
 .../files/glib-2.32.4-always-include-fcntl.h-patch |  15 ++
 dev-libs/glib/files/glib-2.32.4-bashcomp.patch     |  27 +++
 .../files/glib-2.34.0-testsuite-skip-thread4.patch |  44 ++++
 .../glib/files/glib-2.34.3-automake-1.13.patch     |  23 ++
 dev-libs/glib/glib-2.32.4-r99.ebuild               | 238 ++++++++++++++++++++
 dev-libs/glib/metadata.xml                         |  14 ++
 9 files changed, 728 insertions(+)

diff --git a/dev-libs/glib/files/glib-2.12.12-fbsd.patch b/dev-libs/glib/files/glib-2.12.12-fbsd.patch
new file mode 100644
index 0000000..bba6329
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.12.12-fbsd.patch
@@ -0,0 +1,21 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN glib-2.12.12.orig/gmodule/gmodule-dl.c glib-2.12.12/gmodule/gmodule-dl.c
+--- glib-2.12.12.orig/gmodule/gmodule-dl.c	2007-05-01 19:12:40.000000000 -0400
++++ glib-2.12.12/gmodule/gmodule-dl.c	2007-07-05 20:10:51.000000000 -0400
+@@ -106,6 +106,7 @@ _g_module_open (const gchar *file_name,
+ static gpointer
+ _g_module_self (void)
+ {
++#ifndef __FreeBSD__
+   gpointer handle;
+   
+   /* to query symbols from the program itself, special link options
+@@ -117,6 +118,9 @@ _g_module_self (void)
+     g_module_set_error (fetch_dlerror (TRUE));
+   
+   return handle;
++#else
++  return RTLD_DEFAULT;
++#endif
+ }
+ 
+ static void

diff --git a/dev-libs/glib/files/glib-2.31.x-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.31.x-external-gdbus-codegen.patch
new file mode 100644
index 0000000..df1378e
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.31.x-external-gdbus-codegen.patch
@@ -0,0 +1,99 @@
+From 732f04b55f59b8107a7fbe317317edb5f184ea8f Mon Sep 17 00:00:00 2001
+From: Priit Laes <plaes@plaes.org>
+Date: Fri, 3 Feb 2012 09:08:28 +0200
+Subject: [PATCH] Split out gdbus codegen
+
+---
+ configure.ac                                       |    4 +---
+ docs/reference/gio/Makefile.am                     |    3 +--
+ gio/Makefile.am                                    |    2 +-
+ gio/tests/Makefile.am                              |    6 ++----
+ gio/tests/gdbus-object-manager-example/Makefile.am |    6 ++----
+ 5 files changed, 7 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4cf04a1..0bb18c8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -356,7 +356,7 @@ fi
+ AC_SUBST(PERL_PATH)
+ 
+ # Need suitable python path for greport
+-AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
++# AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
+ 
+ 
+ dnl ***********************
+@@ -3525,8 +3525,6 @@ gobject/glib-mkenums
+ gobject/tests/Makefile
+ gthread/Makefile
+ gio/Makefile
+-gio/gdbus-2.0/codegen/Makefile
+-gio/gdbus-2.0/codegen/config.py
+ gio/xdgmime/Makefile
+ gio/inotify/Makefile
+ gio/fen/Makefile
+diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
+index 535aa26..5027dd5 100644
+--- a/docs/reference/gio/Makefile.am
++++ b/docs/reference/gio/Makefile.am
+@@ -144,8 +144,7 @@ man_MANS =			\
+ 	glib-compile-resources.1	\
+ 	gsettings.1		\
+ 	gresource.1		\
+-	gdbus.1			\
+-	gdbus-codegen.1
++	gdbus.1
+ 
+ if ENABLE_MAN
+ 
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index 67eeae6..277931b 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.decl
+ 
+ NULL =
+ 
+-SUBDIRS = gdbus-2.0/codegen
++SUBDIRS =
+ 
+ if OS_UNIX
+ SUBDIRS += xdgmime
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index e987fd1..66af8cf 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -275,10 +275,8 @@ gdbus_close_pending_SOURCES = gdbus-close-pending.c gdbus-sessionbus.c gdbus-ses
+ gdbus_close_pending_LDADD = $(progs_ldadd)
+ 
+ if OS_UNIX
+-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.project. \
+ 		--generate-c-code gdbus-test-codegen-generated \
+ 		--c-generate-object-manager \
+diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
+index 9861d0e..9ca6eb9 100644
+--- a/gio/tests/gdbus-object-manager-example/Makefile.am
++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
+@@ -21,10 +21,8 @@ GDBUS_GENERATED = 										\
+ 	gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml 	\
+ 	$(NULL)
+ 
+-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
+ 		--c-namespace Example \
+ 		--c-generate-object-manager \
+-- 
+1.7.8.4
+

diff --git a/dev-libs/glib/files/glib-2.32.4-CVE-2012-3524.patch b/dev-libs/glib/files/glib-2.32.4-CVE-2012-3524.patch
new file mode 100644
index 0000000..92e6c81
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.32.4-CVE-2012-3524.patch
@@ -0,0 +1,247 @@
+From 4c2928a54482913cf236bff0e66650a8f47e17ea Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters@verbum.org>
+Date: Wed, 22 Aug 2012 18:26:11 +0000
+Subject: CVE-2012-3524: Hardening for being run in a setuid environment
+
+Some programs attempt to use libglib (or even libgio) when setuid.
+For a long time, GTK+ simply aborted if launched in this
+configuration, but we never had a real policy for GLib.
+
+I'm not sure whether we should advertise such support.  However, given
+that there are real-world programs that do this currently, we can make
+them safer with not too much effort.
+
+Better to fix a problem caused by an interaction between two
+components in *both* places if possible.
+
+This patch adds a private function g_check_setuid() which is used to
+first ensure we don't run an external dbus-launch binary if
+DBUS_SESSION_BUS_ADDRESS isn't set.
+
+Second, we also ensure the local VFS is used in this case.  The
+gdaemonvfs extension point will end up talking to the session bus
+which is typically undesirable in a setuid context.
+
+Implementing g_check_setuid() is interesting - whether or not we're
+running in a privilege-escalated path is operating system specific.
+Note that GTK+'s code to check euid versus uid worked historically on
+Unix, more modern systems have filesystem capabilities and SELinux
+domain transitions, neither of which are captured by the uid
+comparison.
+
+On Linux/glibc, the way this works is that the kernel sets an
+AT_SECURE flag in the ELF auxiliary vector, and glibc looks for it on
+startup.  If found, then glibc sets a public-but-undocumented
+__libc_enable_secure variable which we can use.  Unfortunately, while
+it *previously* worked to check this variable, a combination of newer
+binutils and RPM break it:
+http://www.openwall.com/lists/owl-dev/2012/08/14/1
+
+So for now on Linux/glibc, we fall back to the historical Unix version
+until we get glibc fixed.
+
+On some BSD variants, there is a issetugid() function.  On other Unix
+variants, we fall back to what GTK+ has been doing.
+
+Reported-By: Sebastian Krahmer <krahmer@suse.de>
+Signed-off-by: Colin Walters <walters@verbum.org>
+---
+diff --git a/configure.ac b/configure.ac
+index 584df1d..67ea1a9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -583,9 +583,20 @@ AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
+ # Checks for library functions.
+ AC_FUNC_VPRINTF
+ AC_FUNC_ALLOCA
+-AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
++AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2 issetugid)
+ AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
+ 
++AC_CACHE_CHECK([for __libc_enable_secure], glib_cv_have_libc_enable_secure,
++  [AC_TRY_LINK([#include <unistd.h>
++    extern int __libc_enable_secure;],
++    [return __libc_enable_secure;],
++   glib_cv_have_libc_enable_secure=yes,
++   glib_cv_have_libc_enable_secure=no)])
++AS_IF([test x$glib_cv_have_libc_enable_secure = xyes], [
++   AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1,
++     [Define if you have the __libc_enable_secure variable (GNU libc, eglibc)])
++])
++
+ AC_CHECK_SIZEOF(char)
+ AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(long)
+@@ -984,7 +995,7 @@ AC_MSG_RESULT(unsigned $glib_size_type)
+ 
+ # Check for some functions
+ AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem)
+-AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid)
++AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid)
+ AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat)
+ # Check for high-resolution sleep functions
+ AC_CHECK_FUNCS(splice)
+diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
+index 4aa13b9..96b6343 100644
+--- a/gio/gdbusaddress.c
++++ b/gio/gdbusaddress.c
+@@ -37,6 +37,7 @@
+ #include "giostream.h"
+ #include "gasyncresult.h"
+ #include "gsimpleasyncresult.h"
++#include "glib-private.h"
+ #include "gdbusprivate.h"
+ #include "giomodule-priv.h"
+ #include "gdbusdaemon.h"
+@@ -1023,6 +1024,14 @@ get_session_address_dbus_launch (GError **error)
+   restore_dbus_verbose = FALSE;
+   old_dbus_verbose = NULL;
+ 
++  /* Don't run binaries as root if we're setuid. */
++  if (GLIB_PRIVATE_CALL (g_check_setuid) ())
++    {
++      g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
++		   _("Cannot spawn a message bus when setuid"));
++      goto out;
++    }
++
+   machine_id = _g_dbus_get_machine_id (error);
+   if (machine_id == NULL)
+     {
+diff --git a/gio/gvfs.c b/gio/gvfs.c
+index dda8afb..9afbcec 100644
+--- a/gio/gvfs.c
++++ b/gio/gvfs.c
+@@ -23,6 +23,7 @@
+ #include "config.h"
+ #include <string.h>
+ #include "gvfs.h"
++#include "glib-private.h"
+ #include "glocalvfs.h"
+ #include "gresourcefile.h"
+ #include "giomodule-priv.h"
+@@ -191,6 +192,8 @@ g_vfs_parse_name (GVfs       *vfs,
+ GVfs *
+ g_vfs_get_default (void)
+ {
++  if (GLIB_PRIVATE_CALL (g_check_setuid) ())
++    return g_vfs_get_local ();
+   return _g_io_module_get_default (G_VFS_EXTENSION_POINT_NAME,
+ 				   "GIO_USE_VFS",
+ 				   (GIOModuleVerifyFunc)g_vfs_is_active);
+diff --git a/glib/genviron.c b/glib/genviron.c
+index 59a8bbe..9525cf0 100644
+--- a/glib/genviron.c
++++ b/glib/genviron.c
+@@ -40,6 +40,7 @@
+ #include <windows.h>
+ #endif
+ 
++#include "glib-private.h"
+ #include "gmem.h"
+ #include "gmessages.h"
+ #include "gstrfuncs.h"
+diff --git a/glib/glib-private.c b/glib/glib-private.c
+index 3946e77..3506782 100644
+--- a/glib/glib-private.c
++++ b/glib/glib-private.c
+@@ -38,7 +38,9 @@ glib__private__ (void)
+     g_wakeup_signal,
+     g_wakeup_acknowledge,
+ 
+-    g_get_worker_context
++    g_get_worker_context,
++
++    g_check_setuid
+   };
+ 
+   return &table;
+diff --git a/glib/glib-private.h b/glib/glib-private.h
+index fde0be8..87da6f3 100644
+--- a/glib/glib-private.h
++++ b/glib/glib-private.h
+@@ -25,6 +25,8 @@
+ 
+ G_GNUC_INTERNAL
+ GMainContext *          g_get_worker_context            (void);
++G_GNUC_INTERNAL
++gboolean                g_check_setuid                  (void);
+ 
+ #define GLIB_PRIVATE_CALL(symbol) (glib__private__()->symbol)
+ 
+@@ -40,6 +42,8 @@ typedef struct {
+   /* See gmain.c */
+   GMainContext *        (* g_get_worker_context)        (void);
+   /* Add other private functions here, initialize them in glib-private.c */
++
++  gboolean              (* g_check_setuid)              (void);
+ } GLibPrivateVTable;
+ 
+ GLibPrivateVTable *glib__private__ (void);
+diff --git a/glib/gutils.c b/glib/gutils.c
+index 38b5e44..f8a38d1 100644
+--- a/glib/gutils.c
++++ b/glib/gutils.c
+@@ -2409,3 +2409,60 @@ g_get_tmp_dir (void)
+ }
+ 
+ #endif
++
++/* Private API:
++ *
++ * Returns %TRUE if the current process was executed as setuid (or an
++ * equivalent __libc_enable_secure is available).  See:
++ * http://osdir.com/ml/linux.lfs.hardened/2007-04/msg00032.html
++ */ 
++gboolean
++g_check_setuid (void)
++{
++  /* TODO: get __libc_enable_secure exported from glibc.
++   * See http://www.openwall.com/lists/owl-dev/2012/08/14/1
++   */
++#if 0 && defined(HAVE_LIBC_ENABLE_SECURE)
++  {
++    /* See glibc/include/unistd.h */
++    extern int __libc_enable_secure;
++    return __libc_enable_secure;
++  }
++#elif defined(HAVE_ISSETUGID)
++  /* BSD: http://www.freebsd.org/cgi/man.cgi?query=issetugid&sektion=2 */
++  return issetugid ();
++#elif defined(G_OS_UNIX)
++  uid_t ruid, euid, suid; /* Real, effective and saved user ID's */
++  gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */
++
++  static gsize check_setuid_initialised;
++  static gboolean is_setuid;
++
++  if (g_once_init_enter (&check_setuid_initialised))
++    {
++#ifdef HAVE_GETRESUID
++      /* These aren't in the header files, so we prototype them here.
++       */
++      int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
++      int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
++      
++      if (getresuid (&ruid, &euid, &suid) != 0 ||
++          getresgid (&rgid, &egid, &sgid) != 0)
++#endif /* HAVE_GETRESUID */
++        {
++          suid = ruid = getuid ();
++          sgid = rgid = getgid ();
++          euid = geteuid ();
++          egid = getegid ();
++        }
++
++      is_setuid = (ruid != euid || ruid != suid ||
++                   rgid != egid || rgid != sgid);
++
++      g_once_init_leave (&check_setuid_initialised, 1);
++    }
++  return is_setuid;
++#else
++  return FALSE;
++#endif
++}
+--
+cgit v0.9.0.2

diff --git a/dev-libs/glib/files/glib-2.32.4-always-include-fcntl.h-patch b/dev-libs/glib/files/glib-2.32.4-always-include-fcntl.h-patch
new file mode 100644
index 0000000..dcac735
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.32.4-always-include-fcntl.h-patch
@@ -0,0 +1,15 @@
+diff -Naur glib-2.32.4.orig/gio/gfile.c glib-2.32.4/gio/gfile.c
+--- glib-2.32.4.orig/gio/gfile.c	2012-07-14 19:16:55.000000000 +0000
++++ glib-2.32.4/gio/gfile.c	2013-07-06 22:01:12.564092562 +0000
+@@ -26,10 +26,10 @@
+ #ifdef HAVE_SPLICE
+ #include <sys/stat.h>
+ #include <unistd.h>
+-#include <fcntl.h>
+ #include <errno.h>
+ #endif
+ #include <string.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #ifdef HAVE_PWD_H
+ #include <pwd.h>

diff --git a/dev-libs/glib/files/glib-2.32.4-bashcomp.patch b/dev-libs/glib/files/glib-2.32.4-bashcomp.patch
new file mode 100644
index 0000000..33abffc
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.32.4-bashcomp.patch
@@ -0,0 +1,27 @@
+From 6d032421b4871105e1f37bb75a5ec7b012f19f61 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sun, 15 Jul 2012 22:30:07 -0400
+Subject: [PATCH] gio: use /usr/share/bash-completion for bashcomp
+
+In Gentoo, we use /usr/share/bash-completion, not
+/usr/share/bash-completion/completions.
+---
+ gio/Makefile.am |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index 704367c..bee9dc6 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -715,7 +715,7 @@ gdbus_LDADD = libgio-2.0.la \
+ 	$(top_builddir)/glib/libglib-2.0.la 		\
+ 	$(top_builddir)/gobject/libgobject-2.0.la
+ 
+-completiondir = $(datadir)/bash-completion/completions
++completiondir = $(datadir)/bash-completion
+ completion_DATA = \
+ 	completion/gdbus				\
+ 	completion/gsettings				\
+-- 
+1.7.8.6
+

diff --git a/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch b/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch
new file mode 100644
index 0000000..f409094
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch
@@ -0,0 +1,44 @@
+From 8a8112aad6dc98aaaf9767b31e48f5ae8fabd858 Mon Sep 17 00:00:00 2001
+From: Priit Laes <plaes@plaes.org>
+Date: Tue, 3 Jul 2012 11:21:56 +0300
+Subject: [PATCH] Gentoo: skip over thread/thread4 test failure
+
+https://bugzilla.gnome.org/show_bug.cgi?id=679306
+---
+ glib/tests/thread.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/glib/tests/thread.c b/glib/tests/thread.c
+index 29b3850..ffe8087 100644
+--- a/glib/tests/thread.c
++++ b/glib/tests/thread.c
+@@ -124,6 +124,8 @@ test_thread3 (void)
+   g_assert_cmpint (GPOINTER_TO_INT(result), ==, 9);
+ }
+ 
++#if 0
++// https://bugzilla.gnome.org/show_bug.cgi?id=679306
+ /* test that thread creation fails as expected,
+  * by setting RLIMIT_NPROC ridiculously low
+  */
+@@ -152,6 +154,7 @@ test_thread4 (void)
+     g_error ("resetting RLIMIT_NPROC failed: %s\n", g_strerror (ret));
+ #endif
+ }
++#endif
+ 
+ static void
+ test_thread5 (void)
+@@ -195,7 +198,9 @@ main (int argc, char *argv[])
+   g_test_add_func ("/thread/thread1", test_thread1);
+   g_test_add_func ("/thread/thread2", test_thread2);
+   g_test_add_func ("/thread/thread3", test_thread3);
++#if 0
+   g_test_add_func ("/thread/thread4", test_thread4);
++#endif
+   g_test_add_func ("/thread/thread5", test_thread5);
+   g_test_add_func ("/thread/thread6", test_thread6);
+ 
+-- 
+1.7.8.6
+

diff --git a/dev-libs/glib/files/glib-2.34.3-automake-1.13.patch b/dev-libs/glib/files/glib-2.34.3-automake-1.13.patch
new file mode 100644
index 0000000..5f4e7b6
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.34.3-automake-1.13.patch
@@ -0,0 +1,23 @@
+Replace macros deprecated in automake-1.13; fixed upstream in glib-2.36
+
+diff --git a/configure.ac b/configure.ac
+index a3567b3..3e3d697 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -56,7 +56,7 @@ m4_define([glib_debug_default],
+ AC_INIT(glib, [glib_version],
+         [http://bugzilla.gnome.org/enter_bug.cgi?product=glib])
+ 
+-AC_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+ AC_CONFIG_SRCDIR([glib/glib.h])
+ AC_CONFIG_MACRO_DIR([m4macros])
+ 
+@@ -291,7 +291,6 @@ AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
+ AM_CONDITIONAL(HAVE_CXX, [test "$CXX" != ""])
+ AC_LANG_RESTORE
+ 
+-AM_PROG_CC_STDC
+ AM_PROG_CC_C_O
+ AC_PROG_INSTALL
+ 

diff --git a/dev-libs/glib/glib-2.32.4-r99.ebuild b/dev-libs/glib/glib-2.32.4-r99.ebuild
new file mode 100644
index 0000000..8e4bb81
--- /dev/null
+++ b/dev-libs/glib/glib-2.32.4-r99.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/glib/glib-2.32.4-r1.ebuild,v 1.13 2013/04/30 14:29:12 tetromino Exp $
+
+EAPI="4"
+PYTHON_DEPEND="utils? 2" # Avoid runtime dependency on python when USE=test
+
+inherit autotools gnome.org libtool eutils flag-o-matic gnome2-utils multilib pax-utils python toolchain-funcs virtualx linux-info
+
+DESCRIPTION="The GLib library of C routines"
+HOMEPAGE="http://www.gtk.org/"
+SRC_URI="${SRC_URI}
+	http://dev.gentoo.org/~tetromino/distfiles/glib/${P}-AS_IF-patches.tar.xz
+	http://pkgconfig.freedesktop.org/releases/pkg-config-0.26.tar.gz" # pkg.m4 for eautoreconf
+
+LICENSE="LGPL-2+"
+SLOT="2"
+IUSE="debug fam kernel_linux selinux static-libs systemtap test utils xattr"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+
+RDEPEND="virtual/libiconv
+	virtual/libffi
+	sys-libs/zlib
+	|| (
+		>=dev-libs/elfutils-0.142
+		>=dev-libs/libelf-0.8.12 )
+	xattr? ( sys-apps/attr )
+	fam? ( virtual/fam )
+	utils? ( >=dev-util/gdbus-codegen-${PV} )"
+DEPEND="${RDEPEND}
+	>=sys-devel/gettext-0.11
+	>=dev-util/gtk-doc-am-1.15
+	systemtap? ( >=dev-util/systemtap-1.3 )
+	test? (
+		sys-devel/gdb
+		=dev-lang/python-2*
+		>=dev-util/gdbus-codegen-${PV}
+		>=sys-apps/dbus-1.2.14 )
+	!<dev-util/gtk-doc-1.15-r2"
+PDEPEND="x11-misc/shared-mime-info
+	!<gnome-base/gvfs-1.6.4-r990"
+# shared-mime-info needed for gio/xdgmime, bug #409481
+# Earlier versions of gvfs do not work with glib
+
+pkg_setup() {
+	# Needed for gio/tests/gdbus-testserver.py
+	if use test ; then
+		python_set_active_version 2
+		python_pkg_setup
+	fi
+
+	if use kernel_linux ; then
+		CONFIG_CHECK="~INOTIFY_USER"
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-CVE-2012-3524.patch
+
+	mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${WORKDIR}"/ || die
+
+	# Fix gmodule issues on fbsd; bug #184301
+	epatch "${FILESDIR}"/${PN}-2.12.12-fbsd.patch
+
+	if ! use test; then
+		# don't waste time building tests
+		sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' -i $(find . -name Makefile.am -o -name Makefile.in) || die
+	else
+		# Do not try to remove files on live filesystem, upstream bug #619274
+		sed 's:^\(.*"/desktop-app-info/delete".*\):/*\1*/:' \
+			-i "${S}"/gio/tests/desktop-app-info.c || die "sed failed"
+
+		# Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629
+		if ! has_version dev-util/desktop-file-utils ; then
+			ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
+			ewarn "think on installing it to get these tests run."
+			sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
+			sed -i -e "/desktop-app-info\/default/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/fallback/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/lastused/d" gio/tests/desktop-app-info.c || die
+		fi
+
+		# Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853
+		if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:2' ; then
+			ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:2"
+			ewarn "not being present on your system, think on installing them to get these tests run."
+			sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die
+			sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die
+			sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die
+			sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die
+			sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die
+			sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die
+			sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die
+			# needed to prevent gdbus-threading from asserting
+			ln -sfn $(type -P true) gio/tests/gdbus-testserver.py
+		fi
+	fi
+
+	# gdbus-codegen is a separate package
+	epatch "${FILESDIR}/${PN}-2.31.x-external-gdbus-codegen.patch"
+
+	# bashcomp goes in /usr/share/bash-completion
+	epatch "${FILESDIR}/${PN}-2.32.4-bashcomp.patch"
+
+	# AS_IF fixes from 2.33.x, needed for cross-compiling, bug #434770
+	epatch ../AS_IF-patches/*.patch
+
+	# https://bugzilla.gnome.org/show_bug.cgi?id=679306
+	epatch "${FILESDIR}/${PN}-2.34.0-testsuite-skip-thread4.patch"
+
+	# build failure with automake-1.13; fixed upstream in 2.36
+	epatch "${FILESDIR}/${PN}-2.34.3-automake-1.13.patch"
+
+	# We need fcntl.h on musl for loff_t
+	epatch "${FILESDIR}/glib-2.32.4-always-include-fcntl.h-patch"
+
+	epatch_user
+
+	# disable pyc compiling
+	use test && python_clean_py-compile_files
+
+	# Needed for the punt-python-check patch, disabling timeout test
+	# Also needed to prevent croscompile failures, see bug #267603
+	# Also needed for the no-gdbus-codegen patch
+	AT_M4DIR="${WORKDIR}" eautoreconf
+
+	[[ ${CHOST} == *-freebsd* ]] && elibtoolize
+
+	epunt_cxx
+}
+
+src_configure() {
+	# Avoid circular depend with dev-util/pkgconfig and
+	# native builds (cross-compiles won't need pkg-config
+	# in the target ROOT to work here)
+	if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
+		if has_version sys-apps/dbus; then
+			export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
+			export DBUS1_LIBS="-ldbus-1"
+		fi
+		export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
+		export LIBFFI_LIBS="-lffi"
+	fi
+
+	local myconf
+
+	# Building with --disable-debug highly unrecommended.  It will build glib in
+	# an unusable form as it disables some commonly used API.  Please do not
+	# convert this to the use_enable form, as it results in a broken build.
+	# -- compnerd (3/27/06)
+	use debug && myconf="--enable-debug"
+
+	# Always use internal libpcre, bug #254659
+	econf ${myconf} \
+		$(use_enable xattr) \
+		$(use_enable fam) \
+		$(use_enable selinux) \
+		$(use_enable static-libs static) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable systemtap systemtap) \
+		--with-pcre=internal \
+		--with-threads=posix
+}
+
+src_install() {
+	local f
+
+	# install-exec-hook substitutes ${PYTHON} in glib/gtester-report
+	emake DESTDIR="${D}" PYTHON="${EPREFIX}/usr/bin/python2" install
+
+	if ! use utils; then
+		rm "${ED}usr/bin/gtester-report"
+	fi
+
+	# Do not install charset.alias even if generated, leave it to libiconv
+	rm -f "${ED}/usr/lib/charset.alias"
+
+	# Don't install gdb python macros, bug 291328
+	rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
+
+	dodoc AUTHORS ChangeLog* NEWS* README
+
+	# Completely useless with or without USE static-libs, people need to use
+	# pkg-config
+	find "${D}" -name '*.la' -exec rm -f {} +
+}
+
+src_test() {
+	gnome2_environment_reset
+
+	unset DBUS_SESSION_BUS_ADDRESS
+	export XDG_CONFIG_DIRS=/etc/xdg
+	export XDG_DATA_DIRS=/usr/local/share:/usr/share
+	export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
+	unset GSETTINGS_BACKEND # bug 352451
+	export LC_TIME=C # bug #411967
+
+	# Related test is a bit nitpicking
+	mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+	chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+
+	# Hardened: gdb needs this, bug #338891
+	if host-is-pax ; then
+		pax-mark -mr "${S}"/tests/.libs/assert-msg-test \
+			|| die "Hardened adjustment failed"
+	fi
+
+	# Need X for dbus-launch session X11 initialization
+	Xemake check
+}
+
+pkg_preinst() {
+	# Only give the introspection message if:
+	# * The user has gobject-introspection
+	# * Has glib already installed
+	# * Previous version was different from new version
+	if has_version "dev-libs/gobject-introspection" && ! has_version "=${CATEGORY}/${PF}"; then
+		ewarn "You must rebuild gobject-introspection so that the installed"
+		ewarn "typelibs and girs are regenerated for the new APIs in glib"
+	fi
+}
+
+pkg_postinst() {
+	# Inform users about possible breakage when updating glib and not dbus-glib, bug #297483
+	if has_version dev-libs/dbus-glib; then
+		ewarn "If you experience a breakage after updating dev-libs/glib try"
+		ewarn "rebuilding dev-libs/dbus-glib"
+	fi
+
+	if has_version '<x11-libs/gtk+-3.0.12:3'; then
+		# To have a clear upgrade path for gtk+-3.0.x users, have to resort to
+		# a warning instead of a blocker
+		ewarn
+		ewarn "Using <gtk+-3.0.12:3 with ${P} results in frequent crashes."
+		ewarn "You should upgrade to a newer version of gtk+:3 immediately."
+	fi
+}

diff --git a/dev-libs/glib/metadata.xml b/dev-libs/glib/metadata.xml
new file mode 100644
index 0000000..ae970d3
--- /dev/null
+++ b/dev-libs/glib/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>gnome</herd>
+  <use>
+	<flag name="systemtap">Build support for profiling and tracing using 
+		<pkg>dev-util/systemtap</pkg></flag>
+	<flag name="utils">Install gtester-report utility to generate test
+		report files for your software.</flag>
+  </use>
+  <upstream>
+    <remote-id type="cpe">cpe:/a:gnome:glib</remote-id>
+  </upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/hardened-dev:musl commit in: dev-libs/glib/files/, dev-libs/glib/
@ 2014-01-06 17:36 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2014-01-06 17:36 UTC (permalink / raw
  To: gentoo-commits

commit:     31b5fa618e0152b9439a7ad01470b8f3ab956a3a
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 01:48:32 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Jan  6 17:37:16 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=31b5fa61

dev-libs/glib: disable man on 2.36.4 because of broken xmlcatalog

Package-Manager: portage-2.2.7
RepoMan-Options: --force

---
 .../files/glib-2.35.x-external-gdbus-codegen.patch | 111 +++++++++
 dev-libs/glib/files/glib-2.36.4-znodelete.patch    |  64 +++++
 dev-libs/glib/glib-2.36.4-r99.ebuild               | 273 +++++++++++++++++++++
 3 files changed, 448 insertions(+)

diff --git a/dev-libs/glib/files/glib-2.35.x-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.35.x-external-gdbus-codegen.patch
new file mode 100644
index 0000000..b3a0ede
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.35.x-external-gdbus-codegen.patch
@@ -0,0 +1,111 @@
+From 4a74adf19d7e46aef7c9ede87ffb0264193311dc Mon Sep 17 00:00:00 2001
+From: Priit Laes <plaes@plaes.org>
+Date: Thu, 28 Feb 2013 08:28:01 +0200
+Subject: [PATCH] Split out gdbus codegen
+
+---
+ configure.ac                                       | 17 ++++++++---------
+ docs/reference/gio/Makefile.am                     |  3 +--
+ gio/Makefile.am                                    |  2 +-
+ gio/tests/Makefile.am                              |  6 ++----
+ gio/tests/gdbus-object-manager-example/Makefile.am |  6 ++----
+ 5 files changed, 14 insertions(+), 20 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f734b7c..8076e7f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -374,14 +374,14 @@ AC_SUBST(PERL_PATH)
+ # option to specify python interpreter to use; this just sets $PYTHON, so that
+ # we will fallback to reading $PYTHON if --with-python is not given, and
+ # python.m4 will get the expected input
+-AC_ARG_WITH(python,
+-            AS_HELP_STRING([--with-python=PATH],
+-                           [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
+-            [PYTHON="$withval"], [])
+-if test x"$PYTHON" = xyes; then
+-  AC_MSG_ERROR([--with-python option requires a path or program argument])
+-fi
+-AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
++# AC_ARG_WITH(python,
++#             AS_HELP_STRING([--with-python=PATH],
++#                            [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
++#             [PYTHON="$withval"], [])
++# if test x"$PYTHON" = xyes; then
++#   AC_MSG_ERROR([--with-python option requires a path or program argument])
++# fi
++# AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
+
+
+ dnl ***********************
+@@ -3697,7 +3697,6 @@ gobject/glib-mkenums
+ gobject/tests/Makefile
+ gthread/Makefile
+ gio/Makefile
+-gio/gdbus-2.0/codegen/Makefile
+ gio/gdbus-2.0/codegen/config.py
+ gio/gnetworking.h
+ gio/xdgmime/Makefile
+diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
+index 99606d3..067cd50 100644
+--- a/docs/reference/gio/Makefile.am
++++ b/docs/reference/gio/Makefile.am
+@@ -152,8 +152,7 @@ man_MANS +=			\
+	glib-compile-resources.1	\
+	gsettings.1		\
+	gresource.1		\
+-	gdbus.1			\
+-	gdbus-codegen.1
++	gdbus.1
+
+ XSLTPROC_FLAGS = \
+         --nonet \
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index 94d7f59..c07d00d 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.decl
+
+ NULL =
+
+-SUBDIRS = gdbus-2.0/codegen
++SUBDIRS =
+
+ if OS_UNIX
+ SUBDIRS += xdgmime
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index c8a4090..feece02 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -212,10 +212,8 @@ gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h
+ gdbus_close_pending_SOURCES = gdbus-close-pending.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
+
+ if OS_UNIX
+-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+		--interface-prefix org.project. \
+		--generate-c-code gdbus-test-codegen-generated \
+		--c-generate-object-manager \
+diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
+index 6875210..264c3c1 100644
+--- a/gio/tests/gdbus-object-manager-example/Makefile.am
++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
+@@ -21,10 +21,8 @@ GDBUS_GENERATED = 										\
+	gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml 	\
+	$(NULL)
+
+-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+		--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
+		--c-namespace Example \
+		--c-generate-object-manager \
+--
+1.8.1.2

diff --git a/dev-libs/glib/files/glib-2.36.4-znodelete.patch b/dev-libs/glib/files/glib-2.36.4-znodelete.patch
new file mode 100644
index 0000000..e55586c
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.36.4-znodelete.patch
@@ -0,0 +1,64 @@
+From 242de638a030e1fb3b467af182d985d7c3bbf185 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Mon, 2 Sep 2013 13:59:18 -0400
+Subject: [PATCH] gobject: try to link with -Wl,-z,nodelete
+
+Since the type system does not support reloading its data and assumes
+that libgobject remains loaded for the lifetime of the process, we
+should link libgobject with a flag indicating that it can't be unloaded.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=707298
+---
+ configure.ac        | 24 ++++++++++++++++++++++++
+ gobject/Makefile.am |  1 +
+ 2 files changed, 25 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 0a63601..dd1045a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3668,6 +3668,30 @@ fi
+ AC_SUBST(GLIB_LINK_FLAGS)
+
+ dnl
++dnl Check for -z,nodelete linker flag: the type system assumes that
++dnl libgobject stays loaded for the lifetime of the process
++dnl
++
++AC_ARG_ENABLE([znodelete],
++              [AS_HELP_STRING([--disable-znodelete],
++                              [avoid linking with -z,nodelete])],,
++              [SAVED_LDFLAGS="${LDFLAGS}"
++               AC_MSG_CHECKING([for -z,nodelete linker flag])
++               LDFLAGS=-Wl,-z,nodelete
++               AC_TRY_LINK([], [int main (void) { return 0; }],
++                           AC_MSG_RESULT(yes)
++                           enable_znodelete=yes,
++                           AC_MSG_RESULT(no)
++                           enable_znodelete=no)
++               LDFLAGS="${SAVED_LDFLAGS}"])
++
++if test "x${enable_znodelete}" = "xyes"; then
++  GOBJECT_LINK_FLAGS=-Wl,-z,nodelete
++fi
++
++AC_SUBST(GOBJECT_LINK_FLAGS)
++
++dnl
+ dnl Check for -fvisibility=hidden to determine if we can do GNU-style
+ dnl visibility attributes for symbol export control
+ dnl
+diff --git a/gobject/Makefile.am b/gobject/Makefile.am
+index 1509616..181ad7d 100644
+--- a/gobject/Makefile.am
++++ b/gobject/Makefile.am
+@@ -45,6 +45,7 @@ endif
+
+ libgobjectincludedir = $(includedir)/glib-2.0/gobject
+ libgobject_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
++  $(GOBJECT_LINK_FLAGS) \
+   $(gobject_win32_res_ldflag) \
+   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+   -export-dynamic $(no_undefined)
+--
+1.8.3.2

diff --git a/dev-libs/glib/glib-2.36.4-r99.ebuild b/dev-libs/glib/glib-2.36.4-r99.ebuild
new file mode 100644
index 0000000..d28f1e8
--- /dev/null
+++ b/dev-libs/glib/glib-2.36.4-r99.ebuild
@@ -0,0 +1,273 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/glib/glib-2.36.4-r1.ebuild,v 1.8 2013/12/08 17:57:40 pacho Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python2_{6,7} )
+# Avoid runtime dependency on python when USE=test
+
+inherit autotools bash-completion-r1 gnome.org libtool eutils flag-o-matic gnome2-utils multilib pax-utils python-r1 toolchain-funcs versionator virtualx linux-info multilib-minimal
+
+DESCRIPTION="The GLib library of C routines"
+HOMEPAGE="http://www.gtk.org/"
+SRC_URI="${SRC_URI}
+	http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
+
+LICENSE="LGPL-2+"
+SLOT="2"
+IUSE="debug fam kernel_linux selinux static-libs systemtap test utils xattr"
+KEYWORDS="amd64"
+
+# FIXME: want libselinux[${MULTILIB_USEDEP}] - bug #480960
+RDEPEND="
+	virtual/libiconv[${MULTILIB_USEDEP}]
+	virtual/libffi[${MULTILIB_USEDEP}]
+	sys-libs/zlib[${MULTILIB_USEDEP}]
+	|| (
+		>=dev-libs/elfutils-0.142
+		>=dev-libs/libelf-0.8.12
+		>=sys-freebsd/freebsd-lib-9.2_rc1
+		)
+	selinux? ( sys-libs/libselinux )
+	xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+	fam? ( virtual/fam[${MULTILIB_USEDEP}] )
+	utils? (
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}] )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)
+"
+DEPEND="${RDEPEND}
+	app-text/docbook-xml-dtd:4.1.2
+	>=dev-libs/libxslt-1.0
+	>=sys-devel/gettext-0.11
+	>=dev-util/gtk-doc-am-1.15
+	systemtap? ( >=dev-util/systemtap-1.3 )
+	test? (
+		sys-devel/gdb
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}]
+		>=sys-apps/dbus-1.2.14 )
+	!<dev-libs/gobject-introspection-1.$(get_version_component_range 2)
+	!<dev-util/gtk-doc-1.15-r2
+"
+# gobject-introspection blocker to ensure people don't mix
+# different g-i and glib major versions
+
+PDEPEND="x11-misc/shared-mime-info
+	!<gnome-base/gvfs-1.6.4-r990"
+# shared-mime-info needed for gio/xdgmime, bug #409481
+# Earlier versions of gvfs do not work with glib
+
+DOCS="AUTHORS ChangeLog* NEWS* README"
+
+pkg_setup() {
+	if use kernel_linux ; then
+		CONFIG_CHECK="~INOTIFY_USER"
+		if use test; then
+			CONFIG_CHECK="~IPV6"
+			WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
+			export IPV6_DISABLED="yes"
+		fi
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	# Prevent build failure in stage3 where pkgconfig is not available, bug #481056
+	mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
+
+	# #488500 gets autogenerated, but get distributed with Linux-only header
+	rm "${S}"/gio/gnetworking.h || die
+
+	# Fix gmodule issues on fbsd; bug #184301, upstream bug #107626
+	epatch "${FILESDIR}"/${PN}-2.12.12-fbsd.patch
+
+	if use test; then
+		# Do not try to remove files on live filesystem, upstream bug #619274
+		sed 's:^\(.*"/desktop-app-info/delete".*\):/*\1*/:' \
+			-i "${S}"/gio/tests/desktop-app-info.c || die "sed failed"
+
+		# Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
+		if ! has_version dev-util/desktop-file-utils ; then
+			ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
+			ewarn "think on installing it to get these tests run."
+			sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
+			sed -i -e "/desktop-app-info\/default/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/fallback/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/lastused/d" gio/tests/desktop-app-info.c || die
+		fi
+
+		# gdesktopappinfo requires existing terminal (gnome-terminal or any
+		# other), falling back to xterm if one doesn't exist
+		if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
+			ewarn "Some tests will be skipped due to missing terminal program"
+			sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
+		fi
+
+		# Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853
+		if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:3' ; then
+			ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:3"
+			ewarn "not being present on your system, think on installing them to get these tests run."
+			sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die
+			sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die
+			sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die
+			sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die
+			sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die
+			sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die
+			sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die
+			# needed to prevent gdbus-threading from asserting
+			ln -sfn $(type -P true) gio/tests/gdbus-testserver.py
+		fi
+
+		# Some tests need ipv6, upstream bug #667468
+		if [[ -n "${IPV6_DISABLED}" ]]; then
+			sed -i -e "/socket\/ipv6_sync/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_async/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_v4mapped/d" gio/tests/socket.c || die
+		fi
+
+		# Test relies on /usr/bin/true, but we have /bin/true, upstream bug #698655
+		sed -i -e "s:/usr/bin/true:/bin/true:" gio/tests/desktop-app-info.c || die
+
+		# thread test fails, upstream bug #679306
+		epatch "${FILESDIR}/${PN}-2.34.0-testsuite-skip-thread4.patch"
+	fi
+
+	# gdbus-codegen is a separate package
+	epatch "${FILESDIR}/${PN}-2.35.x-external-gdbus-codegen.patch"
+
+	# do not allow libgobject to unload; bug #405173, https://bugzilla.gnome.org/show_bug.cgi?id=707298
+	epatch "${FILESDIR}/${PN}-2.36.4-znodelete.patch"
+
+	# leave python shebang alone
+	sed -e '/${PYTHON}/d' \
+		-i glib/Makefile.{am,in} || die
+
+	# Gentoo handles completions in a different directory
+	sed -i "s|^completiondir =.*|completiondir = $(get_bashcompdir)|" \
+		gio/Makefile.am || die
+
+	# Support compilation in clang until upstream solves this, upstream bug #691608
+	append-flags -Wno-format-nonliteral
+
+	epatch_user
+
+	# Needed for the punt-python-check patch, disabling timeout test
+	# Also needed to prevent croscompile failures, see bug #267603
+	# Also needed for the no-gdbus-codegen patch
+	eautoreconf
+
+	# FIXME: Really needed when running eautoreconf before? bug#????
+	#[[ ${CHOST} == *-freebsd* ]] && elibtoolize
+
+	epunt_cxx
+}
+
+multilib_src_configure() {
+	# Avoid circular depend with dev-util/pkgconfig and
+	# native builds (cross-compiles won't need pkg-config
+	# in the target ROOT to work here)
+	if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
+		if has_version sys-apps/dbus; then
+			export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
+			export DBUS1_LIBS="-ldbus-1"
+		fi
+		export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
+		export LIBFFI_LIBS="-lffi"
+	fi
+
+	local myconf
+
+	case "${CHOST}" in
+		*-mingw*)	myconf="${myconf} --with-threads=win32" ;;
+		*)		myconf="${myconf} --with-threads=posix" ;;
+	esac
+
+	# Building with --disable-debug highly unrecommended.  It will build glib in
+	# an unusable form as it disables some commonly used API.  Please do not
+	# convert this to the use_enable form, as it results in a broken build.
+	use debug && myconf="--enable-debug"
+
+	# Only used by the gresource bin
+	multilib_is_native_abi || myconf="${myconf} --disable-libelf"
+
+	# FIXME: change to "$(use_enable selinux)" when libselinux is multilibbed, bug #480960
+	if multilib_is_native_abi; then
+		myconf="${myconf} $(use_enable selinux)"
+	else
+		myconf="${myconf} --disable-selinux"
+	fi
+
+	# Always use internal libpcre, bug #254659
+	ECONF_SOURCE="${S}" econf ${myconf} \
+		$(use_enable xattr) \
+		$(use_enable fam) \
+		$(use_enable selinux) \
+		$(use_enable static-libs static) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable systemtap systemtap) \
+		$(use_enable test modular-tests) \
+		--disable-compile-warnings \
+		--disable-man \
+		--with-pcre=internal \
+		--with-xml-catalog="${EPREFIX}/etc/xml/catalog"
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	if use utils ; then
+		python_replicate_script "${ED}"/usr/bin/gtester-report
+	else
+		rm "${ED}usr/bin/gtester-report"
+		rm "${ED}usr/share/man/man1/gtester-report.1"
+	fi
+
+	# Do not install charset.alias even if generated, leave it to libiconv
+	rm -f "${ED}/usr/lib/charset.alias"
+
+	# Don't install gdb python macros, bug 291328
+	rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
+
+	# Completely useless with or without USE static-libs, people need to use
+	# pkg-config
+	prune_libtool_files --modules
+}
+
+multilib_src_test() {
+	gnome2_environment_reset
+
+	unset DBUS_SESSION_BUS_ADDRESS
+	export XDG_CONFIG_DIRS=/etc/xdg
+	export XDG_DATA_DIRS=/usr/local/share:/usr/share
+	export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
+	unset GSETTINGS_BACKEND # bug 352451
+	export LC_TIME=C # bug #411967
+	python_export_best
+
+	# Related test is a bit nitpicking
+	mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+	chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+
+	# Hardened: gdb needs this, bug #338891
+	if host-is-pax ; then
+		pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
+			|| die "Hardened adjustment failed"
+	fi
+
+	# Need X for dbus-launch session X11 initialization
+	Xemake check
+}
+
+pkg_postinst() {
+	if has_version '<x11-libs/gtk+-3.0.12:3'; then
+		# To have a clear upgrade path for gtk+-3.0.x users, have to resort to
+		# a warning instead of a blocker
+		ewarn
+		ewarn "Using <gtk+-3.0.12:3 with ${P} results in frequent crashes."
+		ewarn "You should upgrade to a newer version of gtk+:3 immediately."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/hardened-dev:musl commit in: dev-libs/glib/files/, dev-libs/glib/
@ 2014-04-08 19:35 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2014-04-08 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     5db44463d4c214f310998637cbf57b6caf8ec620
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Mon Apr  7 20:04:26 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Apr  8 19:35:13 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=5db44463

dev-libs/glib: bump to 2.38.2

---
 .../files/glib-2.37.x-external-gdbus-codegen.patch | 111 +++++++++
 dev-libs/glib/files/glib-2.38.2-configure.patch    |  24 ++
 dev-libs/glib/files/glib-2.38.2-sigaction.patch    |  23 ++
 dev-libs/glib/glib-2.38.2-r99.ebuild               | 274 +++++++++++++++++++++
 4 files changed, 432 insertions(+)

diff --git a/dev-libs/glib/files/glib-2.37.x-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.37.x-external-gdbus-codegen.patch
new file mode 100644
index 0000000..f87c146
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.37.x-external-gdbus-codegen.patch
@@ -0,0 +1,111 @@
+From 81f037771e2992834961cb5db08aece53a02b8ae Mon Sep 17 00:00:00 2001
+From: Priit Laes <plaes@plaes.org>
+Date: Thu, 28 Feb 2013 08:28:01 +0200
+Subject: [PATCH 3/4] Split out gdbus codegen
+
+---
+ configure.ac                                       | 17 ++++++++---------
+ docs/reference/gio/Makefile.am                     |  3 +--
+ gio/Makefile.am                                    |  2 +-
+ gio/tests/Makefile.am                              |  6 ++----
+ gio/tests/gdbus-object-manager-example/Makefile.am |  6 ++----
+ 5 files changed, 14 insertions(+), 20 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 797cb92..907c534 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -378,14 +378,14 @@ AC_SUBST(PERL_PATH)
+ # option to specify python interpreter to use; this just sets $PYTHON, so that
+ # we will fallback to reading $PYTHON if --with-python is not given, and
+ # python.m4 will get the expected input
+-AC_ARG_WITH(python,
+-            AS_HELP_STRING([--with-python=PATH],
+-                           [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
+-            [PYTHON="$withval"], [])
+-if test x"$PYTHON" = xyes; then
+-  AC_MSG_ERROR([--with-python option requires a path or program argument])
+-fi
+-AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
++# AC_ARG_WITH(python,
++#             AS_HELP_STRING([--with-python=PATH],
++#                            [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
++#             [PYTHON="$withval"], [])
++# if test x"$PYTHON" = xyes; then
++#   AC_MSG_ERROR([--with-python option requires a path or program argument])
++# fi
++# AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
+ 
+ 
+ dnl ***********************
+@@ -3784,7 +3784,6 @@ gobject/glib-mkenums
+ gobject/tests/Makefile
+ gthread/Makefile
+ gio/Makefile
+-gio/gdbus-2.0/codegen/Makefile
+ gio/gdbus-2.0/codegen/config.py
+ gio/gnetworking.h
+ gio/xdgmime/Makefile
+diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
+index 112626b..8ddcdbc 100644
+--- a/docs/reference/gio/Makefile.am
++++ b/docs/reference/gio/Makefile.am
+@@ -151,8 +151,7 @@ man_MANS +=			\
+ 	glib-compile-resources.1	\
+ 	gsettings.1		\
+ 	gresource.1		\
+-	gdbus.1			\
+-	gdbus-codegen.1
++	gdbus.1
+ 
+ XSLTPROC_FLAGS = \
+         --nonet \
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index 717419f..808b5dd 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -1,6 +1,6 @@
+ include $(top_srcdir)/glib.mk
+ 
+-SUBDIRS = gdbus-2.0/codegen
++SUBDIRS =
+ 
+ if OS_UNIX
+ SUBDIRS += xdgmime
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index 7224124..5c8baaa 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -359,10 +359,8 @@ gmenumodel_SOURCES                       = $(gdbus_sessionbus_sources) gmenumode
+ nodist_gdbus_test_codegen_SOURCES        = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
+ 
+ gdbus-test-codegen.o: gdbus-test-codegen-generated.h
+-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.project. \
+ 		--generate-c-code gdbus-test-codegen-generated \
+ 		--c-generate-object-manager \
+diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
+index d6d1412..62ef706 100644
+--- a/gio/tests/gdbus-object-manager-example/Makefile.am
++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
+@@ -11,10 +11,8 @@ GDBUS_GENERATED = \
+ 	gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml	\
+ 	$(NULL)
+ 
+-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
+ 		--c-namespace Example \
+ 		--c-generate-object-manager \
+-- 
+1.8.3.2
+

diff --git a/dev-libs/glib/files/glib-2.38.2-configure.patch b/dev-libs/glib/files/glib-2.38.2-configure.patch
new file mode 100644
index 0000000..8f08ca0
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.38.2-configure.patch
@@ -0,0 +1,24 @@
+From 838b49ead77c35d94fa16d48a6d7271bab082a71 Mon Sep 17 00:00:00 2001
+From: Patrick Welche <prlw1@cam.ac.uk>
+Date: Thu, 07 Nov 2013 10:58:46 +0000
+Subject: configure: test(1) uses = to test for string equality
+
+https://bugzilla.gnome.org/show_bug.cgi?id=711600
+---
+(limited to 'm4macros/glibtests.m4')
+
+diff --git a/m4macros/glibtests.m4 b/m4macros/glibtests.m4
+index 27e9024..7d5920a 100644
+--- a/m4macros/glibtests.m4
++++ b/m4macros/glibtests.m4
+@@ -21,7 +21,7 @@ AC_DEFUN([GLIB_TESTS],
+                   *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
+                  esac])
+   AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
+-  if test "$ENABLE_INSTALLED_TESTS" == "1"; then
++  if test "$ENABLE_INSTALLED_TESTS" = "1"; then
+     AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
+     AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
+   fi
+--
+cgit v0.9.2

diff --git a/dev-libs/glib/files/glib-2.38.2-sigaction.patch b/dev-libs/glib/files/glib-2.38.2-sigaction.patch
new file mode 100644
index 0000000..f87e224
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.38.2-sigaction.patch
@@ -0,0 +1,23 @@
+From 81d0ebe29ccd852e969acda7394969e3f13eb136 Mon Sep 17 00:00:00 2001
+From: Stef Walter <stefw@gnome.org>
+Date: Thu, 31 Oct 2013 11:43:14 +0100
+Subject: [PATCH] gmain: Fix use of uninitialized memory in sigaction structure
+
+https://bugzilla.gnome.org/show_bug.cgi?id=711754
+
+
+diff --git a/glib/gmain.c b/glib/gmain.c
+index 9c37bb2..608c1a5 100644
+--- a/glib/gmain.c
++++ b/glib/gmain.c
+@@ -4978,6 +4978,7 @@ unref_unix_signal_handler_unlocked (int signum)
+   if (unix_signal_refcount[signum] == 0)
+     {
+       struct sigaction action;
++      memset (&action, 0, sizeof (action));
+       action.sa_handler = SIG_DFL;
+       sigemptyset (&action.sa_mask);
+       sigaction (signum, &action, NULL);
+--
+Gitg
+

diff --git a/dev-libs/glib/glib-2.38.2-r99.ebuild b/dev-libs/glib/glib-2.38.2-r99.ebuild
new file mode 100644
index 0000000..f874902
--- /dev/null
+++ b/dev-libs/glib/glib-2.38.2-r99.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/glib/glib-2.38.2-r1.ebuild,v 1.3 2014/03/15 11:25:49 pacho Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python2_{6,7} )
+# Avoid runtime dependency on python when USE=test
+
+inherit autotools bash-completion-r1 gnome.org libtool eutils flag-o-matic gnome2-utils multilib pax-utils python-r1 toolchain-funcs versionator virtualx linux-info multilib-minimal
+
+DESCRIPTION="The GLib library of C routines"
+HOMEPAGE="http://www.gtk.org/"
+SRC_URI="${SRC_URI}
+	http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
+
+LICENSE="LGPL-2+"
+SLOT="2"
+IUSE="debug fam kernel_linux selinux static-libs systemtap test utils xattr"
+KEYWORDS="amd64 ~arm ~mips x86"
+
+# FIXME: want libselinux[${MULTILIB_USEDEP}] - bug #480960
+RDEPEND="
+	virtual/libiconv[${MULTILIB_USEDEP}]
+	virtual/libffi[${MULTILIB_USEDEP}]
+	sys-libs/zlib[${MULTILIB_USEDEP}]
+	|| (
+		>=dev-libs/elfutils-0.142
+		>=dev-libs/libelf-0.8.12
+		>=sys-freebsd/freebsd-lib-9.2_rc1
+		)
+	selinux? ( sys-libs/libselinux )
+	xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+	fam? ( virtual/fam[${MULTILIB_USEDEP}] )
+	utils? (
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}] )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)
+"
+DEPEND="${RDEPEND}
+	app-text/docbook-xml-dtd:4.1.2
+	>=dev-libs/libxslt-1.0
+	>=sys-devel/gettext-0.11
+	>=dev-util/gtk-doc-am-1.15
+	systemtap? ( >=dev-util/systemtap-1.3 )
+	test? (
+		sys-devel/gdb
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}]
+		>=sys-apps/dbus-1.2.14 )
+	!<dev-libs/gobject-introspection-1.$(get_version_component_range 2)
+	!<dev-util/gtk-doc-1.15-r2
+"
+# gobject-introspection blocker to ensure people don't mix
+# different g-i and glib major versions
+
+PDEPEND="x11-misc/shared-mime-info
+	!<gnome-base/gvfs-1.6.4-r990"
+# shared-mime-info needed for gio/xdgmime, bug #409481
+# Earlier versions of gvfs do not work with glib
+
+DOCS="AUTHORS ChangeLog* NEWS* README"
+
+pkg_setup() {
+	if use kernel_linux ; then
+		CONFIG_CHECK="~INOTIFY_USER"
+		if use test; then
+			CONFIG_CHECK="~IPV6"
+			WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
+			export IPV6_DISABLED="yes"
+		fi
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	# Prevent build failure in stage3 where pkgconfig is not available, bug #481056
+	mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
+
+	# Fix gmodule issues on fbsd; bug #184301, upstream bug #107626
+	epatch "${FILESDIR}"/${PN}-2.12.12-fbsd.patch
+
+	if use test; then
+		# Do not try to remove files on live filesystem, upstream bug #619274
+		sed 's:^\(.*"/desktop-app-info/delete".*\):/*\1*/:' \
+			-i "${S}"/gio/tests/desktop-app-info.c || die "sed failed"
+
+		# Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
+		if ! has_version dev-util/desktop-file-utils ; then
+			ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
+			ewarn "think on installing it to get these tests run."
+			sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
+			sed -i -e "/desktop-app-info\/default/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/fallback/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/lastused/d" gio/tests/desktop-app-info.c || die
+		fi
+
+		# gdesktopappinfo requires existing terminal (gnome-terminal or any
+		# other), falling back to xterm if one doesn't exist
+		if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
+			ewarn "Some tests will be skipped due to missing terminal program"
+			sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
+		fi
+
+		# Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853
+		if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:3' ; then
+			ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:3"
+			ewarn "not being present on your system, think on installing them to get these tests run."
+			sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die
+			sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die
+			sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die
+			sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die
+			sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die
+			sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die
+			sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die
+			# needed to prevent gdbus-threading from asserting
+			ln -sfn $(type -P true) gio/tests/gdbus-testserver.py
+		fi
+
+		# Some tests need ipv6, upstream bug #667468
+		if [[ -n "${IPV6_DISABLED}" ]]; then
+			sed -i -e "/socket\/ipv6_sync/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_async/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_v4mapped/d" gio/tests/socket.c || die
+		fi
+
+		# Test relies on /usr/bin/true, but we have /bin/true, upstream bug #698655
+		sed -i -e "s:/usr/bin/true:/bin/true:" gio/tests/desktop-app-info.c || die
+	fi
+
+	# thread test fails, upstream bug #679306
+	epatch "${FILESDIR}/${PN}-2.34.0-testsuite-skip-thread4.patch"
+
+	# gdbus-codegen is a separate package
+	epatch "${FILESDIR}/${PN}-2.37.x-external-gdbus-codegen.patch"
+
+	# do not allow libgobject to unload; bug #405173, https://bugzilla.gnome.org/show_bug.cgi?id=707298
+	epatch "${FILESDIR}/${PN}-2.36.4-znodelete.patch"
+
+	# patches from 2.39.x / 2.40.x
+	epatch "${FILESDIR}/${PN}-2.38.2-sigaction.patch" #501330
+
+	# leave python shebang alone
+	sed -e '/${PYTHON}/d' \
+		-i glib/Makefile.{am,in} || die
+
+	# Gentoo handles completions in a different directory
+	sed -i "s|^completiondir =.*|completiondir = $(get_bashcompdir)|" \
+		gio/Makefile.am || die
+
+	# Support compilation in clang until upstream solves this, upstream bug #691608
+	append-flags -Wno-format-nonliteral
+
+	epatch "${FILESDIR}"/${P}-configure.patch #500996
+
+	epatch_user
+
+	# Needed for the punt-python-check patch, disabling timeout test
+	# Also needed to prevent cross-compile failures, see bug #267603
+	# Also needed for the no-gdbus-codegen patch
+	eautoreconf
+
+	# FIXME: Really needed when running eautoreconf before? bug#????
+	#[[ ${CHOST} == *-freebsd* ]] && elibtoolize
+
+	epunt_cxx
+}
+
+multilib_src_configure() {
+	# Avoid circular depend with dev-util/pkgconfig and
+	# native builds (cross-compiles won't need pkg-config
+	# in the target ROOT to work here)
+	if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
+		if has_version sys-apps/dbus; then
+			export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
+			export DBUS1_LIBS="-ldbus-1"
+		fi
+		export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
+		export LIBFFI_LIBS="-lffi"
+	fi
+
+	local myconf
+
+	case "${CHOST}" in
+		*-mingw*) myconf="${myconf} --with-threads=win32" ;;
+		*)        myconf="${myconf} --with-threads=posix" ;;
+	esac
+
+	# Building with --disable-debug highly unrecommended.  It will build glib in
+	# an unusable form as it disables some commonly used API.  Please do not
+	# convert this to the use_enable form, as it results in a broken build.
+	use debug && myconf="--enable-debug"
+
+	# Only used by the gresource bin
+	multilib_is_native_abi || myconf="${myconf} --disable-libelf"
+
+	# FIXME: change to "$(use_enable selinux)" when libselinux is multilibbed, bug #480960
+	if multilib_is_native_abi; then
+		myconf="${myconf} $(use_enable selinux)"
+	else
+		myconf="${myconf} --disable-selinux"
+	fi
+
+	# Always use internal libpcre, bug #254659
+	ECONF_SOURCE="${S}" econf ${myconf} \
+		$(use_enable xattr) \
+		$(use_enable fam) \
+		$(use_enable selinux) \
+		$(use_enable static-libs static) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable systemtap systemtap) \
+		--disable-compile-warnings \
+		--disable-man \
+		--with-pcre=internal \
+		--with-xml-catalog="${EPREFIX}/etc/xml/catalog"
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	if use utils ; then
+		python_replicate_script "${ED}"/usr/bin/gtester-report
+	else
+		rm "${ED}usr/bin/gtester-report"
+		rm "${ED}usr/share/man/man1/gtester-report.1"
+	fi
+
+	# Do not install charset.alias even if generated, leave it to libiconv
+	rm -f "${ED}/usr/lib/charset.alias"
+
+	# Don't install gdb python macros, bug 291328
+	rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
+
+	# Completely useless with or without USE static-libs, people need to use
+	# pkg-config
+	prune_libtool_files --modules
+}
+
+multilib_src_test() {
+	gnome2_environment_reset
+
+	unset DBUS_SESSION_BUS_ADDRESS
+	export XDG_CONFIG_DIRS=/etc/xdg
+	export XDG_DATA_DIRS=/usr/local/share:/usr/share
+	export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
+	unset GSETTINGS_BACKEND # bug 352451
+	export LC_TIME=C # bug #411967
+	python_export_best
+
+	# Related test is a bit nitpicking
+	mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+	chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+
+	# Hardened: gdb needs this, bug #338891
+	if host-is-pax ; then
+		pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
+			|| die "Hardened adjustment failed"
+	fi
+
+	# Need X for dbus-launch session X11 initialization
+	Xemake check
+}
+
+pkg_postinst() {
+	if has_version '<x11-libs/gtk+-3.0.12:3'; then
+		# To have a clear upgrade path for gtk+-3.0.x users, have to resort to
+		# a warning instead of a blocker
+		ewarn
+		ewarn "Using <gtk+-3.0.12:3 with ${P} results in frequent crashes."
+		ewarn "You should upgrade to a newer version of gtk+:3 immediately."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/hardened-dev:musl commit in: dev-libs/glib/files/, dev-libs/glib/
@ 2014-08-19 13:59 Anthony G. Basile
  2014-08-09 13:51 ` Anthony G. Basile
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony G. Basile @ 2014-08-19 13:59 UTC (permalink / raw
  To: gentoo-commits

commit:     e71d68c10a012b234830bc5dfe0d0542123a6531
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  9 13:53:37 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Aug  9 13:53:37 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=e71d68c1

dev-libs/glib: bump to 2.40.0

Package-Manager: portage-2.2.8-r1
RepoMan-Options: --force
Manifest-Sign-Key: 0xF52D4BBA

---
 dev-libs/glib/files/glib-2.12.12-fbsd.patch        |  24 +-
 .../files/glib-2.34.0-testsuite-skip-thread4.patch |  16 +-
 dev-libs/glib/files/glib-2.36.4-znodelete.patch    |  15 +-
 .../files/glib-2.40.0-external-gdbus-codegen.patch |  95 +++++++
 dev-libs/glib/glib-2.40.0-r99.ebuild               | 280 +++++++++++++++++++++
 5 files changed, 410 insertions(+), 20 deletions(-)

diff --git a/dev-libs/glib/files/glib-2.12.12-fbsd.patch b/dev-libs/glib/files/glib-2.12.12-fbsd.patch
index bba6329..5aca695 100644
--- a/dev-libs/glib/files/glib-2.12.12-fbsd.patch
+++ b/dev-libs/glib/files/glib-2.12.12-fbsd.patch
@@ -1,7 +1,18 @@
-diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN glib-2.12.12.orig/gmodule/gmodule-dl.c glib-2.12.12/gmodule/gmodule-dl.c
---- glib-2.12.12.orig/gmodule/gmodule-dl.c	2007-05-01 19:12:40.000000000 -0400
-+++ glib-2.12.12/gmodule/gmodule-dl.c	2007-07-05 20:10:51.000000000 -0400
-@@ -106,6 +106,7 @@ _g_module_open (const gchar *file_name,
+From deeb71226d4ab465d48805d899ec88eb836a6966 Mon Sep 17 00:00:00 2001
+From: Daniel Gryniewicz <dang@gentoo.org>
+Date: Sun, 24 Nov 2013 19:46:13 +0100
+Subject: [PATCH 1/4] Fix gmodule issue on FreeBSD
+
+Gentoo bug #184301, Gnome bug #107626.
+---
+ gmodule/gmodule-dl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c
+index a606f17..57fc41b 100644
+--- a/gmodule/gmodule-dl.c
++++ b/gmodule/gmodule-dl.c
+@@ -107,6 +107,7 @@ _g_module_open (const gchar *file_name,
  static gpointer
  _g_module_self (void)
  {
@@ -9,7 +20,7 @@ diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN glib-2.12.12.orig/gmodul
    gpointer handle;
    
    /* to query symbols from the program itself, special link options
-@@ -117,6 +118,9 @@ _g_module_self (void)
+@@ -122,6 +123,9 @@ _g_module_self (void)
      g_module_set_error (fetch_dlerror (TRUE));
    
    return handle;
@@ -19,3 +30,6 @@ diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN glib-2.12.12.orig/gmodul
  }
  
  static void
+-- 
+1.8.3.2
+

diff --git a/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch b/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch
index f409094..584b56f 100644
--- a/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch
+++ b/dev-libs/glib/files/glib-2.34.0-testsuite-skip-thread4.patch
@@ -1,15 +1,15 @@
-From 8a8112aad6dc98aaaf9767b31e48f5ae8fabd858 Mon Sep 17 00:00:00 2001
+From 4881b5d303512208b55f5bf78b91cd6a85e5034c Mon Sep 17 00:00:00 2001
 From: Priit Laes <plaes@plaes.org>
 Date: Tue, 3 Jul 2012 11:21:56 +0300
-Subject: [PATCH] Gentoo: skip over thread/thread4 test failure
+Subject: [PATCH 2/4] Gentoo: skip over thread/thread4 test failure
 
 https://bugzilla.gnome.org/show_bug.cgi?id=679306
 ---
- glib/tests/thread.c |    5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
+ glib/tests/thread.c | 5 +++++
+ 1 file changed, 5 insertions(+)
 
 diff --git a/glib/tests/thread.c b/glib/tests/thread.c
-index 29b3850..ffe8087 100644
+index 539782e..179ec06 100644
 --- a/glib/tests/thread.c
 +++ b/glib/tests/thread.c
 @@ -124,6 +124,8 @@ test_thread3 (void)
@@ -21,7 +21,7 @@ index 29b3850..ffe8087 100644
  /* test that thread creation fails as expected,
   * by setting RLIMIT_NPROC ridiculously low
   */
-@@ -152,6 +154,7 @@ test_thread4 (void)
+@@ -158,6 +160,7 @@ test_thread4 (void)
      g_error ("resetting RLIMIT_NPROC failed: %s\n", g_strerror (ret));
  #endif
  }
@@ -29,7 +29,7 @@ index 29b3850..ffe8087 100644
  
  static void
  test_thread5 (void)
-@@ -195,7 +198,9 @@ main (int argc, char *argv[])
+@@ -203,7 +206,9 @@ main (int argc, char *argv[])
    g_test_add_func ("/thread/thread1", test_thread1);
    g_test_add_func ("/thread/thread2", test_thread2);
    g_test_add_func ("/thread/thread3", test_thread3);
@@ -40,5 +40,5 @@ index 29b3850..ffe8087 100644
    g_test_add_func ("/thread/thread6", test_thread6);
  
 -- 
-1.7.8.6
+1.8.3.2
 

diff --git a/dev-libs/glib/files/glib-2.36.4-znodelete.patch b/dev-libs/glib/files/glib-2.36.4-znodelete.patch
index e55586c..b936fbd 100644
--- a/dev-libs/glib/files/glib-2.36.4-znodelete.patch
+++ b/dev-libs/glib/files/glib-2.36.4-znodelete.patch
@@ -1,7 +1,7 @@
-From 242de638a030e1fb3b467af182d985d7c3bbf185 Mon Sep 17 00:00:00 2001
+From 196ea5ab614e5357da48acf73a373f103e61ee0b Mon Sep 17 00:00:00 2001
 From: Alexandre Rostovtsev <tetromino@gentoo.org>
 Date: Mon, 2 Sep 2013 13:59:18 -0400
-Subject: [PATCH] gobject: try to link with -Wl,-z,nodelete
+Subject: [PATCH 4/4] gobject: try to link with -Wl,-z,nodelete
 
 Since the type system does not support reloading its data and assumes
 that libgobject remains loaded for the lifetime of the process, we
@@ -14,12 +14,12 @@ https://bugzilla.gnome.org/show_bug.cgi?id=707298
  2 files changed, 25 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index 0a63601..dd1045a 100644
+index 907c534..266c45d 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -3668,6 +3668,30 @@ fi
+@@ -3669,6 +3669,30 @@ fi
  AC_SUBST(GLIB_LINK_FLAGS)
-
+ 
  dnl
 +dnl Check for -z,nodelete linker flag: the type system assumes that
 +dnl libgobject stays loaded for the lifetime of the process
@@ -53,12 +53,13 @@ index 1509616..181ad7d 100644
 --- a/gobject/Makefile.am
 +++ b/gobject/Makefile.am
 @@ -45,6 +45,7 @@ endif
-
+ 
  libgobjectincludedir = $(includedir)/glib-2.0/gobject
  libgobject_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
 +  $(GOBJECT_LINK_FLAGS) \
    $(gobject_win32_res_ldflag) \
    -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
    -export-dynamic $(no_undefined)
---
+-- 
 1.8.3.2
+

diff --git a/dev-libs/glib/files/glib-2.40.0-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.40.0-external-gdbus-codegen.patch
new file mode 100644
index 0000000..50a9370
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.40.0-external-gdbus-codegen.patch
@@ -0,0 +1,95 @@
+diff --git a/configure.ac b/configure.ac
+index a01e58d..59d4527 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -367,14 +367,14 @@ AC_SUBST(PERL_PATH)
+ # option to specify python interpreter to use; this just sets $PYTHON, so that
+ # we will fallback to reading $PYTHON if --with-python is not given, and
+ # python.m4 will get the expected input
+-AC_ARG_WITH(python,
+-            AS_HELP_STRING([--with-python=PATH],
+-                           [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
+-            [PYTHON="$withval"], [])
+-if test x"$PYTHON" = xyes; then
+-  AC_MSG_ERROR([--with-python option requires a path or program argument])
+-fi
+-AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
++# AC_ARG_WITH(python,
++#             AS_HELP_STRING([--with-python=PATH],
++#                            [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
++#             [PYTHON="$withval"], [])
++# if test x"$PYTHON" = xyes; then
++#   AC_MSG_ERROR([--with-python option requires a path or program argument])
++# fi
++# AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
+ 
+ 
+ dnl ***********************
+@@ -3580,7 +3580,6 @@ gobject/glib-mkenums
+ gobject/tests/Makefile
+ gthread/Makefile
+ gio/Makefile
+-gio/gdbus-2.0/codegen/Makefile
+ gio/gdbus-2.0/codegen/config.py
+ gio/gnetworking.h
+ gio/xdgmime/Makefile
+diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
+index 47fdd38..c7eb136 100644
+--- a/docs/reference/gio/Makefile.am
++++ b/docs/reference/gio/Makefile.am
+@@ -157,8 +157,7 @@ man_MANS +=			\
+ 	glib-compile-resources.1	\
+ 	gsettings.1		\
+ 	gresource.1		\
+-	gdbus.1			\
+-	gdbus-codegen.1
++	gdbus.1
+ 
+ XSLTPROC_FLAGS = \
+         --nonet \
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index e993e2f..025ad94 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -1,6 +1,6 @@
+ include $(top_srcdir)/glib.mk
+ 
+-SUBDIRS = gdbus-2.0/codegen
++SUBDIRS =
+ 
+ if OS_UNIX
+ SUBDIRS += xdgmime
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index 2c54e59..3cd3c5a 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -437,10 +437,8 @@ gnotification_SOURCES                    = $(gdbus_sessionbus_sources) gnotifica
+ 
+ BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
+ gdbus-test-codegen.o: gdbus-test-codegen-generated.h
+-gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++gdbus-test-codegen-generated.h: test-codegen.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.project. \
+ 		--generate-c-code gdbus-test-codegen-generated \
+ 		--c-generate-object-manager \
+diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
+index d6d1412..62ef706 100644
+--- a/gio/tests/gdbus-object-manager-example/Makefile.am
++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
+@@ -11,10 +11,8 @@ GDBUS_GENERATED = \
+ 	gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml	\
+ 	$(NULL)
+ 
+-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+-	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+-		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
+-		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
++	$(AM_V_GEN) gdbus-codegen \
+ 		--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
+ 		--c-namespace Example \
+ 		--c-generate-object-manager \

diff --git a/dev-libs/glib/glib-2.40.0-r99.ebuild b/dev-libs/glib/glib-2.40.0-r99.ebuild
new file mode 100644
index 0000000..facf4ca
--- /dev/null
+++ b/dev-libs/glib/glib-2.40.0-r99.ebuild
@@ -0,0 +1,280 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/glib/glib-2.40.0-r1.ebuild,v 1.8 2014/08/07 18:03:07 jer Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python2_{6,7} )
+# Avoid runtime dependency on python when USE=test
+
+inherit autotools bash-completion-r1 gnome.org libtool eutils flag-o-matic gnome2-utils multilib pax-utils python-r1 toolchain-funcs versionator virtualx linux-info multilib-minimal
+
+DESCRIPTION="The GLib library of C routines"
+HOMEPAGE="http://www.gtk.org/"
+SRC_URI="${SRC_URI}
+	http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
+
+LICENSE="LGPL-2+"
+SLOT="2"
+IUSE="debug fam kernel_linux +mime selinux static-libs systemtap test utils xattr"
+KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+
+# FIXME: want >=libselinux-2.2.2-r4[${MULTILIB_USEDEP}] - bug #480960
+RDEPEND="
+	!<dev-util/gdbus-codegen-${PV}
+	>=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+	>=virtual/libffi-3.0.13-r1[${MULTILIB_USEDEP}]
+	>=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+	|| (
+		>=dev-libs/elfutils-0.142
+		>=dev-libs/libelf-0.8.12
+		>=sys-freebsd/freebsd-lib-9.2_rc1
+		)
+	selinux? ( sys-libs/libselinux )
+	xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] )
+	fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
+	utils? (
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}] )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)
+"
+DEPEND="${RDEPEND}
+	app-text/docbook-xml-dtd:4.1.2
+	>=dev-libs/libxslt-1.0
+	>=sys-devel/gettext-0.11
+	>=dev-util/gtk-doc-am-1.20
+	systemtap? ( >=dev-util/systemtap-1.3 )
+	test? (
+		sys-devel/gdb
+		${PYTHON_DEPS}
+		>=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}]
+		>=sys-apps/dbus-1.2.14 )
+	!<dev-util/gtk-doc-1.15-r2
+"
+# gobject-introspection blocker to ensure people don't mix
+# different g-i and glib major versions
+
+PDEPEND="!<gnome-base/gvfs-1.6.4-r990
+	mime? ( x11-misc/shared-mime-info )
+"
+# shared-mime-info needed for gio/xdgmime, bug #409481
+# Earlier versions of gvfs do not work with glib
+
+DOCS="AUTHORS ChangeLog* NEWS* README"
+
+pkg_setup() {
+	if use kernel_linux ; then
+		CONFIG_CHECK="~INOTIFY_USER"
+		if use test; then
+			CONFIG_CHECK="~IPV6"
+			WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
+			export IPV6_DISABLED="yes"
+		fi
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	# Prevent build failure in stage3 where pkgconfig is not available, bug #481056
+	mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
+
+	# Fix gmodule issues on fbsd; bug #184301, upstream bug #107626
+	epatch "${FILESDIR}"/${PN}-2.12.12-fbsd.patch
+
+	if use test; then
+		# Do not try to remove files on live filesystem, upstream bug #619274
+		sed 's:^\(.*"/desktop-app-info/delete".*\):/*\1*/:' \
+			-i "${S}"/gio/tests/desktop-app-info.c || die "sed failed"
+
+		# Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
+		if ! has_version dev-util/desktop-file-utils ; then
+			ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
+			ewarn "think on installing it to get these tests run."
+			sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
+			sed -i -e "/desktop-app-info\/default/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/fallback/d" gio/tests/desktop-app-info.c || die
+			sed -i -e "/desktop-app-info\/lastused/d" gio/tests/desktop-app-info.c || die
+		fi
+
+		# gdesktopappinfo requires existing terminal (gnome-terminal or any
+		# other), falling back to xterm if one doesn't exist
+		if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
+			ewarn "Some tests will be skipped due to missing terminal program"
+			sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
+		fi
+
+		# Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853
+		if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:3' ; then
+			ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:3"
+			ewarn "not being present on your system, think on installing them to get these tests run."
+			sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die
+			sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die
+			sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die
+			sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die
+			sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die
+			sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die
+			sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die
+			# needed to prevent gdbus-threading from asserting
+			ln -sfn $(type -P true) gio/tests/gdbus-testserver.py
+		fi
+
+		# Some tests need ipv6, upstream bug #667468
+		if [[ -n "${IPV6_DISABLED}" ]]; then
+			sed -i -e "/socket\/ipv6_sync/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_async/d" gio/tests/socket.c || die
+			sed -i -e "/socket\/ipv6_v4mapped/d" gio/tests/socket.c || die
+		fi
+
+		# Test relies on /usr/bin/true, but we have /bin/true, upstream bug #698655
+		sed -i -e "s:/usr/bin/true:/bin/true:" gio/tests/desktop-app-info.c || die
+
+		# thread test fails, upstream bug #679306
+		epatch "${FILESDIR}/${PN}-2.34.0-testsuite-skip-thread4.patch"
+	else
+		# Don't build tests, also prevents extra deps, bug #512022
+		sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die
+	fi
+
+	# gdbus-codegen is a separate package
+	epatch "${FILESDIR}/${PN}-2.40.0-external-gdbus-codegen.patch"
+
+	# do not allow libgobject to unload; bug #405173, https://bugzilla.gnome.org/show_bug.cgi?id=707298
+	epatch "${FILESDIR}/${PN}-2.36.4-znodelete.patch"
+
+	# leave python shebang alone
+	sed -e '/${PYTHON}/d' \
+		-i glib/Makefile.{am,in} || die
+
+	# Gentoo handles completions in a different directory
+	sed -i "s|^completiondir =.*|completiondir = $(get_bashcompdir)|" \
+		gio/Makefile.am || die
+
+	# Support compilation in clang until upstream solves this, upstream bug #691608
+	append-flags -Wno-format-nonliteral
+
+	epatch_user
+
+	# Needed for the punt-python-check patch, disabling timeout test
+	# Also needed to prevent cross-compile failures, see bug #267603
+	# Also needed for the no-gdbus-codegen patch
+	eautoreconf
+
+	# FIXME: Really needed when running eautoreconf before? bug#????
+	#[[ ${CHOST} == *-freebsd* ]] && elibtoolize
+
+	epunt_cxx
+}
+
+multilib_src_configure() {
+	# Avoid circular depend with dev-util/pkgconfig and
+	# native builds (cross-compiles won't need pkg-config
+	# in the target ROOT to work here)
+	if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
+		if has_version sys-apps/dbus; then
+			export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
+			export DBUS1_LIBS="-ldbus-1"
+		fi
+		export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
+		export LIBFFI_LIBS="-lffi"
+	fi
+
+	local myconf
+
+	case "${CHOST}" in
+		*-mingw*) myconf="${myconf} --with-threads=win32" ;;
+		*)        myconf="${myconf} --with-threads=posix" ;;
+	esac
+
+	# Building with --disable-debug highly unrecommended.  It will build glib in
+	# an unusable form as it disables some commonly used API.  Please do not
+	# convert this to the use_enable form, as it results in a broken build.
+	use debug && myconf="--enable-debug"
+
+	# Only used by the gresource bin
+	multilib_is_native_abi || myconf="${myconf} --disable-libelf"
+
+	# FIXME: change to "$(use_enable selinux)" when libselinux is multilibbed, bug #480960
+	if multilib_is_native_abi; then
+		myconf="${myconf} $(use_enable selinux)"
+	else
+		myconf="${myconf} --disable-selinux"
+	fi
+
+	# Always use internal libpcre, bug #254659
+	ECONF_SOURCE="${S}" econf ${myconf} \
+		$(use_enable xattr) \
+		$(use_enable fam) \
+		$(use_enable selinux) \
+		$(use_enable static-libs static) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable systemtap systemtap) \
+		--disable-compile-warnings \
+		--disable-man \
+		--with-pcre=internal \
+		--with-xml-catalog="${EPREFIX}/etc/xml/catalog"
+
+	if multilib_is_native_abi; then
+		local d
+		for d in glib gio gobject; do
+			ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
+		done
+	fi
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	if use utils ; then
+		python_replicate_script "${ED}"/usr/bin/gtester-report
+	else
+		rm "${ED}usr/bin/gtester-report"
+		rm "${ED}usr/share/man/man1/gtester-report.1"
+	fi
+
+	# Do not install charset.alias even if generated, leave it to libiconv
+	rm -f "${ED}/usr/lib/charset.alias"
+
+	# Don't install gdb python macros, bug 291328
+	rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
+
+	# Completely useless with or without USE static-libs, people need to use
+	# pkg-config
+	prune_libtool_files --modules
+}
+
+multilib_src_test() {
+	gnome2_environment_reset
+
+	unset DBUS_SESSION_BUS_ADDRESS
+	export XDG_CONFIG_DIRS=/etc/xdg
+	export XDG_DATA_DIRS=/usr/local/share:/usr/share
+	export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
+	unset GSETTINGS_BACKEND # bug 352451
+	export LC_TIME=C # bug #411967
+	python_export_best
+
+	# Related test is a bit nitpicking
+	mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+	chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
+
+	# Hardened: gdb needs this, bug #338891
+	if host-is-pax ; then
+		pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
+			|| die "Hardened adjustment failed"
+	fi
+
+	# Need X for dbus-launch session X11 initialization
+	Xemake check
+}
+
+pkg_postinst() {
+	if has_version '<x11-libs/gtk+-3.0.12:3'; then
+		# To have a clear upgrade path for gtk+-3.0.x users, have to resort to
+		# a warning instead of a blocker
+		ewarn
+		ewarn "Using <gtk+-3.0.12:3 with ${P} results in frequent crashes."
+		ewarn "You should upgrade to a newer version of gtk+:3 immediately."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-19 13:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-29 13:28 [gentoo-commits] proj/hardened-dev:musl commit in: dev-libs/glib/files/, dev-libs/glib/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2014-01-06 17:36 Anthony G. Basile
2014-04-08 19:35 Anthony G. Basile
2014-08-19 13:59 Anthony G. Basile
2014-08-09 13:51 ` Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox