Creating a static distribution of GNUe
--------------------------------------

This file details how to build a static distribution of GNUe (with
dependencies) that can be tar'ed up and redistributed. The author
of this file is no expert on static distributions by any means. If
you know of a better way (or more correct way) of doing things listed
here, or if you find a major dependency that was not accounted for,
please email info@gnue.org.

This was tested on a Debian woody system. This sequence of events
should work on any POSIX system with GNU make and gcc/g++.


The following dependencies will be statically installed into /usr/local/gnue:

  wxGTK-2.3.2
  wxPython-2.3.2.1
  postgresql-7.2.1 (client libs only)
  mysql-3.23.49 (client libs only)
  egenix-mx-base-2.0.3.tar.gz
  MySQL-python-0.9.1
  psycopg-1.0.7.1

  (*) These dependencies provide the GNUe side of the requirements. However,
      other, non-free, libraries will need to be installed in order for these
      libraries to be usable by GNUe.


NOTE: All commands below will need to be run as root

Preparation
-----------
$ mkdir /usr/local/gnue
$ mkdir /usr/local/gnue/bin


Python installation
-------------------
$ tar -xzf Python-2.1.3.tgz
$ cd Python-2.1.3
$ ./configure --disable-shared --enable-static \
              --prefix=/usr/local/gnue/dependencies
$ make && make install
$ ln -s /usr/local/gnue/dependencies/bin/python2.1 \
        /usr/local/gnue/bin/gnue-python


wxGTK installation
------------------
$ tar -xzf wxGTK-2.3.2.tar.gz
$ cd wxGTK-2.3.2
$ ./configure --prefix=/usr/local/gnue/dependencies \
              --disable-shared --enable-static


wxPython installation
---------------------
$ tar -xzf wxPython-2.3.2.tar.gz
$ cd wxPython-2.3.2

Next, edit setup.py and change the following lines:

 BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension module
 BUILD_OGL = 0      # If true, build the contrib/ogl extension module
 BUILD_STC = 1      # If true, build the contrib/stc extension module
 BUILD_XRC = 0      # XML based resource system
 BUILD_GIZMOS = 0   # Build a module for the gizmos contrib library
 BUILD_DLLWIDGET = 0# Build a module for the gizmos contrib library

 (***Note that BUILD_STC=1)

Also, change:

 WX_CONFIG = "/usr/local/gnue/dependencies/bin/wx-config"

And, while you are at it, complain to the distutils people that
these kinds of options have to be hard-coded!!

Save this file, then continue:

$ /usr/local/gnue/bin/gnue-python ./setup.py build
$ /usr/local/gnue/bin/gnue-python ./setup.py install



MySQL installation
------------------
$ ./configure --prefix=/usr/local/gnue/dependencies --without-server \
              --with-client-ldflags=-all-static
$ make && make install



PostgreSQL installation
-----------------------
$ ./configure --prefix=/usr/local/gnue/dependencies --disable-shared
$ cd src/interfaces/libpq++
$ make && make install
$ cd ../libpq
$ make && make install
$ cd ../../include
$ make install




egenix-mx-base installation
---------------------------
$ tar -xzf egenix-mx-base-2.0.3.tar.gz
$ cd egenix-mx-base-2.0.3
$ /usr/local/gnue/bin/gnue-python setup.py install



psycopg isntallation
--------------------
$ tar -xzf psycopg-1.0.7.1.tar.gz
$ cd psycopg-1.0.7.1
$ ./configure --with-python=/usr/local/gnue/bin/gnue-python \
              --prefix=/usr/local/gnue/dependencies \
              --with-postgres-includes=/usr/local/gnue/dependencies/include \
              --with-postgres-libraries=/usr/local/gnue/dependencies/lib \
              --with-mxdatetime-includes=/usr/local/gnue/dependencies/lib/python2.1/site-packages/mx/DateTime/mxDateTime
$ make && make install

MySQL-python installation
-------------------------
$ tar -xzf MySQL-python-0.9.1.tar.gz
$ cd MySQL-python-0.9.1

Edit setup.py and change the following lines:

  if sys.platform in ("linux-i386", "linux2"): # most Linux
      include_dirs = ['/usr/include/mysql']
      library_dirs = ['/usr/lib/mysql']
      libraries = [mysqlclient, "z"]
      runtime_library_dirs = []
      extra_objects = []

to:

  if sys.platform in ("linux-i386", "linux2"): # most Linux
      include_dirs = ['/usr/local/gnue/dependencies/include/mysql']
      library_dirs = ['/usr/local/gnue/dependencies/lib/mysql']
      libraries = [mysqlclient]
      runtime_library_dirs = []
      extra_objects = []

And, while you are at it, complain to the distutils people that
these kinds of options have to be hard-coded!!

$ /usr/local/gnue/bin/gnue-python setup.py install


Building the distribution
-------------------------
$ cd /usr/local/gnue/dependencies
$ rm -rf man
$ cd /
$ tar -czf gnue-linux-0.3.0.tar.gz usr/local/gnue


