File 0003-Add-README.Windows.patch of Package mingw32-evince

From 62568eba2a4d9c04617861a58bb200c10ee9f322 Mon Sep 17 00:00:00 2001
From: Hib Eris <hib@hiberis.nl>
Date: Tue, 11 Oct 2011 11:03:07 +0200
Subject: [PATCH 03/12] Add README.Windows

---
 Makefile.am    |    1 +
 README.Windows |  127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 128 insertions(+), 0 deletions(-)
 create mode 100644 README.Windows

diff --git a/Makefile.am b/Makefile.am
index a971ede..73ecb4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,6 +56,7 @@ EXTRA_DIST = \
 	$(intltool_extra) \
 	$(header_DATA) \
 	autogen.sh \
+	README.Windows \
 	MAINTAINERS
 
 DISTCLEANFILES = 		\
diff --git a/README.Windows b/README.Windows
new file mode 100644
index 0000000..3ef8574
--- /dev/null
+++ b/README.Windows
@@ -0,0 +1,127 @@
+== Build Evince for Windows ==
+
+The Evince for Windows installers are built by cross compiling Evince on
+Linux using the [[http://build.opensuse.org|Open Build Service]].
+Every specific installer is built in a separate subproject of the 
+[[https://build.opensuse.org/project/show?project=GNOME%3AApps%3AEvince%3AWindows|GNOME:Apps:Evince:Windows]] project. All the packages and sources needed
+to build an Evince installer are part of its subproject.
+
+Cross compiling an Evince installer yourself on any Linux distribution is quite easy when you reuse the packages from its subproject. To do this,
+
+1.
+[[https://secure-www.novell.com/selfreg/jsp/createOpenSuseAccount.jsp?target=https://opensusestage.provo.novell.com|Create a Novell account]] to access the Open Build Service.
+
+2.
+Install the Open Build Service command line client ''osc''.
+
+ * The most up to date ''osc'' packages for various Linux distributions can
+ be found in the 
+ [[http://download.opensuse.org/repositories/openSUSE:/Tools/|openSUSE-Tools software download repository]].
+ To use these,
+
+   <<BR>>
+   * on openSUSE 12.2 you do:
+   {{{
+sudo zypper ar ­f ­r \
+    'http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_12.2/openSUSE:Tools.repo'
+sudo zypper in osc osc­source_validator
+   }}}
+   * on Ubuntu you do:
+   {{{
+# Add openSUSE:Tools repository key for APT.
+sudo sh -c "wget -O - 'http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_11.04/Release.key' | apt-key add - "
+
+# Add openSUSE:Tools to APT repositories.
+sudo sh -c "echo 'deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_11.04 ./' > /etc/apt/sources.list.d/openSUSE_Tools.list"
+
+# Resynchronize your APT index.
+sudo apt-get update
+
+# Install osc, build, python-rpm.
+sudo apt-get install osc build python-rpm
+
+   }}}
+
+
+3.
+Checkout the latest stable mingw32-evince package from the
+GNOME:Apps:Evince:Windows:STABLE subproject. If you need a specific version,
+checkout the GNOME:Apps:Evince:Windows:$VERSION subproject.
+
+ {{{
+osc co -c GNOME:Apps:Evince:Windows:STABLE mingw32-evince
+ }}}
+or
+ {{{
+osc co -c GNOME:Apps:Evince:Windows:$VERSION mingw32-evince
+ }}}
+ (You'll be prompted for your Novell account username and password)
+
+4.
+Change into the mingw32-evince directory:
+
+ {{{
+cd mingw32-evince
+ }}}
+
+5.
+Build the package in an openSUSE_12.2 build environment:
+
+ {{{
+osc build openSUSE_12.2
+ }}}
+ (You'll be prompted for your root password)
+ <<BR>> {i} Even when you run a Linux distribution other then openSUSE 12.2,
+ you should NOT change the ''openSUSE_12.2'' part here.
+
+ <<BR>>This will
+  * create an chroot in /var/tmp/buildroot,
+  * download and install an openSUSE 12.2 build environment into the chroot,
+  * download and install all build dependencies of mingw32-evince into
+    the chroot,
+  * cross compile Evince
+  * and create rpm packages for it in /var/tmp/buildroot/usr/src/packages/RPMS.
+
+ <<BR>>You can find the resulting Windows installer in the
+ mingw32-evince-msi-X.X.X-Y.Z.noarch.rpm package.
+
+ <<BR>> {i} When you try to build the installer on a computer with less
+ then 2 GB memory, you might encounter this error:
+
+    {{{
+/usr/bin/candle -o evince.msi.wixobj -nologo -dwixdistdir=/tmp/wixdistdir-hack-evince   evince.msi.wxs
+preloader: Warning: failed to reserve range 00110000-68000000
+wine: failed to initialize: /usr/lib/wine/ntdll.dll.so: failed to map segment from shared object: Cannot allocate memory
+make: *** [evince.msi.wixobj] Error 1
+error: Bad exit status from /var/tmp/rpm-tmp.yY8TrU (%build)
+
+
+RPM build errors:
+    Bad exit status from /var/tmp/rpm-tmp.yY8TrU (%build)
+
+The buildroot was: /var/tmp/build-root
+    }}}
+
+  In this case it might help to apply a patch to /usr/bin/build:
+    {{{
+sudo patch /usr/bin/build << EOF
+--- build.orig	2011-04-15 16:39:45.523966001 +0200
++++ build	2011-04-15 16:40:00.163966000 +0200
+@@ -1238,7 +1238,7 @@
+     fi
+ fi
+ 
+-setmemorylimit
++#setmemorylimit
+ 
+ #
+ # say hello
+EOF
+    }}}
+
+<<BR>> {i} If you want to build a 64-bit version of Evince for Windows, you
+should replace mingw32-evince in the above instructions with mingw64-evince.
+
+<<BR>> {i} For more information on using the Open Build Service, read the
+[[http://en.opensuse.org/openSUSE:Build_Service_Tutorial|tutorial]].
+
-- 
1.7.5.4

openSUSE Build Service is sponsored by