Hacking Survex

(That's hacking in the "tinkering with code" sense, not in the "breaking into other people's computer systems" sense).

This is currently a random collection of notes that need to be written down while I remember. With time it should evolve into a more coherent document. If you have any questions which this should answer but doesn't then ask me and I'll add them.

Network code debugging

You can pick which network simplifications are attempted using "-z" with an argument listing code letters. So:

And you can combine these in any combination:

"-z=lpd" is the default (in 0.99 at least - more transformations may conceivably be added in future, although the simple common cases are already covered).

Developing on Unix Platforms

You'll need automake 1.5 or later (earlier versions don't support per-executable CFLAGS; 1.6 has been tested and works, but wasn't a very stable release - automake 1.6.1 is a better bet) and autoconf 2.50 or later (autoconf 2.52, 2.53 and 2.64 have all been used successfully).

For building the documentation you'll need sgmltools 2 or later, jadetex, docbook-to-man, and w3m.

And for building unifont.pixelfont, you'll need unifont installed.

On Debian, you can install the required packages using:

sudo apt-get install sgmltools-lite jadetex docbook-to-man w3m unifont

Building on Non-Unix Platforms

Mingw (Microsoft Windows)

Currently I build this with a Linux hosted cross-compiler. I use the packaged cross-compiler in the debian testing/unstable distribution:

sudo apt-get install mingw-w64-i686-dev

I then install the various libraries by compiling from source. For wxWidgets 3.0.1, I configure, build and install with:

./configure --prefix=/usr/i686-w64-mingw32 --host i686-w64-mingw32 --with-msw --with-opengl --enable-display --disable-threads --disable-shared host_alias=i686-w64-mingw32 --disable-tls
make
sudo make install

For PROJ 4.8.0:

mkdir BUILD
cd BUILD
../configure --prefix=/usr/i686-w64-mingw32 --host i686-w64-mingw32 --disable-shared host_alias=i686-w64-mingw32
make
sudo make install

For libav 10.3:

sudo apt-get install yasm
mkdir BUILD
cd BUILD
../configure --prefix=/usr/i686-w64-mingw32 --cross-prefix=i686-w64-mingw32 --enable-cross-compile --target-os=mingw32 --arch=i686 --disable-shared
make
sudo make install

Building on Windows in a native mingw environment will probably require tinkering. Best bet is probably to install bash and use the current configure script. I'm happy to help if you want to try this, and I'll incorporate patches provided they're fairly clean.

Microsoft Windows Installer Builder

We use InnoSetup to build the MS Windows Installer. Survex 1.2.8 was built using InnoSetup 5.5.3 (non-Unicode version, so that the installer works on older versions of Microsoft Windows).

Here are some random notes:

Packages Needed

On Debian, the commands to install wine vary depending on the architecture you're running - to check this use:

dpkg-architecture -qDEB_HOST_GNU_CPU

For i386

sudo apt-get install wine wx2.8-i18n

For x86_64

You'll need to enable multi-arch and install the i386 packages of wine:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine wine-bin:i386 wx2.8-i18n

Common

And then run:

wine ~/Downloads/isetup-5.5.3.exe

Translations

In addition to the translations included with InnoSetup as standard, we also add these, which you can find in the lib subdirectory of Xapian's source tree:

survex.iss

This file is generated by configure (from the template survex.iss.in). We could instead have a static survex.iss which uses #include to pull in a file with the Survex version info in, but the current method works well enough so we'll stick with it for now (I suspect #include was introduced since we started using InnoSetup).