Building AbiWord and Plugin Installers

CVS HEAD/2.5

by Ryan Pavlik (rp), with fantastic help from "Sum1" and Marc Maurer (uwog)

Released 26 May 2007.

Table of Contents

[0.1] General Instructions

[0.2] What You'll Need (besides a tarball or a checkout of Abi)

[0.2.1] Files

[0.2.2] Sources

[0.3] Preparing MSYS/MinGW

[0.3.1] Installing MSYS, MinGW

[0.3.2] Installing Dependencies

[0.3.3] If NSIS is not in C:\Program Files\NSIS

[0.4] Building the Installers

[0.4.1] Preparing your AbiWord Source Tree

[0.4.1.1] From SVN/CVS

[0.4.1.2] From Tarballs

[0.4.1.3] For both SVN and Tarballs

[0.5] If Using a Nightly Builder or the Nightly-Modified Release Builder

[0.6] Building AbiWord Core Installer

[0.7] Tools Plugins Installer Build

[0.7.1] One-Time Prep:

[0.7.2] Each Build:

[0.8] Import/Export Plugins Installer Build

[0.8.1] One-Time Prep

[0.8.2] Each Build:

General Instructions

These instructions are designed to provide the reader with the ability to create self-contained installation files (installers), such as those available for download on the web site.  Ryan Pavlik builds the provided installers using this procedure for Windows releases in the 2.3.x series starting with 2.3.4, and will provide binaries similarly for the 2.4.x series.  PLEASE NOTE: You do not need to follow these instructions to install AbiWord on Windows!  Please use a pre-made installer available at www.abisource.com/download/ - they are standard and known to be reliable.

Several of the sections include a "One-Time Prep" subsection and an "Each Build" subsection.  While these are generally proper classifications, please note that after a make realclean or any removal of the \abi\src\MINGW32_1.0.10_i386_OBJ\bin directory, any files copied to there must be recopied, even if the instructions to copy are listed under the "One-Time Prep" heading.  Any steps preceded by "//" are C-style comments, and should NOT BE COMPLETED.  They have not yet been removed because I'm not sure my new steps are better yet.

What You'll Need (besides a tarball or a checkout of Abi)

Files

Note:  The "C" column is for the minimum compiling options that require the dep.  A is for the core abi, T is for tools plugins, I is for imp/exp plugins, and P is for either plugin set.  N is for "not required so don't install" - lines that I think might be needed but apparently aren't.

Filename

RP Version

Source

C

Notes

bzip2-*-bin.zip

1.0.3-1

GW32

I

bzip2-*-lib.zip

1.0.3-1

GW32

I

gettext-*.zip

0.14.5

TML

A

gettext-dev-*.zip

0.14.5

TML

A

glib-*.zip

2.12.7

TML

A

glib-dev-*.zip

2.12.7

TML

A

libgsf-*.zip

1.14.3

TML

A

libgsf-dev-*.zip

1.14.3

TML

A

libiconv-*.bin.woe32.zip

1.9.1

TML

A

libwpd-*-MinGW.zip

0.8.8

LibWPD

I

http://libwpd.sourceforge.net/download.html

libwpd-devel-*-MinGW.zip

0.8.8

LibWPD

I

http://libwpd.sourceforge.net/download.html

libxml2-*.win32.zip

2.6.27

Igor

A

ftp://ftp.zlatkovic.com/pub/libxml/

libxml2-*-extras.zip

2.6.27

RP/Abi

A

libwv-*.zip

1.2.2-1

RP/Abi

A

libwv-dev-*.zip

1.2.2-1

RP/Abi

A

libmathview-*.zip

0.7.7

RP/Abi

T

in gtkmathview/

libmathview-dev-*.zip

0.7.7

RP/Abi

T

in gtkmathview/

link-grammar-*.zip

4.2.2

RP/Abi

T

in link-grammar/

pkgconfig-*.zip

0.20

TML

A

w32api-*.zip

3.8

MinGW

A

http://www.mingw.org

**The following files have individual installation locations

They are not zipped - just place the files where it is listed.

libzdll.a

RP or Mikey

A

Put in MinGW/lib/

(or follow instructions in zlib distribution to create this file)

**The following files are installed separately below...

Do not unzip these into MinGW/

psiconv-*.tar.gz

0.9.6

Separately compiled and installed - not used at the moment

zlib-*.zip

1.2.3

zlib.net

A

Installed separately as peer

nsis-*.exe

2.23

nsis.sf.net

A

Installer file

ZipDLL.zip

nsis.sf.net

Plugin for NSIS

NSIS MD5 plugin

nsis.sf.net

Plugin for NSIS

NSIS UnTGZ plugin

nsis.sf.net

Plugin for NSIS

CVSNT

2.5.02.2064

ActivePerl

5.8.7.813

A

Sources

Preparing MSYS/MinGW

Installing MSYS, MinGW

  1.  Download the latest MSYS, and MinGW from www.mingw.org
  2.  Install MinGW according to instructions, to c:\MinGW or d:\MinGW preferably.  (I used d:\MinGW)
  3.  Install MSYS according to instructions, probably to c:\MSYS or d:\MSYS (I used d:\MSYS), make sure to tell it where you installed MinGW at the appropriate point in the installer.
  4. Download these files from the MinGW web site: msys-automake-1.8.2.tar.bz2, msys-autoconf-2.59.tar.bz2, msys-libtool-1.5.tar.bz2, and unzip them all into d:\MSYS\1.0 or equivalent.
  5. Download the latest CVSNT ZIP file from http://www.cvsnt.org/wiki/Download and extract to D:\cvs, C:\CVS, or some similar location without spaces.
  6. Add your CVS install directory to your path.
  7. Download and install the latest Subversion binaries for Windows from http://subversion.tigris.org
  8. Download and install the latest ActivePerl from http://activestate.org/Products/Download/Download.plex?id=ActivePerl  (Use the MSI package) to a nice location like D:\Perl
  9.  Rename libbz2.dll.a in mingw\lib to _libbz2.dll.a
  10. (SKIP THIS STEP)//  In a unix-lineendings-aware text editor (like Metapad), open \MinGW\lib\pkgconfig\libgsf-1.pc and the two libwpd files and set PREFIX to /mingw (from /target), then save.

Installing Dependencies

  1.  Make sure you have downloaded all files in the above table.
  2.  Extract all files in the above table up until the first starred note into MinGW, so that their directories overwrite those already installed.  This will insert the bin files into MinGW/bin, includes into MinGW/include, and so on.  (Select which files to install based on the "C" column.)
  3.  Move the four files after the first starred note (they are not zipped) into the location listed in their note.
  4.  Install NSIS according to instructions.
  5.  Unzip the plugins into the NSIS plugins subdirectory.

If NSIS is not in C:\Program Files\NSIS

  1.  Open the Control Panel, go into System.  
  2.  In Windows XP/2000, on the Advanced Tab, click "Environment Variables".  In any other Windows, dig around until you find something similar.
  3.  Add a new variable, named NSIS_ROOT, and set the value to the MSYS path to the NSIS root (for instance, "/d/Program Files/NSIS")

Building the Installers

Preparing your AbiWord Source Tree

From SVN/CVS

  1.  Create a a directory with no spaces in the name (easier) in a shallow directory of one of your drives (c:\abisource, d:\srctrees\abihead)
  2. Click Start, Run, enter "cmd" (for WinNT/2k/XP, "command" for all other versions)
  3. Execute the following commands:
    1. set CVSROOT=:pserver:anoncvs@cvs.abisource.com:/cvsroot
    2. cvs login
      1. Password is anoncvs
      2. only needs to be performed once
  4. Close your command window.
  5.  Open MSYS.
  6.  cd to the directory you just made using msys syntax (e.g. cd /c/abisource or cd /d/srctrees/abihead)
  7.  execute these commands:
    1. svn co http://svn.abisource.com/abiword/trunk abi
    2. svn co http://svn.abisource.com/abiword-plugins/trunk abiword-plugins
    3. svn co http://svn.abisource.com/abiword-extras/trunk abidistfiles
    4.  svn co http://svn.abisource.com/abiword-docs/trunk abiword-docs
    5.  export CVSROOT=:pserver:anoncvs@cvs.abisource.com:/cvsroot
    6. cvs -z3 co libpng popt fribidi

From Tarballs

  1.  Create a a directory with no spaces in the name (easier) in a shallow directory of one of your drives (c:\abisource, d:\srctrees\abistable)  (If using the modified nightly script, it's c:\src\abi25release\ )
  2. Download all four tarballs to a subdirectory ("tardist" suggested).
  3. Untar abiword-2.5.0.tar.gz.  You will get an abiword-2.5.0 directory - rename it to abi and move it to the parent directory.
  4. Untar abiword-docs-2.5.0.tar.gz, rename the abiword-docs-2.5.0 directory to abiword-docs and move it to the parent directory.
  5. Untar abiword-extras-2.5.0.tar.gz, rename the abiword-extras-2.5.0 to abidistfiles, and move it to the parent directory.
  6.  Untar abiword-plugins-2.5.0.tar.gz, rename the abiword-plugins-2.5.0 directory to abiword-plugins and move it to the parent directory.
  7. From a CVS tree assembled as above, copy the libpng, popt, and fribidi folders to c:\src\abi25release\ (or comparable)  then continue below.

For both SVN and Tarballs

  1. Complete the above steps for your chosen method of source distribution.
  2.  Make a new directory inside your AbiWord source directory (parent of abi directory) named libs.
  3.  Make a new directory within it named zlib.
  4.  Unzip your zlib download within there.
  5. Copy zlib1.dll to your c:\winnt\system32 or similar directory.

If Using a Nightly Builder or the Nightly-Modified Release Builder

First, follow the "once" steps below to prepare your environment fully.  Furthermore, you will need to follow the "each build" steps below that refer to copying files and translate them to copying the files into your buildtree directory in the buildfiles setup.  Once this setup is complete, you can simply run the .bat file to execute the nightly or release build.  In theory. :)

Building AbiWord Core Installer

  1. Open MSYS
  2. cd into your AbiWord source directory, and the abi subdirectory within (cd /d/srctrees/abihead/abi for me)
  3. Execute the command "PKG_CONFIG_PATH=/mingw/lib/pkgconfig make" (no quotes)
  4. Copy "libglib-2.0-0.dll", "iconv.dll", "intl.dll",  "libgsf-1-114.dll", "bzip2.dll" and "libxml2.dll"  into abi/src/MINGW32_1.0.10_i386_OBJ/bin from /mingw/bin (/glib-2.0)
  5. Execute "make distribution"
  6. Your installer will be in the abi/dist directory.

Tools Plugins Installer Build

One-Time Prep:

  1. If you installed the prebuilt packages for libmathview and link-grammar above acccording to the instructions, no further action is needed to build that dependency.  To use a new version of libmathview or link-grammar, separate build instructions will be provided.

Each Build:

  1.  Copy the file \MinGW\etc\gtkmathview\gtkmathview.conf.xml to abi\src\MINGW32_1.0.10_i386_OBJ\AbiSuite\math (you will have to create this directory)
  2.  Copy the file \MinGW\share\gtkmathview\dictionary.xml to abi\src\MINGW32_1.0.10_i386_OBJ\AbiSuite\math
  3.  Copy the file \MinGW\share\gtkmathview\dictionary-local.xml to abi\src\MINGW32_1.0.10_i386_OBJ\AbiSuite\math
  4.  copy \MinGW\bin\liblink-grammar-4.dll to \abi\src\MINGW32_1.0.10_i386_OBJ\bin
  5.  copy /mingw/share/link-grammar/en folder to \abi\src\MINGW32_1.0.10_i386_OBJ\bin\
  6.  Open MSYS
  7.  cd into abi
  8.  PKG_CONFIG_PATH=/mingw/lib/pkgconfig make disttools
  9.  Your installer is in abi\dist

Import/Export Plugins Installer Build

One-Time Prep

  1. (Skip the part about psiconv right now - it is disabled)//Download and unzip psiconv
  2. Open MSYS
  3. //cd into psiconv-0.9.7
  4. //run ./configure --prefix=/mingw
  5. //open up the source tree and find and open configuration.c
  6. //in configuration.c, you'll need to change two index() calls to strchr() and save
  7. //in the psiconv directory, make install
  8.  in MinGW\include, copy windef.h to windef.h.bak
  9.  open windef.h up in an editor
  10.  find (at about line 315) typedef struct tagPOINT {
  11.  Insert "#define POINT ICKY_WIN_POINT" before it and save  (this is case sensitive!)

Each Build:

  1.  copy libwpd-0.8.dll from mingw/bin to abi\src\MINGW32_1.0.10_i386_OBJ\plugins
  2. Open MSYS and cd into the abi/ directory
  3.  PKG_CONFIG_PATH=/mingw/lib/pkgconfig make distimpexp
  4.  Your installer is in abi\dist