[gnumeric] win32: inching towards glib.



commit 2a7395cfa2ef3c15ab3b578ee6651e7b8f8e3937
Author: Morten Welinder <terra gnome org>
Date:   Mon Jul 22 22:30:24 2013 -0400

    win32: inching towards glib.
    
    Still not quite there.

 tools/win32/jhbuildrc.py                           |    3 +-
 tools/win32/moduleset.in                           |    1 +
 tools/win32/patches/glib-appinfo.patch             |   76 ++++++--------------
 tools/win32/patches/glib-disable-python.patch      |   58 ---------------
 tools/win32/patches/glib-dns.patch                 |    4 +-
 tools/win32/patches/glib-gatomic.patch             |   10 +++
 .../glib-goption-disable-localization.patch        |   19 -----
 7 files changed, 37 insertions(+), 134 deletions(-)
---
diff --git a/tools/win32/jhbuildrc.py b/tools/win32/jhbuildrc.py
index d905900..5ac1880 100644
--- a/tools/win32/jhbuildrc.py
+++ b/tools/win32/jhbuildrc.py
@@ -85,7 +85,7 @@ os.environ['WINEDEBUG']        = '-all'
 #os.environ['MAKE']     = 'colormake'
 
 py_prefix = prefix+'/Python26'
-os.environ['PYTHON']    = py_prefix+'/python.exe'
+#os.environ['PYTHON']   = py_prefix+'/python.exe'
 os.environ['PY_PREFIX']  = py_prefix
 os.environ['PY_INCLUDE_DIR'] = py_prefix+'/include'
 os.environ['PY_LIB_DIR']     = py_prefix+'/libs'
@@ -118,6 +118,7 @@ module_autogenargs['gettext'] = autogenargs + """ --without-emacs \
 #module_autogenargs['jpeg']   = ' --enable-shared' + ' --disable-static' + ' --prefix='+prefix 
 
 module_autogenargs['glib']     =    autogenargs + """ --enable-explicit-deps=no \
+                                                 --enable-compile-warnings=no \
                                                   --cache-file=win32.cache \
                                                   --disable-gtk-doc"""
 module_autogenargs['freetype']  = autogenargs
diff --git a/tools/win32/moduleset.in b/tools/win32/moduleset.in
index ee46464..48234cd 100644
--- a/tools/win32/moduleset.in
+++ b/tools/win32/moduleset.in
@@ -75,6 +75,7 @@
            <patch file="&patch_dir;glib-goption-disable-localization.patch" strip="1"/>
            <patch file="&patch_dir;glib-gspawn-win32.patch" strip="1"/>
            <patch file="&patch_dir;glib-appinfo.patch" strip="1"/>
+           <patch file="&patch_dir;glib-gatomic.patch" strip="1"/>
            <patch file="&patch_dir;glib-dns.patch" strip="1"/>
        </branch>
        <dependencies>
diff --git a/tools/win32/patches/glib-appinfo.patch b/tools/win32/patches/glib-appinfo.patch
index 5eabca6..f37ddf1 100644
--- a/tools/win32/patches/glib-appinfo.patch
+++ b/tools/win32/patches/glib-appinfo.patch
@@ -1,7 +1,6 @@
-diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
---- glib-2.24.0/gio/gwin32appinfo.c    2009-03-31 19:04:20.000000000 -0400
-+++ glib-2.24.0-fixed/gio/gwin32appinfo.c      2010-07-08 19:52:11.000000000 -0400
-@@ -62,6 +62,7 @@
+--- glib-2.37.4/gio/gwin32appinfo.c.orig       2013-06-02 19:20:49.000000000 -0400
++++ glib-2.37.4/gio/gwin32appinfo.c    2013-07-22 21:20:31.000000000 -0400
+@@ -61,6 +61,7 @@
    char *executable;
    char *name;
    gboolean no_open_with;
@@ -9,7 +8,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  };
  
  G_DEFINE_TYPE_WITH_CODE (GWin32AppInfo, g_win32_app_info, G_TYPE_OBJECT,
-@@ -99,7 +100,8 @@
+@@ -98,7 +99,8 @@
  
  static GAppInfo *
  g_desktop_app_info_new_from_id (wchar_t *id /* takes ownership */,
@@ -19,7 +18,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  {
  #ifdef AssocQueryString
    ASSOCF flags;
-@@ -113,6 +115,7 @@
+@@ -112,6 +114,7 @@
    info->id = id; /* Takes ownership */
    info->id_utf8 = g_utf16_to_utf8 (id, -1, NULL, NULL, NULL);  
    info->id_is_exename = id_is_exename;
@@ -27,7 +26,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  
  #ifdef AssocQueryString  
    flags = 0;
-@@ -187,6 +190,7 @@
+@@ -186,6 +189,7 @@
    new_info->name = g_strdup (info->name);
    new_info->executable = g_strdup (info->executable);
    new_info->no_open_with = info->no_open_with;
@@ -35,7 +34,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
    
    return G_APP_INFO (new_info);
  }
-@@ -200,8 +204,14 @@
+@@ -199,8 +203,14 @@
  
    if (info1->executable == NULL ||
        info2->executable == NULL)
@@ -51,7 +50,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
    return strcmp (info1->executable, info2->executable) == 0;
  }
  
-@@ -249,50 +259,50 @@
+@@ -248,35 +258,36 @@
  }
  
  static gboolean
@@ -75,11 +74,12 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
    GList *l;
  
    /* TODO:  What might startup_id mean on win32? */
--#ifdef AssocQueryString  
++  if (!use_uris) {
+ #ifdef AssocQueryString  
 -  flags = 0;
 -  if (info->id_is_exename)
 -    flags |= ASSOCF_INIT_BYEXENAME;
- 
+-
 -  if (AssocQueryKeyW (flags,
 -                    ASSOCKEY_SHELLEXECCLASS,
 -                    info->id,
@@ -89,8 +89,6 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
 -      g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Can't find application"));
 -      return FALSE;
 -    }
-+  if (!use_uris) {
-+#ifdef AssocQueryString  
 +    ASSOCF flags = 0;
 +    if (info->id_is_exename)
 +      flags |= ASSOCF_INIT_BYEXENAME;
@@ -107,6 +105,10 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  #endif
 +  }
  
+   /* FIXME: Need to do something with
+    * g_app_launch_context_get_environment()... ShellExecuteExW()
+@@ -289,14 +300,13 @@
+ 
    for (l = files; l != NULL; l = l->next)
      {
 -      char *path = g_file_get_path (l->data);
@@ -123,12 +125,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
        exec_info.lpFile = wfilename;     
        exec_info.nShow = SW_SHOWNORMAL;
        exec_info.hkeyClass = class_key;
--      
-+
-       if (!ShellExecuteExW (&exec_info))
-       {
-         char *message_utf8 = g_win32_error_message (GetLastError ());
-@@ -301,22 +311,50 @@
+@@ -309,22 +319,50 @@
          g_free (message_utf8);
          
          g_free (wfilename);
@@ -182,7 +179,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  }
  
  static gboolean
-@@ -331,9 +369,12 @@
+@@ -339,9 +377,12 @@
                              GAppLaunchContext  *launch_context,
                              GError            **error)
  {
@@ -197,7 +194,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
    return FALSE;
  }
  
-@@ -563,7 +604,7 @@
+@@ -571,7 +612,7 @@
        GAppInfo *info;
  
        /* l->data ownership is taken */
@@ -206,7 +203,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
        if (app_info_in_list (info, infos))
        g_object_unref (info);
        else
-@@ -576,7 +617,7 @@
+@@ -584,7 +625,7 @@
        GAppInfo *info;
  
        /* l->data ownership is taken */
@@ -215,7 +212,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
        if (app_info_in_list (info, infos))
        g_object_unref (info);
        else
-@@ -606,9 +647,10 @@
+@@ -636,9 +677,10 @@
                         wtype,
                         NULL,
                         buffer,
@@ -228,7 +225,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
  #endif
  
    g_free (wtype);
-@@ -618,6 +660,14 @@
+@@ -648,6 +690,14 @@
  GAppInfo *
  g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
  {
@@ -243,7 +240,7 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
    /* TODO: Implement */
    return NULL;
  }
-@@ -650,7 +700,7 @@
+@@ -680,7 +730,7 @@
      {
        wchar_t *name_dup = g_memdup (name, (name_len+1)*2);
        /* name_dup ownership is taken */
@@ -252,32 +249,3 @@ diff -ur glib-2.24.0/gio/gwin32appinfo.c glib-2.24.0-fixed/gio/gwin32appinfo.c
        infos = g_list_prepend (infos, info);
        
        index++;
---- glib-2.24.0/gio/win32/gwinhttpvfs.c        2010-03-17 16:55:34.000000000 -0400
-+++ glib-2.24.0-fixed/gio/win32/gwinhttpvfs.c  2010-07-11 20:32:36.000000000 -0400
-@@ -28,6 +28,7 @@
- 
- #include "gio/gioerror.h"
- #include "gio/giomodule.h"
-+#include "gio/gdummyfile.h"
- #include "gio/gvfs.h"
- 
- #include "gwinhttpfile.h"
-@@ -163,6 +164,18 @@
-         uri[strlen (winhttp_uri_schemes[i])] == ':')
-       return _g_winhttp_file_new (winhttp_vfs, uri);
- 
-+  /* The only other kind of URI we handle is file:// and we do that
-+     by shipping it off to the wrapped vfs.  Anything else that looks
-+     like plonk:... is turned into a dummy file.  That leaves anything
-+     that looks, more or less, like a filename.  We ship that off to the
-+     wrapped vfs because we used to.  */
-+  for (i = 0; g_ascii_isalpha (uri[i]); i++)
-+        ; /* Nothing */
-+  if (i > 0 && uri[i] == ':' &&
-+      !(i == 4 && uri[i + 1] == '/' && uri[i + 2] == '/' &&
-+      g_ascii_strncasecmp (uri, "file", 4) == 0))
-+    return _g_dummy_file_new (uri);
-+
-   /* For other URIs fallback to the wrapped GVfs */
-   return g_vfs_parse_name (winhttp_vfs->wrapped_vfs, uri);
- }
diff --git a/tools/win32/patches/glib-dns.patch b/tools/win32/patches/glib-dns.patch
index f5df4fc..42e58ae 100644
--- a/tools/win32/patches/glib-dns.patch
+++ b/tools/win32/patches/glib-dns.patch
@@ -1,5 +1,5 @@
---- glib-2.24.0/gio/gnetworkingprivate.h~      2010-03-13 14:22:54.000000000 -0500
-+++ glib-2.24.0/gio/gnetworkingprivate.h       2010-10-05 18:53:45.000000000 -0400
+--- glib-2.24.0/gio/gnetworking.h~     2010-03-13 14:22:54.000000000 -0500
++++ glib-2.24.0/gio/gnetworking.h      2010-10-05 18:53:45.000000000 -0400
 @@ -28,6 +28,7 @@
  #undef interface
  #include <ws2tcpip.h>
diff --git a/tools/win32/patches/glib-gatomic.patch b/tools/win32/patches/glib-gatomic.patch
new file mode 100644
index 0000000..54c30aa
--- /dev/null
+++ b/tools/win32/patches/glib-gatomic.patch
@@ -0,0 +1,10 @@
+--- glib-2.37.4/glib/gatomic.c~        2013-06-10 22:14:02.000000000 -0400
++++ glib-2.37.4/glib/gatomic.c 2013-07-22 22:09:35.000000000 -0400
+@@ -467,6 +467,7 @@
+ #elif defined (G_PLATFORM_WIN32)
+ 
+ #include <windows.h>
++#define MemoryBarrier() asm("mfence;")
+ #if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200)
+ #define InterlockedAnd _InterlockedAnd
+ #define InterlockedOr _InterlockedOr
diff --git a/tools/win32/patches/glib-goption-disable-localization.patch 
b/tools/win32/patches/glib-goption-disable-localization.patch
index 1a38f81..5c86cb8 100644
--- a/tools/win32/patches/glib-goption-disable-localization.patch
+++ b/tools/win32/patches/glib-goption-disable-localization.patch
@@ -1,22 +1,3 @@
-diff -ur glib-2.26.0/glib/glib.symbols glib-2.26.0-new//glib/glib.symbols
---- glib-2.26.0/glib/glib.symbols      2010-09-27 09:17:56.000000000 -0400
-+++ glib-2.26.0-new//glib/glib.symbols 2010-10-05 18:59:03.000000000 -0400
-@@ -901,6 +901,7 @@
- g_option_context_add_main_entries
- g_option_error_quark
- g_option_context_free
-+g_option_context_get_delocalize
- g_option_context_get_description
- g_option_context_get_help_enabled
- g_option_context_get_ignore_unknown_options
-@@ -908,6 +909,7 @@
- g_option_context_get_summary
- g_option_context_new
- g_option_context_parse
-+g_option_context_set_delocalize
- g_option_context_set_description
- g_option_context_set_help_enabled
- g_option_context_set_ignore_unknown_options
 diff -ur glib-2.26.0/glib/goption.c glib-2.26.0-new//glib/goption.c
 --- glib-2.26.0/glib/goption.c 2010-09-17 13:14:23.000000000 -0400
 +++ glib-2.26.0-new//glib/goption.c    2010-10-05 19:04:41.000000000 -0400


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]