Building AbiWord and Plugin Installers

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

Updated 26 May 2007

Table of Contents

[1] Building AbiWord and Plugin Installers

[1.1] General Instructions

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

[1.2.1] Files

[1.2.2] Sources

[1.3] Preparing MSYS/MinGW

[1.3.1] Installing MSYS, DTK, MinGW

[1.3.2] Installing Dependencies

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

[1.4] Building the Installers

[1.4.1] Preparing your AbiWord Source Tree

[1.4.1.1] From SVN

[1.4.1.2] From a Tarball

[1.4.1.3] For both SVN and Tarballs

[1.5] Building AbiWord Core Installer

[1.6] Tools Plugins Installer Build

[1.6.1] One-Time Prep:

[1.6.2] Each Build:

[1.7] Import/Export Plugins Installer Build

[1.7.1] One-Time Prep

[1.7.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

Filename

RP Version

Source

Notes

bzip2-1.0.2-3-bin.zip

1.0.2-3

GW32

bzip2-1.0.2-3-lib.zip

1.0.2-3

GW32

gettext-runtime-0.13.1.zip

0.13.1

TML

glib-2.4.7.zip

2.4.7

TML

glib-dev-2.4.7.zip

2.4.7

TML

libgsf-1.8.2-20040121.zip

1.8.2-20040121

TML

libgsf-dev-1.8.2.zip

1.8.2

TML

libiconv-1.8-1-lib.zip

1.8.1

GW32

Skip this?

libiconv-1.9.1.bin.woe32.zip

1.9.1

TML

libwpd-0.8.3-MinGW.zip

0.8.3

LibWPD

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

libwpd-devel-0.8.3-MinGW.zip

0.8.3

LibWPD

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

libxml2-2.6.19.win32.zip

2.4.12

Igor

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

libxslt-1.1.14.win32.zip

1.1.14

Igor

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

libmathview-0.7.5.zip

0.7.5

RP/Abi

in gtkmathview/

libmathview-dev-0.7.5.zip

0.7.5

RP/Abi

in gtkmathview/

link-grammar-4.1.3.zip

4.1.3 Abi

RP/Abi

in link-grammar/

pkgconfig-0.15.zip

0.15

TML

**The following four files have individual installation locations

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

libxml2.a

Mikey

Put in MinGW/lib/

libxml2.def

Mikey

Put in MinGW/lib/

libzdll.a

Mikey

Put in MinGW/lib/

libxml-2.0.pc

Mikey

Put in MinGW/lib/pkgconfig/

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

Do not unzip these into MinGW/

psiconv-0.9.6.tar.gz

0.9.6

Separately compiled and installed

zlib-1.2.3.zip

1.2.2 (for 2.3.4)

zlib.net

Installed separately as peer

nsis-2.07.exe

2.07

nsis.sf.net

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

Sources

Preparing MSYS/MinGW

Installing MSYS, DTK, 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

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.
  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

  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/abistable)
  7.  execute these commands:
    1. export CVSROOT=:pserver:anoncvs@cvs.abisource.com:/cvsroot
    2.  svn co http://svn.abisource.com/abiword/branches/ABI-2-4-0-STABLE abi
    3.  svn co http://svn.abisource.com/abiword-plugins/branches/ABI-2-4-0-STABLE abiword-plugins
    4. svn co http://svn.abisource.com/abiword-extras/branches/ABI-2-4-0-STABLE abidistfiles
    5. svn co http://svn.abisource.com/abiword-docs/branches/ABI-2-4-0-STABLE abiword-docs
    6.  svn co http://svn.abisource.com/wv/branches/wv-1-0-0-STABLE wv
    7. cvs -z3 co -r ABI-2-4-0-STABLE libpng popt
    8. cvs -z3 co expat fribidi libiconv link-grammar

From a Tarball

  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)
  2.  Untar your tarball there (in msys, copy it in and run tar xvzf abiword-2.3.4.tar.gz or tar xvjf abiword-2.3.4.tar.bz2, for instance)
  3.  Inside what you have untarred, delete the zlib directory

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.

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 "make distribution" (no quotes)
  4. 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.  Copy libxml2.dll from mingw/bin to abi\src\MINGW32_1.0.10_i386_OBJ\bin
  7.  Open MSYS
  8.  cd into abi
  9. run the command "export PKG_CONFIG_PATH=/mingw/lib/pkgconfig"
  10.  make disttools
  11.  Your installer is in abi\dist

Import/Export Plugins Installer Build

One-Time Prep

  1.  in MinGW\include, copy windef.h to windef.h.bak
  2.  open windef.h up in an editor
  3.  find (at about line 315) typedef struct tagPOINT {
  4.  Insert #define POINT ICKY_WIN_POINT before it and save
  5.  Rename libbz2.dll.a in mingw\lib to _libbz2.dll.a
  6. 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.

Each Build:

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