How to prepare a WinGRASS Release

Table of Contents

Introduction

  1. Install MSYS
  2. Install MinGW
  3. Install the GRASS MSYS Environment
  4. Build and Install GRASS
  5. Create a GRASS self-contained Package
  6. Install NSIS
  7. Create the WinGRASS Installer

Credits and Contacts


Introduction

This document explains how to prepare a WinGRASS release (as a self-contained package installer) using the scripts contained in the mswindows folder. In order to avoid mistakes or misunderstandings, I highly recommend to follow each step and command exactly as they are written in this document.

1. Install MSYS (1.0.11)

Download the MSYS installer

Install to c:\msys

At the command prompt question for post install, type n and then enter.

Download the MSYS coreutils package

Unpack it to a temporary folder, then copy all the content of the coreutils-5.97 folder to c:\msys (overwrite the existing files when asked)

2. Install MinGW (5.1.4)

Download the MinGW installer

Select "Download and Install Current Version";

Install only "g++ compiler" and "MinGW Make";

Install to c:\msys\mingw

3. Install the GRASS MSYS Environment

Download the GRASS MSYS Environment

Extract the whole package to c:\msys\local

4. Build and Install GRASS (6.3.0)

Download the GRASS source code

Unpack to c:\msys\local\src

Open c:\msys\local\src\grass-6.3.0\man\Makefile

At line 13, replace:

default: $(MANPAGES)

with:

default:

In MSYS console, type:

cd /usr/local/src/grass-6.3.0
./configure \
--prefix=/usr/local \
--with-includes=/usr/local/include \
--with-libs=/usr/local/lib \
--disable-x11 \
--without-x \
--with-cxx \
--enable-shared \
--enable-largefile \
--with-opengl=windows \
--with-fftw \
--with-freetype \
--with-proj-share=/usr/local/share/proj \
--with-gdal=/usr/local/bin/gdal-config \
--with-tcltk --with-tcltk-includes=/usr/local/tcl-tk/include --with-tcltk-libs=/usr/local/tcl-tk/bin \
--with-sqlite --with-sqlite-includes=/usr/local/sqlite/include --with-sqlite-libs=/usr/local/sqlite/lib \
--with-postgres --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libs=/usr/local/pgsql/lib

When finished, you should have the following screen output:

GRASS is now configured for:  i686-pc-mingw32

 Source directory:            /usr/local/src/grass-6.3.0
 Build directory:             /usr/local/src/grass-6.3.0
 Installation directory:      ${prefix}/grass-6.3.0
 Startup script in directory: ${exec_prefix}/bin
 C compiler:                  gcc -g -O2 
 C++ compiler:                c++ -g -O2
 Building shared libraries:   yes
 64bit support:               no
 OpenGL platform:             Windows

  NVIZ:                       yes

  BLAS support:               no
  C++ support:                yes
  DWG support:                no
  FFMPEG support:             no
  FFTW support:               yes
  FreeType support:           yes
  GDAL support:               yes
  GLw support:                no
  JPEG support:               yes
  LAPACK support:             no
  Large File Support (LFS):   yes
  Motif support:              no
  MySQL support:              no
  NLS support:                no
  ODBC support:               no
  OGR support:                yes
  OpenGL support:             yes
  PNG support:                yes
  PostgreSQL support:         yes
  Python support:             no
  Readline support:           no
  SQLite support:             yes
  Tcl/Tk support:             yes
  wxWidgets support:          no
  TIFF support:               yes
  X11 support:                no
  MacOSX application:         no
Having GRASS successfully configured, now you can build it:
export PATH="/usr/local/bin:/usr/local/tcl-tk/bin:/usr/local/sqlite/bin:/usr/local/pgsql/lib:$PATH"
make

When finished, you should have the following compilation log:

GRASS GIS compilation log
-------------------------
Started compilation: Mon Jun 16 09:08:19 GMT 2008
--
Errors in:
/usr/local/src/grass-6.3.0/raster/r.li/r.li.daemon
/usr/local/src/grass-6.3.0/raster/r.li/r.li.edgedensity
/usr/local/src/grass-6.3.0/raster/r.li/r.li.patchdensity
/usr/local/src/grass-6.3.0/raster/r.li/r.li.patchnum
/usr/local/src/grass-6.3.0/raster/r.li/r.li.shape
/usr/local/src/grass-6.3.0/raster/r.li/r.li.simpson
/usr/local/src/grass-6.3.0/raster/r.li/r.li.shannon
/usr/local/src/grass-6.3.0/raster/r.li/r.li.mps
/usr/local/src/grass-6.3.0/raster/r.li/r.li.mpa
/usr/local/src/grass-6.3.0/raster/r.li/r.li.padcv
/usr/local/src/grass-6.3.0/raster/r.li/r.li.padsd
/usr/local/src/grass-6.3.0/raster/r.li/r.li.padrange
/usr/local/src/grass-6.3.0/raster/r.li/r.li.cwed
/usr/local/src/grass-6.3.0/raster/r.li/r.li.richness
/usr/local/src/grass-6.3.0/raster/r.li/r.li.dominance
--
In case of errors please change into the directory with error and run 'make'.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.
--
Finished compilation: Mon Jun 16 10:11:17 GMT 2008
make: *** [default] Error 1

Then install GRASS:

make install

Now GRASS should be installed in c:\msys\local\grass-6.3.0

5. Create a GRASS self-contained Package

Copy all the content of the mswindows folder to a temporary directory, for example c:\temp.

Launch the file c:\temp\GRASS-Packager.bat and select the option number 1.

When finished, you should have a GRASS self-contained release package in c:\temp\GRASS-Release-Package.

6. Install NSIS (2.38)

Download the NSIS installer

Install to c:\DevTools

7. Create the WinGRASS Installer

Open the the file c:\temp\GRASS-Installer.nsi.

At line 17 set the INSTALLER_TYPE variable to "Release", then, at lines 23-25, set the RELEASE_VERSION_NUMBER, the RELEASE_SVN_REVISION and the RELEASE_BINARY_REVISION variables.

Finally, right click on the file c:\temp\GRASS-Installer.nsi and select Compile NSIS Script.

When finished, you should have the WinGRASS release installer in c:\temp.

Credits and Contacts

The GRASS MSYS Environment and the GRASS Packager and Installer scripts are provided by Marco Pasetti.

To contact him, e-mail to: GRASS Development Mailing List (http://lists.osgeo.org/mailman/listinfo/grass-dev).

Edited by Marco Pasetti on 14 July 2008.