Build Evince for Windows

The Evince for Windows installers are built by cross compiling Evince on Linux using the Open Build Service. Every specific installer is built in a separate subproject of the 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. 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 openSUSE-Tools software download repository. To use these,

    • on openSUSE 11.4 you do:
      sudo zypper ar ­f ­r \
      sudo zypper in osc osc­source_validator
    • on Ubuntu you do:
      # Add openSUSE:Tools repository key for APT.
      sudo sh -c "wget -O - '' | apt-key add - "
      # Add openSUSE:Tools to APT repositories.
      sudo sh -c "echo 'deb ./' > /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


  • 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_11.4 build environment:

  • osc build openSUSE_11.4
    (You'll be prompted for your root password)

    {i} Even when you run a Linux distribution other then openSUSE 11.4, you should NOT change the openSUSE_11.4 part here.

    This will

    • create an chroot in /var/tmp/buildroot,
    • download and install an openSUSE 11.4 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.

    You can find the resulting Windows installer in the mingw32-evince-msi-X.X.X-Y.Z.noarch.rpm package.

    {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/ 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 @@
         # say hello

{i} For more information on using the Open Build Service, read the tutorial.

Attic/EvinceBuildForWindows (last edited 2015-05-25 13:07:33 by SvitozarCherepii)