changeset 6429:145eca92e235

Update glib to 2.44.1 or 2.38.2 freebsd: 2.38.2 others: 2.44.1
author Masamichi Hosoda <trueroad@trueroad.jp>
date Sat, 29 Aug 2015 13:44:49 +0900
parents 7150b1f25567
children 8418fa1209e8
files gub/specs/glib.py patches/glib-2.44.1-darwin-in.patch patches/glib-2.44.1-darwin-x86-lib-depend.patch patches/glib-2.44.1-darwin-x86-zlib.patch patches/glib-2.44.1-mingw-w64-if_nametoindex.patch
diffstat 5 files changed, 211 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/gub/specs/glib.py	Fri Aug 28 18:11:52 2015 +0900
+++ b/gub/specs/glib.py	Sat Aug 29 13:44:49 2015 +0900
@@ -2,84 +2,70 @@
 from gub import misc
 from gub import tools
 from gub import target
-from gub import w32
 
 class Glib (target.AutoBuild):
-    source = 'http://ftp.gnome.org/pub/GNOME/platform/2.27/2.27.91/sources/glib-2.21.5.tar.gz'
-    ##source = 'http://ftp.gnome.org/pub/GNOME/platform/2.25/2.25.5/sources/glib-2.19.5.tar.gz'
-    dependencies = ['tools::glib', 'tools::libtool', 'gettext-devel']
+    source = 'http://ftp.gnome.org/pub/GNOME/sources/glib/2.44/glib-2.44.1.tar.xz'
+    dependencies = ['tools::glib', 'tools::libtool', 'tools::xzutils', 'gettext-devel', 'zlib-devel', 'libffi-devel', ]
     config_cache_overrides = target.AutoBuild.config_cache_overrides + '''
 glib_cv_stack_grows=${glib_cv_stack_grows=no}
 '''
-    if 'stat' in misc.librestrict (): # stats for /USR/include/glib/...
-        install_flags = (target.AutoBuild.install_flags
-                         + ' LD_PRELOAD=%(tools_prefix)s/lib/librestrict-open.so')
-    def patch (self):
-        target.AutoBuild.patch (self)
-        self.file_sub ([('GIO_MODULE_DIR', 'getenv ("GIO_MODULE_DIR")')],
-                       '%(srcdir)s/gio/giomodule.c', must_succeed=True)
-    def update_libtool (self): # linux-x86, linux-ppc, freebsd-x86
-        target.AutoBuild.update_libtool (self)
-        self.map_locate (w32.libtool_disable_relink, '%(builddir)s', 'libtool')
-        #URGME, 2.19.5: relinking libgio is broken, /usr/lib is inserted
-        '''root/usr/lib/usr/lib -L/usr/lib -lgobject-2.0 -L/home/janneke/vc/gub/target/linux-ppc/install/glib-2.19.5-root/usr/lib/home/janneke/vc/gub/target/linux-ppc/build/glib-2.19.5/gmodule/.libs -lgmodule-2.0 -ldl -lglib-2.0    -Wl,-soname -Wl,libgio-2.0.so.0 -Wl,-version-script -Wl,.libs/libgio-2.0.ver -o .libs/libgio-2.0.so.0.1905.0
-/home/janneke/vc/gub/target/linux-ppc/root/usr/cross/bin/powerpc-linux-ld: skipping incompatible /usr/lib/libgobject-2.0.so when searching for -lgobject-2.0
-/home/janneke/vc/gub/target/linux-ppc/root/usr/cross/bin/powerpc-linux-ld: skipping incompatible /usr/lib/libgobject-2.0.a when searching for -lgobject-2.0
-/home/janneke/vc/gub/target/linux-ppc/root/usr/cross/bin/powerpc-linux-ld: cannot find -lgobject-2.0
-collect2: ld returned 1 exit status
-libtool: install: error: relink `libgio-2.0.la' with the above command before installing it
-make[5]: *** [install-libLTLIBRARIES] Error 1
-'''
     def install (self):
         target.AutoBuild.install (self)
         self.system ('rm -f %(install_prefix)s/lib/charset.alias')
 
 class Glib__darwin (Glib):
+    # Darwin 8 SDK (Mac OS X 10.4) can not compile glib 2.45.3+.
+    # It needs OS X 10.9.
+    patches = Glib.patches + ['glib-2.44.1-darwin-in.patch']
     def configure (self):
         Glib.configure (self)
-        self.file_sub ([('nmedit', '%(target_architecture)s-nmedit')],
-                       '%(builddir)s/libtool')
+        self.file_sub ([('-Werror=format=2', '')],
+                       '%(builddir)s/glib/Makefile')
+        self.file_sub ([('-Werror=declaration-after-statement', '')],
+                       '%(builddir)s/gio/Makefile')
 
 class Glib__darwin__x86 (Glib__darwin):
-    # LIBS bugfix from:
-    #   https://bugzilla.gnome.org/show_bug.cgi?id=586150
-    configure_variables = Glib.configure_variables + ' LIBS=-lresolv'
-    def compile (self):
-        self.file_sub ([('(SUBDIRS = .*) tests', r'\1'),
-                        (r'GTESTER = \$.*', ''),
-                        ('(am__EXEEXT(_[0-9])? = )gtester.*', r'\1'),
-                        ('(am__append(_[0-9])? = )gtester', r'\1')],
-                       '%(builddir)s/glib/Makefile', must_succeed=True)
-        Glib__darwin.compile (self)
-        
+    patches = Glib__darwin.patches + [
+        'glib-2.44.1-darwin-x86-lib-depend.patch',
+        'glib-2.44.1-darwin-x86-zlib.patch',
+    ]
+    def patch (self):
+        Glib__darwin.patch (self)
+        # darwin-x86 inline asm seems broken.
+        self.file_sub ([('#define USE_ASM_GOTO 1', '')],
+                       '%(srcdir)s/glib/gbitlock.c')
+
 class Glib__mingw (Glib):
+    patches = Glib.patches + [
+        'glib-2.44.1-mingw-w64-if_nametoindex.patch',
+    ]
     dependencies = Glib.dependencies + ['libiconv-devel']
-    def update_libtool (self): # linux-x86, linux-ppc, freebsd-x86
-        target.AutoBuild.update_libtool (self)
-        self.map_locate (w32.libtool_disable_relink, '%(builddir)s', 'libtool')
+    def configure (self):
+        Glib.configure (self)
+        self.file_sub ([('-Werror=format=2', ''),
+                        ('-Werror=format-extra-args', ''),],
+                       '%(builddir)s/glib/Makefile')
+        self.file_sub ([('-Werror=format=2', ''),
+                        ('-Werror=format-extra-args', ''),],
+                       '%(builddir)s/gobject/Makefile')
+        self.file_sub ([('-Werror=format=2', ''),
+                        ('-Werror=format-extra-args', ''),],
+                       '%(builddir)s/gio/Makefile')
 
 class Glib__freebsd (Glib):
     dependencies = Glib.dependencies + ['libiconv-devel']
-    configure_variables = Glib.configure_variables + ' CFLAGS=-pthread'
-
-class Glib__freebsd__x86 (Glib__freebsd):
-    # Must include -pthread in lib flags, because our most beloved
-    # libtool (2.2.6a) thinks it knows best and blondly strips -pthread
-    # if it thinks it's a compile flag.
-    # FIXME: should add fixup to update_libtool ()
-    make_flags = ' G_THREAD_LIBS=-pthread G_THREAD_LIBS_FOR_GTHREAD=-pthread '
+    # FreeBSD 6 can not compile glib 2.40.0+. It needs FreeBSD 8.1.
+    source = 'http://ftp.gnome.org/pub/GNOME/sources/glib/2.38/glib-2.38.2.tar.xz'
 
 class Glib__tools (tools.AutoBuild, Glib):
     dependencies = [
             'gettext',
             'libtool',
             'pkg-config',
+            'zlib',
+            'libffi',
+            'xzutils',
             ]            
-    configure_flags = (tools.AutoBuild.configure_flags
-                       + ' --build=%(build_architecture)s'
-                       + ' --host=%(build_architecture)s'
-                       + ' --target=%(build_architecture)s'
-                       )
     def install (self):
         tools.AutoBuild.install (self)
         self.system ('rm -f %(install_root)s%(packaging_suffix_dir)s%(prefix_dir)s/lib/charset.alias')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glib-2.44.1-darwin-in.patch	Sat Aug 29 13:44:49 2015 +0900
@@ -0,0 +1,66 @@
+--- glib-2.44.1/gio/gdummyfile.c.org	2014-12-20 06:49:48.000000000 +0900
++++ glib-2.44.1/gio/gdummyfile.c	2015-08-30 11:55:32.577794900 +0900
+@@ -441,7 +441,7 @@
+ 		 const gchar *escaped_string_end,
+ 		 const gchar *illegal_characters)
+ {
+-  const gchar *in;
++  const gchar *in_dummy;
+   gchar *out, *result;
+   gint character;
+   
+@@ -454,19 +454,19 @@
+   result = g_malloc (escaped_string_end - escaped_string + 1);
+ 	
+   out = result;
+-  for (in = escaped_string; in < escaped_string_end; in++) 
++  for (in_dummy = escaped_string; in_dummy < escaped_string_end; in_dummy++) 
+     {
+-      character = *in;
+-      if (*in == '%') 
++      character = *in_dummy;
++      if (*in_dummy == '%') 
+         {
+-          in++;
+-          if (escaped_string_end - in < 2)
++          in_dummy++;
++          if (escaped_string_end - in_dummy < 2)
+ 	    {
+ 	      g_free (result);
+ 	      return NULL;
+ 	    }
+       
+-          character = unescape_character (in);
++          character = unescape_character (in_dummy);
+       
+           /* Check for an illegal character. We consider '\0' illegal here. */
+           if (character <= 0 ||
+@@ -476,7 +476,7 @@
+ 	      g_free (result);
+ 	      return NULL;
+ 	    }
+-          in++; /* The other char will be eaten in the loop header */
++          in_dummy++; /* The other char will be eaten in the loop header */
+         }
+       *out++ = (char)character;
+     }
+@@ -516,7 +516,7 @@
+ _g_decode_uri (const char *uri)
+ {
+   GDecodedUri *decoded;
+-  const char *p, *in, *hier_part_start, *hier_part_end, *query_start, *fragment_start;
++  const char *p, *in_dummy, *hier_part_start, *hier_part_end, *query_start, *fragment_start;
+   char *out;
+   char c;
+ 
+@@ -551,8 +551,8 @@
+   
+   decoded->scheme = g_malloc (p - uri);
+   out = decoded->scheme;
+-  for (in = uri; in < p - 1; in++)
+-    *out++ = g_ascii_tolower (*in);
++  for (in_dummy = uri; in_dummy < p - 1; in_dummy++)
++    *out++ = g_ascii_tolower (*in_dummy);
+   *out = 0;
+ 
+   hier_part_start = p;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glib-2.44.1-darwin-x86-lib-depend.patch	Sat Aug 29 13:44:49 2015 +0900
@@ -0,0 +1,41 @@
+--- glib-2.44.1/gio/Makefile.in.org	2015-05-13 11:50:40.000000000 +0900
++++ glib-2.44.1/gio/Makefile.in	2015-08-30 12:01:11.975858800 +0900
+@@ -1731,6 +1731,7 @@
+ glib_compile_resources_LDADD = libgio-2.0.la 		\
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
+ 	$(top_builddir)/glib/libglib-2.0.la 		\
++	xdgmime/libxdgmime.la				\
+ 	$(NULL)
+ 
+ glib_compile_resources_SOURCES = \
+@@ -1757,6 +1758,7 @@
+ gsettings_LDADD = libgio-2.0.la 			\
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
+ 	$(top_builddir)/glib/libglib-2.0.la		\
++	xdgmime/libxdgmime.la				\
+ 	$(NULL)
+ 
+ gsettings_SOURCES = gsettings-tool.c
+@@ -1766,12 +1768,14 @@
+ gdbus_LDADD = libgio-2.0.la 				\
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
+ 	$(top_builddir)/glib/libglib-2.0.la		\
++	xdgmime/libxdgmime.la				\
+ 	$(NULL)
+ 
+ @OS_UNIX_TRUE@gapplication_SOURCES = gapplication-tool.c
+ @OS_UNIX_TRUE@gapplication_LDADD = libgio-2.0.la 			\
+ @OS_UNIX_TRUE@	$(top_builddir)/gobject/libgobject-2.0.la	\
+ @OS_UNIX_TRUE@	$(top_builddir)/glib/libglib-2.0.la		\
++@OS_UNIX_TRUE@	xdgmime/libxdgmime.la				\
+ @OS_UNIX_TRUE@	$(NULL)
+ 
+ completiondir = $(datadir)/bash-completion/completions
+@@ -1786,6 +1790,7 @@
+ gresource_LDADD = libgio-2.0.la				\
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
+ 	$(top_builddir)/glib/libglib-2.0.la		\
++	xdgmime/libxdgmime.la				\
+ 	$(LIBELF_LIBS)
+ 
+ all: $(BUILT_SOURCES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glib-2.44.1-darwin-x86-zlib.patch	Sat Aug 29 13:44:49 2015 +0900
@@ -0,0 +1,22 @@
+--- glib-2.44.1/gio/gzlibcompressor.c.org	2014-12-20 06:49:48.000000000 +0900
++++ glib-2.44.1/gio/gzlibcompressor.c	2015-08-30 12:07:36.581817200 +0900
+@@ -71,7 +71,7 @@
+ g_zlib_compressor_set_gzheader (GZlibCompressor *compressor)
+ {
+   /* On win32, these functions were not exported before 1.2.4 */
+-#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240
++#if 0
+   const gchar *filename;
+ 
+   if (compressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP ||
+--- glib-2.44.1/gio/gzlibdecompressor.c.org	2014-12-20 06:49:48.000000000 +0900
++++ glib-2.44.1/gio/gzlibdecompressor.c	2015-08-30 12:07:36.597442900 +0900
+@@ -74,7 +74,7 @@
+ g_zlib_decompressor_set_gzheader (GZlibDecompressor *decompressor)
+ {
+   /* On win32, these functions were not exported before 1.2.4 */
+-#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240
++#if 0
+   if (decompressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP)
+     return;
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glib-2.44.1-mingw-w64-if_nametoindex.patch	Sat Aug 29 13:44:49 2015 +0900
@@ -0,0 +1,44 @@
+--- glib-2.44.1/gio/gsocket.c.org	2015-03-23 03:19:51.000000000 +0900
++++ glib-2.44.1/gio/gsocket.c	2015-08-30 12:11:11.394997300 +0900
+@@ -1939,7 +1939,7 @@
+ 
+ #if !defined(HAVE_IF_NAMETOINDEX) && defined(G_OS_WIN32)
+ static guint
+-if_nametoindex (const gchar *iface)
++if_nametoindex_wrap (const gchar *iface)
+ {
+   PIP_ADAPTER_ADDRESSES addresses = NULL, p;
+   gulong addresses_len = 0;
+@@ -1992,6 +1992,8 @@
+ }
+ 
+ #define HAVE_IF_NAMETOINDEX 1
++#else
++#define if_nametoindex_wrap if_nametoindex
+ #endif
+ 
+ static gboolean
+@@ -2026,12 +2028,12 @@
+ 
+ #ifdef HAVE_IP_MREQN
+       if (iface)
+-        mc_req.imr_ifindex = if_nametoindex (iface);
++        mc_req.imr_ifindex = if_nametoindex_wrap (iface);
+       else
+         mc_req.imr_ifindex = 0;  /* Pick any.  */
+ #elif defined(G_OS_WIN32)
+       if (iface)
+-        mc_req.imr_interface.s_addr = g_htonl (if_nametoindex (iface));
++        mc_req.imr_interface.s_addr = g_htonl (if_nametoindex_wrap (iface));
+       else
+         mc_req.imr_interface.s_addr = g_htonl (INADDR_ANY);
+ #else
+@@ -2064,7 +2066,7 @@
+       memcpy (&mc_req_ipv6.ipv6mr_multiaddr, native_addr, sizeof (struct in6_addr));
+ #ifdef HAVE_IF_NAMETOINDEX
+       if (iface)
+-        mc_req_ipv6.ipv6mr_interface = if_nametoindex (iface);
++        mc_req_ipv6.ipv6mr_interface = if_nametoindex_wrap (iface);
+       else
+ #endif
+         mc_req_ipv6.ipv6mr_interface = 0;