Trying gtk-2.24

This commit is contained in:
Yevgen Muntyan 2011-04-05 00:26:55 -07:00
parent 2dd824d53b
commit 9128afb934
5 changed files with 394 additions and 19 deletions

View File

@ -74,17 +74,17 @@
</tarball>-->
<tarball id="glib">
<source href="http://ftp.gnome.org/pub/gnome/sources/glib/2.26/glib-2.26.1.tar.bz2"
md5sum="17535accceef55bcb17a74d73f9c2aef"/>
<source href="http://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.5.tar.bz2"
md5sum="ddf80a060ec9039ad40452ba3ca2311b"/>
<dependencies>
<dep package="libiconv"/>
<dep package="gettext"/>
<dep package="zlib"/>
</dependencies>
<patches>
<patch file="glib-2.26.patch" strip="1"/>
<patch file="glib-spawn-win32.patch" strip="1"/>
<patch file="glib-spawn-win32-moo.patch" strip="1"/>
<patch file="glib-2.28.patch" strip="1"/>
<patch file="glib-2.28-spawn-win32.patch" strip="1"/>
<patch file="glib-2.28-spawn-win32-moo.patch" strip="1"/>
</patches>
</tarball>
@ -229,17 +229,9 @@
</patches>
</tarball>-->
<!--
==================================================================================================
=
= Gtk-2.22
=
= it works pretty well, but GtkTextView drag'n'drop is completely broken
=
<tarball id="gdk-pixbuf">
<source href="http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.22/gdk-pixbuf-2.22.1.tar.bz2"
md5sum="716c4593ead3f9c8cca63b8b1907a561"/>
<source href="http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.23/gdk-pixbuf-2.23.3.tar.bz2"
md5sum="5d50c5311b4ce460d33983938d92109e"/>
<dependencies>
<dep package="cairo"/>
<dep package="pango"/>
@ -250,8 +242,8 @@
</tarball>
<tarball id="gtk+">
<source href="http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.22/gtk+-2.22.1.tar.bz2"
md5sum="fdce46ba354c155230b7d4090b17f7d9"/>
<source href="http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/gtk+-2.24.4.tar.bz2"
md5sum="e05a700ba79c8813d56e83e80636ee21"/>
<dependencies>
<dep package="cairo"/>
<dep package="pango"/>
@ -264,7 +256,6 @@
<patch file="gtk-2.22.patch" strip="1"/>
</patches>
</tarball>
-->
<tarball id="gtk-engines">
<source href="http://ftp.gnome.org/pub/gnome/sources/gtk-engines/2.20/gtk-engines-2.20.0.tar.bz2"

View File

@ -147,7 +147,7 @@ module_autogenargs['gdk-pixbuf'] = autogenargs \
+ " --without-libtiff" \
+ " --disable-cups" \
+ " --without-libjasper" \
+ " --disable-gdiplus" \
+ " --without-gdiplus" \
+ " --with-included-loaders=ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm,bmp,gif,ico" \
+ " --with-included-immodules" \
+ " --disable-introspection"

View File

@ -0,0 +1,12 @@
diff -r c42e8e0c6f6f glib/gspawn.h
--- a/glib/gspawn.h Mon Apr 04 19:06:05 2011 -0700
+++ b/glib/gspawn.h Mon Apr 04 19:06:35 2011 -0700
@@ -60,6 +60,8 @@
typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
+#define MOO_PATCHED_G_SPAWN_WIN32_HIDDEN_CONSOLE 1
+
typedef enum
{
G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0,

View File

@ -0,0 +1,312 @@
diff -r c42e8e0c6f6f glib/gspawn-win32-helper.c
--- a/glib/gspawn-win32-helper.c Mon Apr 04 19:06:05 2011 -0700
+++ b/glib/gspawn-win32-helper.c Mon Apr 04 19:07:28 2011 -0700
@@ -147,6 +147,16 @@
return argc;
}
+static int
+get_file_descriptor (const gchar *arg,
+ gboolean is_handle)
+{
+ if (is_handle)
+ return _open_osfhandle (atoi (arg), 0);
+ else
+ return atoi (arg);
+}
+
#ifndef HELPER_CONSOLE
int _stdcall
WinMain (struct HINSTANCE__ *hInstance,
@@ -170,6 +180,7 @@
wchar_t **new_wargv;
int argc;
wchar_t **wargv, **wenvp;
+ gboolean handles_in_argv;
_startupinfo si = { 0 };
char c;
@@ -184,10 +195,17 @@
*/
g_assert (argc == __argc);
- /* argv[ARG_CHILD_ERR_REPORT] is the file descriptor number onto
+ /* argv[ARG_HANDLES_IN_ARGV] is "y" or "n" telling whether
+ * file handle arguments contain HANDLE's or file descriptors.
+ */
+ handles_in_argv = __argv[ARG_HANDLES_IN_ARGV][0] == 'y';
+
+ /* argv[ARG_CHILD_ERR_REPORT] is the pipe handle onto
* which write error messages.
*/
- child_err_report_fd = atoi (__argv[ARG_CHILD_ERR_REPORT]);
+ child_err_report_fd = get_file_descriptor (__argv[ARG_CHILD_ERR_REPORT], handles_in_argv);
+ if (child_err_report_fd < 0)
+ g_error ("child_err_report_fd not set");
/* Hack to implement G_SPAWN_FILE_AND_ARGV_ZERO. If
* argv[ARG_CHILD_ERR_REPORT] is suffixed with a '#' it means we get
@@ -204,7 +222,7 @@
*/
helper_sync_fd = atoi (__argv[ARG_HELPER_SYNC]);
- /* argv[ARG_STDIN..ARG_STDERR] are the file descriptor numbers that
+ /* argv[ARG_STDIN..ARG_STDERR] are the pipe handles that
* should be dup2'd to 0, 1 and 2. '-' if the corresponding fd
* should be left alone, and 'z' if it should be connected to the
* bit bucket NUL:.
@@ -222,7 +240,9 @@
}
else
{
- fd = atoi (__argv[ARG_STDIN]);
+ fd = get_file_descriptor (__argv[ARG_STDIN], handles_in_argv);
+ if (fd < 0)
+ g_error ("could not open stdin pipe");
if (fd != 0)
{
dup2 (fd, 0);
@@ -243,7 +263,9 @@
}
else
{
- fd = atoi (__argv[ARG_STDOUT]);
+ fd = get_file_descriptor (__argv[ARG_STDOUT], handles_in_argv);
+ if (fd < 0)
+ g_error ("could not open stdout pipe");
if (fd != 1)
{
dup2 (fd, 1);
@@ -264,7 +286,9 @@
}
else
{
- fd = atoi (__argv[ARG_STDERR]);
+ fd = get_file_descriptor (__argv[ARG_STDERR], handles_in_argv);
+ if (fd < 0)
+ g_error ("could not open stderr pipe");
if (fd != 2)
{
dup2 (fd, 2);
diff -r c42e8e0c6f6f glib/gspawn-win32.c
--- a/glib/gspawn-win32.c Mon Apr 04 19:06:05 2011 -0700
+++ b/glib/gspawn-win32.c Mon Apr 04 19:07:28 2011 -0700
@@ -87,7 +87,8 @@
};
enum {
- ARG_CHILD_ERR_REPORT = 1,
+ ARG_HANDLES_IN_ARGV = 1,
+ ARG_CHILD_ERR_REPORT,
ARG_HELPER_SYNC,
ARG_STDIN,
ARG_STDOUT,
@@ -352,7 +353,11 @@
}
if (bytes < sizeof(gintptr)*2)
- return FALSE;
+ {
+ g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
+ _("Failed to read from child pipe"));
+ return FALSE;
+ }
return TRUE;
}
@@ -513,6 +518,77 @@
return TRUE;
}
+static int
+spawn_with_hidden_console (wchar_t **wargv,
+ wchar_t **wenvp,
+ GError **error)
+{
+ GArray *cmd_line;
+ STARTUPINFOW sinfo;
+ PROCESS_INFORMATION pinfo;
+ wchar_t **p;
+ wchar_t *env_string = NULL;
+ int rc = -1;
+ guint flags;
+
+ cmd_line = g_array_new (FALSE, FALSE, sizeof (wchar_t));
+ for (p = wargv; *p; p++)
+ {
+ if (p > wargv)
+ g_array_append_vals (cmd_line, L" ", 1);
+ g_array_append_vals (cmd_line, *p, wcslen (*p));
+ }
+ g_array_append_vals (cmd_line, L"", 1);
+
+ memset (&sinfo, 0, sizeof sinfo);
+ sinfo.cb = sizeof (STARTUPINFO);
+ sinfo.dwFlags = STARTF_USESHOWWINDOW;
+ sinfo.wShowWindow = SW_HIDE;
+ flags = CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP;
+
+ if (wenvp)
+ {
+ GArray *tmp;
+
+ flags |= CREATE_UNICODE_ENVIRONMENT;
+
+ /* format is "var=value\0var=value\0\0" */
+ tmp = g_array_new (FALSE, FALSE, sizeof (wchar_t));
+ for (p = wenvp; p && *p; p++)
+ g_array_append_vals (tmp, *p, wcslen (*p) + 1);
+ g_array_append_vals (tmp, L"", 1);
+ env_string = (wchar_t*) g_array_free (tmp, FALSE);
+ }
+
+ if (CreateProcessW (NULL, (wchar_t*) cmd_line->data, NULL, NULL, TRUE,
+ flags, env_string, NULL, &sinfo, &pinfo))
+ {
+ rc = (int) pinfo.hProcess;
+ CloseHandle (pinfo.hThread);
+ }
+ else
+ {
+ g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
+ _("Failed to execute helper program (%s)"),
+ g_win32_error_message (GetLastError ()));
+ }
+
+ g_free (env_string);
+ g_array_free (cmd_line, TRUE);
+ return rc;
+}
+
+static void
+sprintf_file_descriptor (gchar *dest,
+ gint fd,
+ gboolean print_handle)
+{
+ if (print_handle)
+ _g_sprintf (dest, "%ld", _get_osfhandle (fd));
+ else
+ _g_sprintf (dest, "%d", fd);
+}
+
static gboolean
do_spawn_with_pipes (gint *exit_status,
gboolean do_return_handle,
@@ -549,6 +625,8 @@
wchar_t *whelper, **wargv, **wenvp;
extern gchar *_glib_get_dll_directory (void);
gchar *glib_dll_directory;
+ gboolean error_set = FALSE;
+ gboolean handles_in_argv = FALSE;
if (child_setup && !warned_about_child_setup)
{
@@ -559,6 +637,7 @@
argc = protect_argv (argv, &protected_argv);
if (!standard_input && !standard_output && !standard_error &&
+ !(flags & G_SPAWN_WIN32_HIDDEN_CONSOLE) &&
(flags & G_SPAWN_CHILD_INHERITS_STDIN) &&
!(flags & G_SPAWN_STDOUT_TO_DEV_NULL) &&
!(flags & G_SPAWN_STDERR_TO_DEV_NULL) &&
@@ -590,7 +669,8 @@
goto cleanup_and_fail;
new_argv = g_new (char *, argc + 1 + ARG_COUNT);
- if (GetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cursor_info))
+ if ((flags & G_SPAWN_WIN32_HIDDEN_CONSOLE) ||
+ GetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cursor_info))
helper_process = HELPER_PROCESS "-console.exe";
else
helper_process = HELPER_PROCESS ".exe";
@@ -606,9 +686,16 @@
new_argv[0] = protect_argv_string (helper_process);
- _g_sprintf (args[ARG_CHILD_ERR_REPORT], "%d", child_err_report_pipe[1]);
+ if (flags & G_SPAWN_WIN32_HIDDEN_CONSOLE)
+ handles_in_argv = TRUE;
+
+ strcpy (args[ARG_HANDLES_IN_ARGV], handles_in_argv ? "y" : "n");
+ new_argv[ARG_HANDLES_IN_ARGV] = args[ARG_HANDLES_IN_ARGV];
+
+ sprintf_file_descriptor (args[ARG_CHILD_ERR_REPORT],
+ child_err_report_pipe[1], handles_in_argv);
new_argv[ARG_CHILD_ERR_REPORT] = args[ARG_CHILD_ERR_REPORT];
-
+
/* Make the read end of the child error report pipe
* noninherited. Otherwise it will needlessly be inherited by the
* helper process, and the started actual user process. As such that
@@ -637,7 +724,7 @@
if (standard_input)
{
- _g_sprintf (args[ARG_STDIN], "%d", stdin_pipe[0]);
+ sprintf_file_descriptor (args[ARG_STDIN], stdin_pipe[0], handles_in_argv);
new_argv[ARG_STDIN] = args[ARG_STDIN];
}
else if (flags & G_SPAWN_CHILD_INHERITS_STDIN)
@@ -653,7 +740,7 @@
if (standard_output)
{
- _g_sprintf (args[ARG_STDOUT], "%d", stdout_pipe[1]);
+ sprintf_file_descriptor (args[ARG_STDOUT], stdout_pipe[1], handles_in_argv);
new_argv[ARG_STDOUT] = args[ARG_STDOUT];
}
else if (flags & G_SPAWN_STDOUT_TO_DEV_NULL)
@@ -667,7 +754,7 @@
if (standard_error)
{
- _g_sprintf (args[ARG_STDERR], "%d", stderr_pipe[1]);
+ sprintf_file_descriptor (args[ARG_STDERR], stderr_pipe[1], handles_in_argv);
new_argv[ARG_STDERR] = args[ARG_STDERR];
}
else if (flags & G_SPAWN_STDERR_TO_DEV_NULL)
@@ -750,7 +837,13 @@
whelper = g_utf8_to_utf16 (helper_process, -1, NULL, NULL, NULL);
g_free (helper_process);
- if (wenvp != NULL)
+ if (flags & G_SPAWN_WIN32_HIDDEN_CONSOLE)
+ {
+ rc = spawn_with_hidden_console (wargv, wenvp, error);
+ if (rc == -1)
+ error_set = TRUE;
+ }
+ else if (wenvp != NULL)
rc = _wspawnvpe (P_NOWAIT, whelper, (const wchar_t **) wargv, (const wchar_t **) wenvp);
else
rc = _wspawnvp (P_NOWAIT, whelper, (const wchar_t **) wargv);
@@ -777,11 +870,12 @@
g_free (new_argv);
/* Check if gspawn-win32-helper couldn't be run */
- if (rc == -1 && saved_errno != 0)
+ if (rc == -1 && (saved_errno != 0 || error_set))
{
- g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
- _("Failed to execute helper program (%s)"),
- g_strerror (saved_errno));
+ if (!error_set)
+ g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
+ _("Failed to execute helper program (%s)"),
+ g_strerror (saved_errno));
goto cleanup_and_fail;
}
diff -r c42e8e0c6f6f glib/gspawn.h
--- a/glib/gspawn.h Mon Apr 04 19:06:05 2011 -0700
+++ b/glib/gspawn.h Mon Apr 04 19:07:28 2011 -0700
@@ -70,7 +70,8 @@
G_SPAWN_STDOUT_TO_DEV_NULL = 1 << 3,
G_SPAWN_STDERR_TO_DEV_NULL = 1 << 4,
G_SPAWN_CHILD_INHERITS_STDIN = 1 << 5,
- G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6
+ G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6,
+ G_SPAWN_WIN32_HIDDEN_CONSOLE = 1 << 7
} GSpawnFlags;
GQuark g_spawn_error_quark (void);

View File

@ -0,0 +1,60 @@
diff -r 00b9c5da9d6e Makefile.in
--- a/Makefile.in Mon Apr 04 19:01:52 2011 -0700
+++ b/Makefile.in Mon Apr 04 19:04:39 2011 -0700
@@ -422,7 +422,7 @@
gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in
TEST_PROGS =
ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs
+SUBDIRS = . glib gmodule gthread gobject gio po
DIST_SUBDIRS = $(SUBDIRS) build
bin_SCRIPTS = glib-gettextize
AM_CPPFLAGS = \
diff -r 00b9c5da9d6e gio/Makefile.in
--- a/gio/Makefile.in Mon Apr 04 19:01:52 2011 -0700
+++ b/gio/Makefile.in Mon Apr 04 19:04:39 2011 -0700
@@ -619,7 +619,7 @@
TEST_PROGS =
NULL =
SUBDIRS = $(am__append_1) $(am__append_3) $(am__append_7) \
- $(am__append_10) . $(am__append_13) tests
+ $(am__append_10) . $(am__append_13)
@MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@noinst_DATA = gio-2.0.lib
@MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
@MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib
diff -r 00b9c5da9d6e glib/Makefile.in
--- a/glib/Makefile.in Mon Apr 04 19:01:52 2011 -0700
+++ b/glib/Makefile.in Mon Apr 04 19:04:39 2011 -0700
@@ -546,7 +546,7 @@
@ENABLE_REGEX_TRUE@gregex_h = gregex.h
@HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_FALSE@gatomic_c = gatomic.c
@HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS_TRUE@gatomic_c = gatomic-gcc.c
-SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
+SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre .
DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
AM_CPPFLAGS = \
$(glib_INCLUDES) \
diff -r 00b9c5da9d6e gobject/Makefile.in
--- a/gobject/Makefile.in Mon Apr 04 19:01:52 2011 -0700
+++ b/gobject/Makefile.in Mon Apr 04 19:04:39 2011 -0700
@@ -440,7 +440,7 @@
# GObject - GLib Type, Object, Parameter and Signal Library
# Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
#
-SUBDIRS = . tests
+SUBDIRS = .
CLEANFILES = $(am__append_2) $(gen_sources)
@HAVE_THREADS_TRUE@THREAD_FLAGS = -DG_THREADS_MANDATORY
AM_CPPFLAGS = \
diff -r 00b9c5da9d6e gthread/Makefile.in
--- a/gthread/Makefile.in Mon Apr 04 19:01:52 2011 -0700
+++ b/gthread/Makefile.in Mon Apr 04 19:04:39 2011 -0700
@@ -397,7 +397,7 @@
EXTRA_DIST = makefile.msc.in gthread-posix.c gthread-win32.c \
gthread-none.c gthread.def gthread.rc.in
TEST_PROGS =
-SUBDIRS = . tests
+SUBDIRS = .
DIST_SUBDIRS = tests
AM_CPPFLAGS = \
$(glib_INCLUDES) \