| 5 |  | == Set up your build environment == | 
                      
                        |  | 5 | == Get the Pidgin source code == | 
                        |  | 6 | {{{ | 
                        |  | 7 | #!comment | 
                        |  | 8 | The source for Pidgin 3.x.y is available [http://prdownloads.sourceforge.net/pidgin/pidgin-3.x.y.tar.bz2 here] (use the latest release if this isn't updated yet).[[BR]][[BR]] | 
                        |  | 9 | }}} | 
                        |  | 10 | The 3.0.0 branch isn't released yet, so there are no source packages for this at the moment.[[BR]][[BR]] | 
                        |  | 11 | The development source is available via mercurial. See [wiki:UsingPidginMercurial] for more information. | 
                        |  | 12 |  | 
                        |  | 13 |  | 
                        |  | 14 | == Cross Compiling (the easy way) == | 
                        |  | 15 | It is quite easy to cross compile Pidgin for Windows on a Linux machine. | 
                        |  | 16 |  | 
                        |  | 17 | To begin, you'll need to install MinGW. On !Debian/Ubuntu, this involves installing packages `mingw32`, `mingw32-binutils`, `mingw32-runtime`, `mingw32-cross-pkg-config`. On other distributions, the packages may be named differently. | 
                        |  | 18 |  | 
                        |  | 19 | When compiling from hg, you'll need to generate `configure` script: | 
                        |  | 20 | {{{ | 
                        |  | 21 | NOCONFIGURE=indeed ./autogen.sh | 
                        |  | 22 | }}} | 
                        |  | 23 |  | 
                        |  | 24 | Set up pkgconfig (this may vary, depending on Linux distribution): | 
                        |  | 25 | {{{ | 
                        |  | 26 | export PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:\ | 
                        |  | 27 | /usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig | 
                        |  | 28 | export PKG_CONFIG=/usr/bin/i686-w64-mingw32-pkg-config | 
                        |  | 29 | }}} | 
                        |  | 30 |  | 
                        |  | 31 | Run configure with cross-compile option. You may choose FHS or classic directory layout (default is classic). For now (when installer is missing), FHS will be easier to install and run. Then - build it. | 
                        |  | 32 | {{{ | 
                        |  | 33 | ./configure --host=i686-w64-mingw32 --with-win32-dirs=<fhs|classic> | 
                        |  | 34 | make | 
                        |  | 35 | }}} | 
                        |  | 36 |  | 
                        |  | 37 | At last, install Pidgin, Finch and its dependencies. | 
                        |  | 38 | {{{ | 
                        |  | 39 | make DESTDIR=/path/to/install-dir install | 
                        |  | 40 | cd /path/to/install-dir | 
                        |  | 41 | cd usr/local # it may depend on your configured $prefix | 
                        |  | 42 | wget https://pidgin.im/~twasilczyk/win32/gtk-runtime-2.24.18.0.zip | 
                        |  | 43 | unzip gtk-runtime-2.24.18.0.zip | 
                        |  | 44 | cp -r Gtk/* . | 
                        |  | 45 | rm -rf Gtk gtk-runtime-2.24.18.0.zip | 
                        |  | 46 | }}} | 
                        |  | 47 |  | 
                        |  | 48 |  | 
                        |  | 49 | == Compiling directly on Windows with Cygwin (the hard way) == | 
                        |  | 50 |  | 
                        |  | 51 | This method was used for 2.x.y branch and most probably will be dropped, when cross-compilation was fully functional (including the installer). | 
                        |  | 52 |  | 
                        |  | 53 | === Set up your build environment === | 
            
                  
                          | 112 |  |  | 
                          | 113 |  |  | 
                          | 114 |  | {{{ | 
                          | 115 |  | #!comment | 
                          | 116 |  | == Cross Compiling == | 
                          | 117 |  |   It is quite easy to cross compile Pidgin for Windows on a Linux machine. | 
                          | 118 |  |  | 
                          | 119 |  |   To begin, you'll need to install MinGW. On !Debian/Ubuntu, this involves installing packages `mingw32`, `mingw32-binutils`, and `mingw32-runtime`. On other distributions, the packages may be named differently. | 
                          | 120 |  |  | 
                          | 121 |  |   Set up a build environment as described [#Themanualway above], skipping steps 1 and 3. | 
                          | 122 |  |  | 
                          | 123 |  |   Create a `local.mak` file in the source directory root to override the Makefile variables - mine looks like this: | 
                          | 124 |  | {{{ | 
                          | 125 |  | SHELL := /bin/bash | 
                          | 126 |  | CC := /usr/bin/i586-mingw32msvc-cc | 
                          | 127 |  | GMSGFMT := msgfmt | 
                          | 128 |  | MAKENSIS := /usr/bin/makensis | 
                          | 129 |  | WINDRES := /usr/bin/i586-mingw32msvc-windres | 
                          | 130 |  | STRIP := /usr/bin/i586-mingw32msvc-strip | 
                          | 131 |  | INTLTOOL_MERGE := /usr/bin/intltool-merge | 
                          | 132 |  |  | 
                          | 133 |  | INCLUDE_PATHS := -I$(PIDGIN_TREE_TOP)/../win32-dev/w32api/include | 
                          | 134 |  | LIB_PATHS := -L$(PIDGIN_TREE_TOP)/../win32-dev/w32api/lib | 
                          | 135 |  | }}} | 
                          | 136 |  |  | 
                          | 137 |  |   If your distribution doesn't include a recent enough win32api, you can download it from the [http://www.mingw.org/ MinGW site], extract it into your `win32-dev` directory, and override the `INCLUDE_PATHS` and `LIB_PATHS` variables in your `local.mak` as I have done. | 
                          | 138 |  |  | 
                          | 139 |  |       NSIS version 2.46 or greater is required to cross-compile.  If compiling NSIS from source, the [http://www.scons.org/ scons] package is a dependency.  This can usually be installed through your linux distribution's package archive.  An example of how to install the NSIS package is given below (Assuming use of the NSIS 2.46 version): | 
                          | 140 |  |  | 
                          | 141 |  |       `.tar.bz2` file contains latest source[[BR]] | 
                          | 142 |  |       `.zip` file contains libraries | 
                          | 143 |  | {{{ | 
                          | 144 |  | #!sh | 
                          | 145 |  | mkdir nsis; cd nsis | 
                          | 146 |  | wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-src.tar.bz2?download  | 
                          | 147 |  | wget http://prdownloads.sourceforge.net/nsis/nsis-2.46.zip?download | 
                          | 148 |  | tar -jxvf nsis-2.46-src.tar.bz2 | 
                          | 149 |  | cd nsis-2.46 | 
                          | 150 |  | scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no | 
                          | 151 |  | sudo scons install-compiler | 
                          | 152 |  | cd .. | 
                          | 153 |  | sudo unzip nsis-2.46 -d /usr/local/share | 
                          | 154 |  | sudo mv /usr/local/share/nsis-2.46/ /usr/local/share/nsis  | 
                          | 155 |  | }}} | 
                          | 156 |  |       If following the above instructions, the local.mak file ([#CrossCompiling listed above]) should be modified[[BR]] | 
                          | 157 |  | {{{ | 
                          | 158 |  | MAKENSIS := /usr/local/bin/makensis | 
                          | 159 |  | }}} | 
                          | 160 |  |  | 
                          | 161 |  |  | 
                          | 162 |  |   Once this is all set up, you should be able to follow the [#BuildPidgin building instructions above]. | 
                          | 163 |  | }}} |