[gnumeric] [win32] turnkey build (other than pygobject)



commit 7ab036f4ba2bf73f322f1734f60e523ffa3ff375
Author: Jody Goldberg <jody gnome org>
Date:   Sun Oct 11 15:04:24 2009 -0400

    [win32] turnkey build (other than pygobject)
    
        - python 2.6
        - disable python in glib and gtk-doc
        - fixes pending for 2.18.3
        - automated build script
        - remove some hard coded paths

 ChangeLog                                          |    6 +
 NEWS                                               |    3 +
 configure.in                                       |    3 +-
 doc/C/.gitignore                                   |    4 +-
 src/main-application.c                             |    2 +-
 tools/win32/.gitignore                             |    5 +
 tools/win32/Makefile.am                            |   29 +-
 tools/win32/build                                  |   62 ++++
 tools/win32/gdk-pixbuf.loaders                     |  122 -------
 tools/win32/gnumeric.nsi.in                        |    2 +-
 tools/win32/gpl.txt                                |  340 --------------------
 tools/win32/gtk.immodules                          |   38 ---
 tools/win32/{jhbuildrc-debug => jhbuildrc}         |   28 +-
 tools/win32/jhbuildrc-release                      |   17 +-
 tools/win32/{moduleset => moduleset.in}            |   17 +-
 tools/win32/patches/glib-disable-python.patch      |   13 +
 tools/win32/patches/gtk-doc-disable-python.patch   |   11 +
 tools/win32/patches/gtk-pending-2.18.3.patch       |  170 ++++++++++
 .../patches/gtk-use-wine-to-cross-compile.patch    |   85 +++++
 tools/win32/patches/psiconv.patch                  |   22 ++
 tools/win32/patches/pxlib-intl.patch               |   32 +--
 21 files changed, 449 insertions(+), 562 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 45c0bb8..6eace4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,12 @@
 	* src/mathfunc.h (random_skew_normal): new
 	(random_skew_tdist): new
 
+2009-10-10  Jody Goldberg <jody gnome org>
+
+	* src/main-application.c (gnumeric_arg_parse) : honour
+	  HAVE_G_OPTION_CONTEXT_SET_DELOCALIZE for people trying to build on
+	  win32 with stock gtk+.
+
 2009-10-11  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index 89e6455..8a85118 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ Gnumeric 1.9.15
 Andreas:
 	* Add RANDSNORM and RANDSTDIST. [#144717]
 
+Jody:
+	* First steps towards a turnkey win32 build.
+
 --------------------------------------------------------------------------
 Gnumeric 1.9.14
 
diff --git a/configure.in b/configure.in
index f0085ce..c6c1b6e 100644
--- a/configure.in
+++ b/configure.in
@@ -1090,8 +1090,9 @@ templates/english/Makefile
 templates/autoformat/Makefile
 test/Makefile
 tools/Makefile
-tools/win32/gnumeric.nsi
 tools/win32/Makefile
+tools/win32/moduleset
+tools/win32/gnumeric.nsi
 component/Makefile
 ])
 
diff --git a/doc/C/.gitignore b/doc/C/.gitignore
index 0d4fdb8..3e4d800 100644
--- a/doc/C/.gitignore
+++ b/doc/C/.gitignore
@@ -18,4 +18,6 @@ gnumeric.lot
 gnumeric.out
 gnumeric.pdf
 gnumeric.tex
-gnumeric.toc
\ No newline at end of file
+gnumeric.toc
+output
+chm
diff --git a/src/main-application.c b/src/main-application.c
index 1c3bb28..a275a43 100644
--- a/src/main-application.c
+++ b/src/main-application.c
@@ -181,7 +181,7 @@ gnumeric_arg_parse (int argc, char **argv)
 	g_option_context_add_main_entries (ocontext, gnumeric_options, GETTEXT_PACKAGE);
 	g_option_context_add_group	  (ocontext, gnm_get_option_group ());
 
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) && defined(HAVE_G_OPTION_CONTEXT_SET_DELOCALIZE)
 	/* we have already translated to utf8, do not do it again.
 	 * http://bugzilla.gnome.org/show_bug.cgi?id=361321 */
 	g_option_context_set_delocalize   (ocontext, FALSE);
diff --git a/tools/win32/.gitignore b/tools/win32/.gitignore
index 52b08ac..14c50b0 100644
--- a/tools/win32/.gitignore
+++ b/tools/win32/.gitignore
@@ -1 +1,6 @@
 gnumeric.nsi
+moduleset
+debug
+release
+archive
+wine
diff --git a/tools/win32/Makefile.am b/tools/win32/Makefile.am
index f436ad8..afbcd42 100755
--- a/tools/win32/Makefile.am
+++ b/tools/win32/Makefile.am
@@ -1,16 +1,19 @@
-EXTRA_DIST = gnumeric.nsi.in
+all:
 
-sandbox		= ${HOME}/win32/debug
+debug::
+	$(abs_srcdir)/build $(abs_builddir) $(abs_srcdir) debug
 
-export WINEPREFIX	= ${sandbox}/wine
-export WINEDIR		= ${WINEPREFIX}/drive_c
-export py_pkg		= "http://www.python.org/ftp/python/2.6.3/python-2.6.3.msi";
+release::
+	$(abs_srcdir)/build $(abs_builddir) $(abs_srcdir) release
 
-setup :
-	cd ${sandbox} \
-	wine msiexec ~/Desktop/python-2.6.3.msi	\
-	if [ ! -L Python26 ]; then		ln -s ${WINEDIR}/Python26 ; fi	\
-	if [ ! -d bin ]; then			mkdir bin; fi	\
-	if [ ! -d bin/libpython26.dll ]; then (	cd bin ; ln -s ${WINEDIR}/windows/system32/python26.dll libpython26.dll ) ; fi	\
-	if [ ! -d lib ]; then			mkdir lib; fi	\
-	if [ ! -d lib/libpython26.a ]; then (	cd lib ; ln -s ${WINEDIR}/Python26/libs/python26.lib libpython26.dll.a ) ; fi
+debug_shell::
+	$(abs_srcdir)/build $(abs_builddir) $(abs_srcdir) debug_shell
+
+release_shell::
+	$(abs_srcdir)/build $(abs_builddir) $(abs_srcdir) debug_shell
+
+clean:
+	rm -rf debug release
+
+EXTRA_DIST = gnumeric.nsi.in build gtkrc moduleset.in jhbuildrc-debug jhbuildrc-release
+.PHONY : debug release debug_shell release_shell
diff --git a/tools/win32/build b/tools/win32/build
new file mode 100755
index 0000000..b9d5a0d
--- /dev/null
+++ b/tools/win32/build
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# configurable settings
+py_ver=26
+py_pkg_ver=2.6.3
+
+###################################################
+builddir="$1"
+srcdir="$2"
+target="$3"
+
+export WINEPREFIX="${builddir}/wine"
+WINEDIR="${WINEPREFIX}/drive_c"
+archive_dir="${builddir}/archive"
+export JH_PREFIX="${builddir}/${target}"
+export JH_MODULE_SET="${srcdir}/moduleset"
+
+build_mkdir() {
+     if [ ! -d "$1" ]; then
+	    echo mkdir -p "$1"
+	    mkdir -p "$1"
+	fi
+}
+build_ls_s() {
+    if [ ! -L "$2" ]; then
+       echo ln -s "$1" "$2"
+       ln -s "$1" "$2"
+    fi
+}
+
+# Setup up the JH_PREFIX/deploy
+    build_mkdir "${JH_PREFIX}/deploy" ; cd "${JH_PREFIX}/deploy"
+    build_mkdir "bin"
+    build_mkdir "lib"
+    build_mkdir "etc/gtk-2.0"
+    install -C "${srcdir}/gtkrc" "etc/gtk-2.0"
+
+# Setup Python
+    py_pkg="${archive_dir}/python-${py_pkg_ver}.msi"
+    build_mkdir "${archive_dir}"
+
+    if [ ! -f "$py_pkg" ]; then
+	echo wget "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi";
+	( cd archive ; wget "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi"; )
+    fi
+    if [ ! -d "${WINEDIR}/Python${py_ver}" ]; then
+	echo wine msiexec /i ${py_pkg}
+	wine msiexec /i ${py_pkg}
+    fi
+    build_ls_s "${WINEDIR}/Python${py_ver}"			 	"Python${py_ver}" 
+    build_ls_s "${WINEDIR}/windows/system32/python${py_ver}.dll" 	"bin/libpython${py_ver}.dll"
+    build_ls_s "${WINEDIR}/Python${py_ver}/libs/python${py_ver}.lib"	"lib/libpython${py_ver}.dll.a"
+
+# prep jhbuild files
+    ${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc"
+
+################################################################
+# TODO
+#    - pangorc
+#    - better sharing between -debug and -release
+#    - doc generation and deployment
+#    - packaging
diff --git a/tools/win32/gnumeric.nsi.in b/tools/win32/gnumeric.nsi.in
index 792d0ee..8eed3b7 100644
--- a/tools/win32/gnumeric.nsi.in
+++ b/tools/win32/gnumeric.nsi.in
@@ -37,7 +37,7 @@ SetCompressor /SOLID lzma
 !define MUI_WELCOMEPAGE_TITLE_3LINES
 !define MUI_WELCOMEPAGE_TEXT "You can always get the newest version from:\r\n\r\nhttp://www.gnumeric.org/\r\n\r\nThis wizard will guide you through the installation of $(^NameDA).\r\n\r\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.\r\n\r\n$_CLICK"
 !insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_LICENSE "gpl.txt"
+!insertmacro MUI_PAGE_LICENSE "COPYING"
 
 Page custom CustomPageShortcut
 !insertmacro MUI_PAGE_COMPONENTS
diff --git a/tools/win32/jhbuildrc-debug b/tools/win32/jhbuildrc
similarity index 90%
rename from tools/win32/jhbuildrc-debug
rename to tools/win32/jhbuildrc
index dc106d5..f2ae893 100644
--- a/tools/win32/jhbuildrc-debug
+++ b/tools/win32/jhbuildrc
@@ -1,19 +1,20 @@
 # -*- mode: python -*-
 # This code is licensed under the GPLv2 License
 # Derived work from the original freedesktop.org example.jhbuildrc
+# Derived work from Alberto Ruiz <aruiz gnome org>
 #
-# This jhbuildrc file is created for the purpose of cross compile Gtk+
+# This jhbuildrc file is created for the purpose of cross compile Gnumeric
 # with Mingw32 under Linux.
 #
-# Author: Alberto Ruiz <aruiz gnome org>
+# Author: Jody Goldberg <jody gnome org>
 
-moduleset = '/gnome/src/gnumeric/tools/win32/moduleset'
+moduleset = os.getenv('JH_MODULE_SET')
 modules = ['gnumeric', 'evince']
 
 # checkoutroot: path to download packages elsewhere
 # prefix:       target path to install the compiled binaries
-checkoutroot = os.path.expanduser('~/win32/debug/src')
-prefix	     = os.path.expanduser("~/win32/debug/build")
+checkoutroot = os.path.join(os.sep, os.getenv('JH_PREFIX'), "src")
+prefix	     = os.path.join(os.sep, os.getenv('JH_PREFIX'), "deploy")
 os.environ['prefix']	= prefix	# for use in zlib kludge
 
 #The host value is obtained with the result of executing
@@ -23,8 +24,8 @@ os.environ['HOST']	= 'i686-pc-linux-gnuaout'
 os.environ['TARGET']	= 'i586-pc-mingw32msvc'
 os.environ['PKG_CONFIG']= '/usr/bin/pkg-config'
 
-addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'lib', 'pkgconfig'))
-addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'share', 'pkgconfig'))
+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, prefix, 'lib', 'pkgconfig'))
+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, prefix, 'share', 'pkgconfig'))
 
 #Prefix for all the tools
 mingw_tool_prefix = '/usr/bin/i586-mingw32msvc-'
@@ -57,7 +58,7 @@ os.environ['ACLOCAL_AMFLAGS'] = ' -I '+prefix+'/share/aclocal'	# for libgnomedb
 os.environ['WINEDEBUG']	 = '-all'
 #os.environ['MAKE']	 = 'colormake'
 
-py_prefix = prefix+'/Python25'
+py_prefix = prefix+'/Python26'
 os.environ['PYTHON']	 = py_prefix+'/python.exe'
 os.environ['PY_PREFIX']  = py_prefix
 os.environ['PY_INCLUDE_DIR'] = py_prefix+'/include'
@@ -100,6 +101,7 @@ module_autogenargs['pango']	= autogenargs + """ --disable-gtk-doc \
                                                   --with-included-modules"""
 #						  --disable-ft
 module_autogenargs['pixman']	= autogenargs + """ --enable-explicit-deps=no \
+                                                  --enable-gtk=no \
                                                   --enable-xlib=no \
                                                   --enable-xlib-xrender=no \
                                                   --enable-win32-font=yes"""
@@ -111,20 +113,20 @@ module_autogenargs['cairo']	= autogenargs + """ --enable-explicit-deps=no \
 						  --disable-static \
 						  --enable-shared"""
 #						  --enable-ft=no
+module_autogenargs['psiconv']	= autogenargs + """ --disable-xhtml-docs \
+						    --disable-html4-docs \
+						    --disable-ascii-docs \
+						    --without-imagemagick"""
 
 module_autogenargs['libxml2']	= autogenargs + """ --disable-scrollkeeper --without-iconv"""
 
 autogenargs += """ --disable-scrollkeeper --disable-gtk-doc"""
 
 module_autogenargs['atk']	= autogenargs + """ --disable-glibtest"""
-module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --without-libjasper  --without-libtiff --without-libjpeg"""
+module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --enable-gdiplus --without-libjasper  --without-libtiff --without-libjpeg"""
 
 module_autogenargs['libgda']	= autogenargs + """ --without-odbc --without-lda --without-java"""
 module_autogenargs['pxlib']	= autogenargs + """ --with-gsf=""" + prefix
-module_autogenargs['psiconv']	= autogenargs + """ --disable-xhtml-docs \
-						    --disable-html4-docs \
-						    --disable-ascii-docs \
-						    --without-imagemagick"""
 module_autogenargs['libglade']	= autogenargs
 module_autogenargs['pygobject']	= autogenargs
 module_autogenargs['libgsf']	= autogenargs + """ --without-gnome-vfs --without-bonobo"""
diff --git a/tools/win32/jhbuildrc-release b/tools/win32/jhbuildrc-release
index 95a6938..362eea9 100644
--- a/tools/win32/jhbuildrc-release
+++ b/tools/win32/jhbuildrc-release
@@ -23,8 +23,8 @@ os.environ['HOST']	= 'i686-pc-linux-gnuaout'
 os.environ['TARGET']	= 'i586-pc-mingw32msvc'
 os.environ['PKG_CONFIG']= '/usr/bin/pkg-config'
 
-addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'lib', 'pkgconfig'))
-addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'share', 'pkgconfig'))
+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, prefix, 'lib', 'pkgconfig'))
+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, prefix, 'share', 'pkgconfig'))
 
 #Prefix for all the tools
 mingw_tool_prefix = '/usr/bin/i586-mingw32msvc-'
@@ -57,7 +57,7 @@ os.environ['ACLOCAL_AMFLAGS'] = ' -I '+prefix+'/share/aclocal'	# for libgnomedb
 os.environ['WINEDEBUG']	 = '-all'
 #os.environ['MAKE']	 = 'colormake'
 
-py_prefix = prefix+'/Python25'
+py_prefix = prefix+'/Python26'
 os.environ['PYTHON']	 = py_prefix+'/python.exe'
 os.environ['PY_PREFIX']  = py_prefix
 os.environ['PY_INCLUDE_DIR'] = py_prefix+'/include'
@@ -100,6 +100,7 @@ module_autogenargs['pango']	= autogenargs + """ --disable-gtk-doc \
                                                   --with-included-modules"""
 #						  --disable-ft
 module_autogenargs['pixman']	= autogenargs + """ --enable-explicit-deps=no \
+                                                  --enable-gtk=no \
                                                   --enable-xlib=no \
                                                   --enable-xlib-xrender=no \
                                                   --enable-win32-font=yes"""
@@ -111,20 +112,20 @@ module_autogenargs['cairo']	= autogenargs + """ --enable-explicit-deps=no \
 						  --disable-static \
 						  --enable-shared"""
 #						  --enable-ft=no
+module_autogenargs['psiconv']	= autogenargs + """ --disable-xhtml-docs \
+						    --disable-html4-docs \
+						    --disable-ascii-docs \
+						    --without-imagemagick"""
 
 module_autogenargs['libxml2']	= autogenargs + """ --disable-scrollkeeper --without-iconv"""
 
 autogenargs += """ --disable-scrollkeeper --disable-gtk-doc"""
 
 module_autogenargs['atk']	= autogenargs + """ --disable-glibtest"""
-module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --without-libjasper  --without-libtiff --without-libjpeg"""
+module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --enable-gdiplus --without-libjasper  --without-libtiff --without-libjpeg"""
 
 module_autogenargs['libgda']	= autogenargs + """ --without-odbc --without-lda --without-java"""
 module_autogenargs['pxlib']	= autogenargs + """ --with-gsf=""" + prefix
-module_autogenargs['psiconv']	= autogenargs + """ --disable-xhtml-docs \
-						    --disable-html4-docs \
-						    --disable-ascii-docs \
-						    --without-imagemagick"""
 module_autogenargs['libglade']	= autogenargs
 module_autogenargs['pygobject']	= autogenargs
 module_autogenargs['libgsf']	= autogenargs + """ --without-gnome-vfs --without-bonobo"""
diff --git a/tools/win32/moduleset b/tools/win32/moduleset.in
similarity index 93%
rename from tools/win32/moduleset
rename to tools/win32/moduleset.in
index 494eb52..7aa5e73 100644
--- a/tools/win32/moduleset
+++ b/tools/win32/moduleset.in
@@ -1,7 +1,6 @@
 <?xml version="1.0" ?>
 <!DOCTYPE doc [
-      <!ENTITY patch_dir "/gnome/src/gnumeric/tools/win32/patches/">
-      <!-- <!ENTITY patch_dir "http://svn.gnome.org/svn/gnumeric/trunk/tools/win32/patches/";> -->
+      <!ENTITY patch_dir "@abs_srcdir@/patches/">
 ]>
 <moduleset>
     <repository type="git" name="git.gnome.org" default="yes"
@@ -35,14 +34,18 @@
     <tarball id="pcre" version="7.9">
 	<source href="http://downloads.sourceforge.net/pcre/pcre-7.9.tar.bz2"/>
     </tarball>
-    <autotools id="gtk-doc">
-	<branch module="gtk-doc" checkoutdir="gtk-doc"/>
+    <autotools id="gtk-doc"
+	autogen-sh="autoreconf"  skip-autogen="never">
+	<branch repo="gnome.org" module="sources/gtk-doc/1.11/gtk-doc-1.11.tar.bz2" version="1.11">
+	    <patch file="&patch_dir;gtk-doc-disable-python.patch"/>
+	</branch>
     </autotools>
 
     <autotools id="glib">
 	<branch repo="gnome.org" module="sources/glib/2.22/glib-2.22.2.tar.bz2" version="2.22.2">
 	    <patch file="&patch_dir;glib-win32-cachefile.patch.gz"/>
 	    <patch file="&patch_dir;glib-goption-disable-localization.patch"/>
+	    <patch file="&patch_dir;glib-disable-python.patch" strip="1"/>
 	</branch>
 	<dependencies>
 	    <dep package="gettext"/>
@@ -156,6 +159,7 @@
 	</branch>
 	<dependencies>
 	    <dep package="freetype"/>
+	    <dep package="libxml2"/>
 	</dependencies>
     </autotools>
 
@@ -192,6 +196,8 @@
 	<branch repo="gnome.org" module="sources/gtk+/2.18/gtk+-2.18.2.tar.bz2"
 		version="2.18.2">
 	    <patch file="&patch_dir;gtk-disable-demo.patch"/>
+	    <patch file="&patch_dir;gtk-pending-2.18.3.patch" strip="1"/>
+	    <patch file="&patch_dir;gtk-use-wine-to-cross-compile.patch" strip="1"/>
 	</branch>
 	<dependencies>
 	    <dep package="glib"/>
@@ -254,7 +260,7 @@
 	<source href="http://superb-east.dl.sourceforge.net/sourceforge/pxlib/pxlib-0.6.3.tar.gz";
 		md5sum="0742020854496fa757d7acbe6a895224"/>
 	<patches>
-	    <patch file="&patch_dir;pxlib.patch"/>
+	    <patch file="&patch_dir;pxlib-intl.patch"/>
 	</patches>
     </tarball>
 
@@ -305,6 +311,7 @@
 	<branch/>
 	<dependencies>
 	    <dep package="glib"/>
+	    <dep package="gtk+"/> <!-- make sure gdkpixbuf does not pick up external gtk -->
 	    <dep package="libxml2"/>
 	    <dep package="zlib"/>
 	    <dep package="libbz2"/>
diff --git a/tools/win32/patches/glib-disable-python.patch b/tools/win32/patches/glib-disable-python.patch
new file mode 100644
index 0000000..261b153
--- /dev/null
+++ b/tools/win32/patches/glib-disable-python.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.in b/configure.in
+index 812c372..2c0bfd3 100644
+--- a/configure.in
++++ b/configure.in
+@@ -380,7 +380,7 @@ fi
+ AC_SUBST(PERL_PATH)
+ 
+ # Need suitable python path for greport
+-AM_PATH_PYTHON(2.4,,PYTHON="/usr/bin/env python2.4")
++dnl AM_PATH_PYTHON(2.4,,PYTHON="/usr/bin/env python2.4")
+ 
+ 
+ dnl ***********************
diff --git a/tools/win32/patches/gtk-doc-disable-python.patch b/tools/win32/patches/gtk-doc-disable-python.patch
new file mode 100644
index 0000000..0564310
--- /dev/null
+++ b/tools/win32/patches/gtk-doc-disable-python.patch
@@ -0,0 +1,11 @@
+--- configure.in	2008-10-16 14:50:35.000000000 -0400
++++ configure.in	2009-10-10 07:20:59.000000000 -0400
+@@ -45,7 +45,7 @@
+ dnl
+ dnl Check for Python.
+ dnl
+-AM_PATH_PYTHON([2.3],,)
++dnl AM_PATH_PYTHON([2.3],,)
+ AM_CONDITIONAL([HAVE_PYTHON], [test -n "$PYTHON"])
+ 
+ dnl
diff --git a/tools/win32/patches/gtk-pending-2.18.3.patch b/tools/win32/patches/gtk-pending-2.18.3.patch
new file mode 100644
index 0000000..1881994
--- /dev/null
+++ b/tools/win32/patches/gtk-pending-2.18.3.patch
@@ -0,0 +1,170 @@
+diff --git a/gdk-pixbuf/io-gdip-utils.c b/gdk-pixbuf/io-gdip-utils.c
+index 3dba9e5..b8fa72b 100644
+--- a/gdk-pixbuf/io-gdip-utils.c
++++ b/gdk-pixbuf/io-gdip-utils.c
+@@ -31,6 +31,18 @@
+ 
+ #define LOAD_BUFFER_SIZE 65536
+ 
++struct _GdipContext {
++  GdkPixbufModuleUpdatedFunc  updated_func;
++  GdkPixbufModulePreparedFunc prepared_func;
++  GdkPixbufModuleSizeFunc     size_func;
++
++  gpointer                    user_data;
++  GByteArray                 *buffer;
++  IStream                    *stream;
++  HGLOBAL                     hg;
++};
++typedef struct _GdipContext GdipContext;
++
+ static GdiplusStartupFunc GdiplusStartup;
+ static GdipCreateBitmapFromStreamFunc GdipCreateBitmapFromStream;
+ static GdipBitmapGetPixelFunc GdipBitmapGetPixel;
+@@ -339,16 +351,16 @@ gdip_pixbuf_to_bitmap (GdkPixbuf *pixbuf)
+ }
+ 
+ static GpBitmap *
+-gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
++gdip_buffer_to_bitmap (GdipContext *context, GError **error)
+ {
+   HRESULT hr;
+   HGLOBAL hg = NULL;
+   GpBitmap *bitmap = NULL;
+   IStream *stream = NULL;
+   GpStatus status;
+-  guint64 size64 = size;
++  guint64 size64 = context->buffer->len;
+ 
+-  hg = gdip_buffer_to_hglobal (buffer, size, error);
++  hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
+ 
+   if (!hg)
+     return NULL;
+@@ -365,26 +377,30 @@ gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
+ 
+   status = GdipCreateBitmapFromStream (stream, &bitmap);
+ 
+-  if (Ok != status)
++  if (Ok != status) {
+     gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
++    IStream_Release (stream);
++    GlobalFree (hg);
++    return NULL;
++  }
+ 
+-  IStream_Release (stream);
+-  GlobalFree (hg);
++  context->stream = stream;
++  context->hg = hg;
+ 
+   return bitmap;
+ }
+ 
+ static GpImage *
+-gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
++gdip_buffer_to_image (GdipContext *context, GError **error)
+ {
+   HRESULT hr;
+   HGLOBAL hg = NULL;
+   GpImage *image = NULL;
+   IStream *stream = NULL;
+   GpStatus status;
+-  guint64 size64 = size;
++  guint64 size64 = context->buffer->len;
+ 
+-  hg = gdip_buffer_to_hglobal (buffer, size, error);
++  hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
+ 
+   if (!hg)
+     return NULL;
+@@ -400,11 +416,15 @@ gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
+   IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
+   status = GdipLoadImageFromStream (stream, &image);
+ 
+-  if (Ok != status)
++  if (Ok != status) {
+     gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
++    IStream_Release (stream);
++    GlobalFree (hg);
++    return NULL;
++  }
+ 
+-  IStream_Release (stream);
+-  GlobalFree (hg);
++  context->stream = stream;
++  context->hg = hg;
+ 
+   return image;
+ }
+@@ -591,24 +611,14 @@ gdip_bitmap_get_n_loops (GpBitmap *bitmap, guint *loops)
+   return success;
+ }
+ 
+-/*************************************************************************/
+-/*************************************************************************/
+-
+-struct _GdipContext {
+-  GdkPixbufModuleUpdatedFunc  updated_func;
+-  GdkPixbufModulePreparedFunc prepared_func;
+-  GdkPixbufModuleSizeFunc     size_func;
+-
+-  gpointer                    user_data;
+-
+-  GByteArray                 *buffer;
+-};
+-typedef struct _GdipContext GdipContext;
+-
+ static void
+ destroy_gdipcontext (GdipContext *context)
+ {
+   if (context != NULL) {
++    if (context->stream != NULL) {
++      IStream_Release(context->stream);
++      GlobalFree (context->hg);
++    }
+     g_byte_array_free (context->buffer, TRUE);
+     g_free (context);
+   }
+@@ -807,9 +817,8 @@ gdk_pixbuf__gdip_image_stop_load (gpointer data, GError **error)
+ {
+   GdipContext *context = (GdipContext *)data;
+   GpBitmap    *bitmap = NULL;
+-  GByteArray *image_buffer = context->buffer;
+ 
+-  bitmap = gdip_buffer_to_bitmap ((gchar *)image_buffer->data, image_buffer->len, error);
++  bitmap = gdip_buffer_to_bitmap (context, error);
+ 
+   if (!bitmap) {
+     destroy_gdipcontext (context);
+@@ -824,7 +833,6 @@ static gboolean
+ gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
+ {
+   GdipContext *context = (GdipContext *)data;
+-  GByteArray *image_buffer = context->buffer;
+ 
+   GpImage *metafile;
+   GpGraphics *graphics;
+@@ -833,7 +841,7 @@ gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
+   float metafile_xres, metafile_yres;
+   guint width, height;
+ 
+-  metafile = gdip_buffer_to_image ((gchar *)image_buffer->data, image_buffer->len, error);
++  metafile = gdip_buffer_to_image (context, error);
+   if (!metafile) {
+     destroy_gdipcontext (context);
+     g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Couldn't load metafile"));
+diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
+index 2bbc96d..645da6f 100644
+--- a/gtk/gtkmain.c
++++ b/gtk/gtkmain.c
+@@ -686,7 +686,9 @@ do_post_parse_initialization (int    *argc,
+ 
+   gettext_initialization ();
+ 
++#ifdef SIGPIPE
+   signal (SIGPIPE, SIG_IGN);
++#endif
+ 
+   if (g_fatal_warnings)
+     {
diff --git a/tools/win32/patches/gtk-use-wine-to-cross-compile.patch b/tools/win32/patches/gtk-use-wine-to-cross-compile.patch
new file mode 100644
index 0000000..9872b15
--- /dev/null
+++ b/tools/win32/patches/gtk-use-wine-to-cross-compile.patch
@@ -0,0 +1,85 @@
+diff -ur gtk+-2.18.2/gdk-pixbuf/Makefile.in /gnome/src/gnumeric/tools/win32/debug/src/gtk+-2.18.2/gdk-pixbuf/Makefile.in
+--- gtk+-2.18.2/gdk-pixbuf/Makefile.in	2009-10-05 16:46:07.000000000 -0400
++++ gtk+-2.18.2/gdk-pixbuf/Makefile.in	2009-10-10 23:44:41.000000000 -0400
+@@ -1390,8 +1390,8 @@
+ 	gdk-pixbuf-enum-types.c gdk-pixbuf-marshal.h \
+ 	gdk-pixbuf-marshal.c gdk-pixbuf.loaders s-enum-types-h \
+ 	stamp-gdk-pixbuf-marshal.h
+- CROSS_COMPILING_FALSE@RUN_QUERY_LOADER_TEST = test -z "$(DESTDIR)"
+- CROSS_COMPILING_TRUE@RUN_QUERY_LOADER_TEST = false
++RUN_QUERY_LOADER_TEST = test -z "$(DESTDIR)"
++#RUN_QUERY_LOADER_TEST = false
+ all: $(BUILT_SOURCES)
+ 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+ 
+@@ -2330,7 +2330,7 @@
+ install-data-hook: install-ms-lib install-def-file
+ 	@if $(RUN_QUERY_LOADER_TEST) ; then \
+ 	  $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
+-	  $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \
++	  $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders$(EXEEXT) > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \
+ 	else \
+ 	  echo "***" ; \
+ 	  echo "*** Warning: gdk-pixbuf.loaders not built" ; \
+@@ -2343,13 +2343,13 @@
+ uninstall-local: uninstall-ms-lib uninstall-def-file
+ 	rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders
+ 
+- CROSS_COMPILING_FALSE@all-local: gdk-pixbuf.loaders
++all-local: gdk-pixbuf.loaders
+ 
+ @BUILD_DYNAMIC_MODULES_TRUE gdk-pixbuf loaders: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders$(EXEEXT)
+ @BUILD_DYNAMIC_MODULES_TRUE@	LOADERS=`echo libpixbufloader-*.la` ; \
+ @BUILD_DYNAMIC_MODULES_TRUE@	if test "x$$LOADERS" != 'xlibpixbufloader-*.la' ; then \
+ @BUILD_DYNAMIC_MODULES_TRUE@          echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \
+- BUILD_DYNAMIC_MODULES_TRUE@	  $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders $$LOADERS > ./gdk-pixbuf.loaders ;\
++ BUILD_DYNAMIC_MODULES_TRUE@	  $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders$(EXEEXT) $$LOADERS > ./gdk-pixbuf.loaders ;\
+ @BUILD_DYNAMIC_MODULES_TRUE@	else \
+ @BUILD_DYNAMIC_MODULES_TRUE@          echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
+ @BUILD_DYNAMIC_MODULES_TRUE@	  touch gdk-pixbuf.loaders; \
+diff -ur gtk+-2.18.2/modules/input/Makefile.in /gnome/src/gnumeric/tools/win32/debug/src/gtk+-2.18.2/modules/input/Makefile.in
+--- gtk+-2.18.2/modules/input/Makefile.in	2009-10-05 16:46:10.000000000 -0400
++++ gtk+-2.18.2/modules/input/Makefile.in	2009-10-11 08:15:33.000000000 -0400
+@@ -702,8 +702,8 @@
+ @INCLUDE_IM_MULTIPRESS_FALSE MULTIPRESS_MODULE = im-multipress.la
+ imconffiledir = $(sysconfdir)/gtk-2.0
+ dist_imconffile_DATA = im-multipress.conf
+- CROSS_COMPILING_FALSE@RUN_QUERY_IMMODULES_TEST = test -z "$(DESTDIR)"
+- CROSS_COMPILING_TRUE@RUN_QUERY_IMMODULES_TEST = false
++RUN_QUERY_IMMODULES_TEST = test -z "$(DESTDIR)"
++#RUN_QUERY_IMMODULES_TEST = false
+ @BUILD_DYNAMIC_MODULES_TRUE module_LTLIBRARIES = \
+ @BUILD_DYNAMIC_MODULES_TRUE@	$(AM_ET_MODULE)			\
+ @BUILD_DYNAMIC_MODULES_TRUE@	$(CEDILLA_MODULE)		\
+@@ -1049,7 +1049,7 @@
+ check-am: all-am
+ 	$(MAKE) $(AM_MAKEFLAGS) check-local
+ check: check-am
+- CROSS_COMPILING_TRUE@all-local:
++#all-local:
+ all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
+ installdirs:
+ 	for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(imconffiledir)"; do \
+@@ -1237,8 +1237,8 @@
+ 	@if $(RUN_QUERY_IMMODULES_TEST) ; then \
+ 	  echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
+ 	  $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
+-	  echo "$(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules" ; \
+-	  $(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules ; \
++	  echo "$(top_builddir)/gtk/gtk-query-immodules-2.0$(EXEEXT) > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules" ; \
++	  $(top_builddir)/gtk/gtk-query-immodules-2.0$(EXEEXT) > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules ; \
+ 	else \
+ 	  echo "***" ; \
+ 	  echo "*** Warning: gtk.immodules not built" ; \
+@@ -1254,9 +1254,9 @@
+ included-modules: $(noinst_LTLIBRARIES)
+ 
+ gtk.immodules: Makefile.am $(module_LTLIBRARIES)
+-	$(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules
++	$(top_builddir)/gtk/gtk-query-immodules-2.0$(EXEEXT) $(module_LTLIBRARIES) > gtk.immodules
+ 
+- CROSS_COMPILING_FALSE@all-local: gtk.immodules
++all-local: gtk.immodules
+ 
+ -include $(top_srcdir)/git.mk
+ 
diff --git a/tools/win32/patches/psiconv.patch b/tools/win32/patches/psiconv.patch
index 2d4320b..addef1e 100644
--- a/tools/win32/patches/psiconv.patch
+++ b/tools/win32/patches/psiconv.patch
@@ -1,3 +1,14 @@
+--- autogen.sh	2003-11-11 15:41:37.000000000 -0500
++++ autogen.sh	2009-10-10 07:14:00.000000000 -0400
+@@ -39,7 +39,4 @@
+ echo "Creating configure..."
+ autoconf$AUTOCONF_VERSION
+ 
+-echo ""
+-echo "You can run ./configure now."
+-echo ""
+-
++./configure $*
 --- lib/psiconv/configuration.c	2005-11-15 10:08:08.000000000 -0500
 +++ lib/psiconv/configuration.c	2007-08-06 16:45:43.000000000 -0400
 @@ -336,7 +336,7 @@
@@ -9,3 +20,14 @@
  	                               strlen(pathptr));
      filename = malloc(filename_len + 1);
      filename = strncpy(filename,pathptr,filename_len);
+--- formats/generate_xhtml.sh	2004-02-23 08:18:57.000000000 -0500
++++ formats/generate_xhtml.sh	2009-10-10 06:49:15.000000000 -0400
+@@ -26,7 +26,7 @@
+ echo "Generating xhtml docs..."
+ 
+ libtool=$basedir/libtool
+-psiconv=$basedir/program/psiconv/psiconv
++psiconv=$basedir/program/psiconv/psiconv.exe
+ indexfile=$outputdir/index
+ tempdir=$outputdir/.temp
+ mkindex=$basedir/formats/index_html.sh
diff --git a/tools/win32/patches/pxlib-intl.patch b/tools/win32/patches/pxlib-intl.patch
index 655e86e..d2508dc 100644
--- a/tools/win32/patches/pxlib-intl.patch
+++ b/tools/win32/patches/pxlib-intl.patch
@@ -1,19 +1,13 @@
-*** Makefile.am	Sun Oct  4 12:31:57 2009
---- Makefile.am	Sun Oct  4 12:32:29 2009
-***************
-*** 33,39 ****
-  		px_crypt.c \
-  		gregor.c
-  
-! libpx_la_LIBADD = @RECODE_LIBS@ @GSF_LIBS@
-  
-  BUILD_LIBS = -lm
-  
---- 33,39 ----
-  		px_crypt.c \
-  		gregor.c
-  
-! libpx_la_LIBADD = @RECODE_LIBS@ @GSF_LIBS@ -lintl -liconv
-  
-  BUILD_LIBS = -lm
-  
+Patch the Makefile.in because we are just running configure, which is not using
+Makefile.am
+--- src/Makefile.in	2007-10-01 03:26:59.000000000 -0400
++++ src/Makefile.in	2009-10-10 06:44:06.000000000 -0400
+@@ -273,7 +273,7 @@
+ 		px_crypt.c \
+ 		gregor.c
+ 
+-libpx_la_LIBADD = @RECODE_LIBS@ @GSF_LIBS@
++libpx_la_LIBADD = @RECODE_LIBS@ @GSF_LIBS@ -lintl -liconv
+ BUILD_LIBS = -lm
+ all: all-am
+ 



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