[e7839be] | 1 | <HTML><HEAD> |
---|
| 2 | <TITLE>Survex Hacker's Guide</TITLE> |
---|
| 3 | <STYLE type="text/css"><!-- |
---|
| 4 | BODY, TD, CENTER, UL, OL {font-family: sans-serif;} |
---|
| 5 | --> |
---|
| 6 | </STYLE> |
---|
| 7 | </HEAD><BODY BGCOLOR=white TEXT=black> |
---|
| 8 | <H1>Hacking Survex</H1> |
---|
| 9 | |
---|
| 10 | <p>(That's hacking in the "tinkering with code" sense, not in the |
---|
| 11 | "breaking into other people's computer systems" sense). |
---|
| 12 | |
---|
| 13 | <p>This is currently a random collection of notes that need to be written |
---|
| 14 | down while I remember. With time it should evolve into a more |
---|
| 15 | coherent document. If you have any questions which this should answer |
---|
| 16 | but doesn't then ask me and I'll add them. |
---|
| 17 | |
---|
| 18 | <H2>Network code debugging</H2> |
---|
| 19 | |
---|
| 20 | <P>You can pick which network simplifications are attempted using "-z" |
---|
| 21 | with an argument listing code letters. So: |
---|
| 22 | |
---|
| 23 | <ul> |
---|
| 24 | <li>-z= no special simplifications (articulation still performed) |
---|
| 25 | <li>-z=l remove "lollipops" |
---|
| 26 | <li>-z=p remove parallel legs |
---|
| 27 | <li>-z=d convert deltas to stars |
---|
| 28 | </ul> |
---|
| 29 | |
---|
| 30 | <P>And you can combine these in any combination: |
---|
| 31 | |
---|
| 32 | <ul> |
---|
| 33 | <li>-z=lp remove "lollipops" and parallel legs |
---|
| 34 | <li>-z=lpd remove "lollipops" and parallel legs; convert deltas to stars |
---|
| 35 | </ul> |
---|
| 36 | |
---|
| 37 | <P>"-z=lpd" is the default (in 0.99 at least - more transformations may |
---|
| 38 | conceivably be added in future, although the simple common cases are |
---|
| 39 | already covered). |
---|
| 40 | |
---|
| 41 | <H2>Developing on Unix Platforms</H2> |
---|
| 42 | |
---|
[b63c928d] | 43 | <P>You'll need automake 1.5 or later (earlier versions don't support |
---|
[27b8b59] | 44 | per-executable CFLAGS; 1.6 has been tested and works, but wasn't a |
---|
| 45 | very stable release - automake 1.6.1 is a better bet) |
---|
[9bf7aa33] | 46 | and autoconf 2.50 or later (autoconf 2.52, 2.53 and 2.64 have all |
---|
| 47 | been used successfully). |
---|
[c372fc9] | 48 | |
---|
| 49 | <P>For building the documentation you'll need sgmltools 2 or later, |
---|
[ecdfe80] | 50 | jadetex, docbook-utils, and w3m. |
---|
[e7839be] | 51 | |
---|
[29e5a96] | 52 | <P>And for building unifont.pixelfont, you'll need unifont installed. |
---|
| 53 | |
---|
| 54 | <P>On Debian, you can install the required packages using: |
---|
| 55 | |
---|
| 56 | <pre> |
---|
[ecdfe80] | 57 | sudo apt-get install autoconf automake inkscape netpbm sgmltools-lite jadetex docbook-utils w3m unifont |
---|
[29e5a96] | 58 | </pre> |
---|
[6127c82] | 59 | |
---|
[e7839be] | 60 | <H2>Building on Non-Unix Platforms</H2> |
---|
| 61 | |
---|
[c372fc9] | 62 | <H3>Mingw (Microsoft Windows)</H3> |
---|
[e7839be] | 63 | |
---|
| 64 | <P>Currently I build this with a Linux hosted cross-compiler. I use |
---|
[adceff5] | 65 | the packaged cross-compiler in the debian testing/unstable distribution: |
---|
| 66 | |
---|
[bd285e5a] | 67 | <pre> |
---|
| 68 | sudo apt-get install mingw-w64-i686-dev |
---|
| 69 | </pre> |
---|
[e7839be] | 70 | |
---|
[d6a770d] | 71 | <p> |
---|
| 72 | I then install the various libraries by compiling from source. For wxWidgets |
---|
[853438c] | 73 | 3.0.4, I apply a |
---|
| 74 | <a href="https://survex.com/software/wxWidgets-3.0.4.patch">patch</a> to |
---|
| 75 | disable a pointless and annoying compiler ABI check (with this check |
---|
| 76 | aven stops working each time my cross compiler package is upgraded to |
---|
| 77 | a new GCC version; without it everything works fine). |
---|
| 78 | </p> |
---|
| 79 | |
---|
| 80 | <p> |
---|
| 81 | Then I configure, build and install with: |
---|
[bd285e5a] | 82 | </p> |
---|
| 83 | |
---|
| 84 | <pre> |
---|
[853438c] | 85 | ./configure --prefix=/usr/i686-w64-mingw32 --host i686-w64-mingw32 --with-msw --with-opengl --enable-display --disable-shared host_alias=i686-w64-mingw32 |
---|
[bd285e5a] | 86 | make |
---|
| 87 | sudo make install |
---|
| 88 | </pre> |
---|
| 89 | |
---|
| 90 | <p> |
---|
| 91 | For PROJ 4.8.0: |
---|
[d6a770d] | 92 | </p> |
---|
| 93 | |
---|
[bd285e5a] | 94 | <pre> |
---|
| 95 | mkdir BUILD |
---|
| 96 | cd BUILD |
---|
| 97 | ../configure --prefix=/usr/i686-w64-mingw32 --host i686-w64-mingw32 --disable-shared host_alias=i686-w64-mingw32 |
---|
| 98 | make |
---|
| 99 | sudo make install |
---|
| 100 | </pre> |
---|
| 101 | |
---|
| 102 | <p> |
---|
| 103 | For libav 10.3: |
---|
| 104 | </p> |
---|
| 105 | |
---|
| 106 | <pre> |
---|
| 107 | sudo apt-get install yasm |
---|
| 108 | mkdir BUILD |
---|
| 109 | cd BUILD |
---|
[86801ff] | 110 | ../configure --prefix=/usr/i686-w64-mingw32 --cross-prefix=i686-w64-mingw32- --enable-cross-compile --target-os=mingw32 --arch=i686 --disable-shared --disable-decoders --disable-demuxers --disable-programs --disable-network --disable-bsfs --disable-protocols --disable-devices |
---|
[bd285e5a] | 111 | make |
---|
| 112 | sudo make install |
---|
| 113 | </pre> |
---|
[d6a770d] | 114 | |
---|
[e7839be] | 115 | <P>Building on Windows in a native mingw environment will probably |
---|
| 116 | require tinkering. Best bet is probably to install bash and use the |
---|
| 117 | current configure script. I'm happy to help if you want to try this, |
---|
| 118 | and I'll incorporate patches provided they're fairly clean. |
---|
| 119 | |
---|
[9fe7af4f] | 120 | <H2>Microsoft Windows Installer Builder</H2> |
---|
| 121 | |
---|
| 122 | <P>We use <A HREF="http://www.jrsoftware.org/isinfo.php">InnoSetup</A> to |
---|
[53b6a5a] | 123 | build the MS Windows Installer. Survex 1.2.23 was built using InnoSetup |
---|
| 124 | 5.5.6 (non-Unicode version, which apparently produces smaller installer |
---|
| 125 | packages). |
---|
[ebcdad9] | 126 | |
---|
| 127 | <P>Here are some random notes: |
---|
[9fe7af4f] | 128 | |
---|
[85f3565] | 129 | <H3>Packages Needed</H3> |
---|
| 130 | |
---|
[adceff5] | 131 | <P>On Debian, the commands to install wine vary depending on the architecture |
---|
| 132 | you're running - to check this use: |
---|
| 133 | |
---|
| 134 | <pre> |
---|
| 135 | dpkg-architecture -qDEB_HOST_GNU_CPU |
---|
| 136 | </pre> |
---|
| 137 | |
---|
| 138 | <H4>For i386</H4> |
---|
| 139 | |
---|
| 140 | <pre> |
---|
[8aebb0a] | 141 | sudo apt-get install wine wx3.0-i18n |
---|
[adceff5] | 142 | </pre> |
---|
| 143 | |
---|
| 144 | <H4>For x86_64</H4> |
---|
| 145 | |
---|
| 146 | <P>You'll need to enable multi-arch and install the i386 packages of wine: |
---|
| 147 | |
---|
| 148 | <pre> |
---|
| 149 | sudo dpkg --add-architecture i386 |
---|
| 150 | sudo apt-get update |
---|
[8aebb0a] | 151 | sudo apt-get install wine wine-bin:i386 wx3.0-i18n |
---|
[adceff5] | 152 | </pre> |
---|
| 153 | |
---|
| 154 | <H4>Common</H4> |
---|
| 155 | |
---|
| 156 | <P>And then run: |
---|
[85f3565] | 157 | |
---|
[adceff5] | 158 | <pre> |
---|
| 159 | wine ~/Downloads/isetup-5.5.3.exe |
---|
| 160 | </pre> |
---|
[85f3565] | 161 | |
---|
[9fe7af4f] | 162 | <H3>Translations</H3> |
---|
| 163 | |
---|
[ebcdad9] | 164 | <P>In addition to the translations included with InnoSetup as standard, we also |
---|
[8b3362b] | 165 | add these, which you can find in the <code>lib</code> subdirectory of Survex's |
---|
[e367554] | 166 | source tree: |
---|
[9fe7af4f] | 167 | |
---|
| 168 | <UL> |
---|
[adceff5] | 169 | <li>ChineseSimplified.isl (Unofficial translation; for 5.5.3+) |
---|
[352ad2a] | 170 | <li>ChineseTraditional.isl (Candidate official translation; for 5.5.3+) |
---|
| 171 | <li>EnglishBritish.isl (Unofficial translation; for 5.5.3+) |
---|
[adceff5] | 172 | <li>Indonesian.isl (Unofficial translation; for 5.5.3+) |
---|
| 173 | <li>Romanian.isl (Unofficial translation; for 5.5.3+) |
---|
| 174 | <li>Slovak.isl (Unofficial translation; for 5.5.3+) |
---|
[9fe7af4f] | 175 | </UL> |
---|
| 176 | |
---|
[317c11b] | 177 | These are taken from the innosetup repo at |
---|
| 178 | https://github.com/jrsoftware/issrc.git |
---|
| 179 | (look in the <code>Files/Languages/Unofficial</code> subdirectory). |
---|
| 180 | |
---|
[9fe7af4f] | 181 | <H3>survex.iss</H3> |
---|
| 182 | |
---|
| 183 | <P>This file is generated by configure (from the template survex.iss.in). |
---|
| 184 | We could instead have a static survex.iss which uses #include to pull in |
---|
| 185 | a file with the Survex version info in, but the current method works well |
---|
| 186 | enough so we'll stick with it for now (I suspect #include was introduced since |
---|
| 187 | we started using InnoSetup). |
---|
| 188 | |
---|
[e7839be] | 189 | </BODY></HTML> |
---|