Version 126 (modified by 12 years ago) (diff) | ,
---|
Pidgin for Windows Build Instructions
Note: The instructions for versions prior to 2.7.0 are found here.
Set up your build environment
- Install the Cygwin Bash shell.
Also make sure you install bash, bzip2, coreutils, libiconv, gawk, grep, gzip, make, monotone, patch, sed, tar, unzip, wget, and zip (several of these are selected by default, those in bold are not).
You may prefer to use the native Windows monotone binary (available here), and/or MSYS instead of Cygwin.
- The following instructions were written under the assumption that the Pidgin source will be extracted or checked out into
$PIDGIN_DEV_ROOT/pidgin-<version>
and that you install all of Pidgin's build dependencies under$PIDGIN_DEV_ROOT/win32-dev
(the point being that the pidgin source root andwin32-dev
directories should be on the same level). Some users may find the instructions for customizing their build environment useful.
You don't have to actually define an environment variable called
PIDGIN_DEV_ROOT
, it is simply used here as a placeholder.
Note: You should avoid using a
$PIDGIN_DEV_ROOT
path that contains spaces as that can cause unnecessary complications.
People are sometimes confused about the directory structure, so here is an example structure after all the dependencies have been installed (
$PIDGIN_DEV_ROOT
isc:\devel\pidgin-devel
in this example):c:\devel\pidgin-devel (The following is the source tree root, containing config.h.mingw and libpurple.) c:\devel\pidgin-devel\pidgin-<version> c:\devel\pidgin-devel\win32-dev (If the following file is present, your structure is probably correct.) c:\devel\pidgin-devel\win32-dev\gtk_2_0-2.14\include\libintl.h
- Install the MinGW "GCC Version 4.4.0" packages from the MinGW site.
- There isn't an installer for these; the following instructions have distilled from the MinGW manual instructions
- There are known issues with newer gcc versions; be sure to use the version as described below
- Create a
win32-dev/mingw
directory and download the following into it:- binutils-2.20
- mingw-runtime 3.17 (dev and dll)
- w32-api 3.14
- Required runtime libraries for GCC (gmp 4.2.4, libiconv 1.13.1, MPFR 2.4.1 and pthreads 2.8.0)
- gcc-core 4.4.0 (bin and dll)
- Extract all of the above downloaded files directly into the
win32-dev/mingw
directory. - You will need to set MinGW's bin directory before Cygwin's in your
PATH
.
For Example (You should add the following to your~/.bashrc
file, which is found in \cygwin\home\YourUsername?\):If your Pidgin folder is inside Cygwin's, it should look more like this:export PATH=/cygdrive/c/devel/pidgin-devel/win32-dev/mingw/bin:$PATH
export PATH=/pidgin-devel/win32-dev/mingw/bin:$PATH
Install Pidgin's build dependencies
GTK+
Pidgin depends on GTK+ 2.14.7 (newer runtime versions can be used). The GTK+ All-in-one bundle contains all of GTK+'s dependencies in one zip file. Download gtk+-bundle_2.14.7-20090119_win32.zip and extract to
$PIDGIN_DEV_ROOT/win32-dev/gtk_2_0-2.14
(you'll need to create this directory).
Visit the GTK+ website for official binary and source releases.
gettext
You'll need gettext to compile translations. Download gettext-tools-0.17.zip and gettext-runtime-0.17-1.zip. Extract both to
$PIDGIN_DEV_ROOT/win32-dev/gettext-0.17
(you'll need to create this directory).
Libxml2
Download libxml2-dev_2.7.4-1_win32.zip and libxml2_2.7.4-1_win32.zip. Extract both to
$PIDGIN_DEV_ROOT/win32-dev/libxml2-2.7.4
(you'll need to create this directory).
Perl 5.10
Install Perl 5.10 (I use ActivePerl), and make sure it is in your
PATH
. If 'perl' isn't in yourPATH
then you will need to override thePERL
variable inpidgin/local.mak
. You will also need to download perl_5-10-0.tar.gz and extract to$PIDGIN_DEV_ROOT/win32-dev
(it creates its own directory). This contains headers and an import lib for mingw gcc.
- Note: If using MSYS and you installed the
mingw-developer-toolkit
, keep in mind that it installsmsys-perl-bin
(Perl 5.6) which takes precedence over the (5.10 or newer) perl in your path, and that will cause problems! You will need to do one of the following:- Remove the mingw-developer-toolkit supplied (older) perl (but MAKE SURE you have mingw-get-0.2-mingw32-alpha-3 or later as previous version had issue with unlink'ing/deleting files):
mingw-get remove msys-perl-bin
- or Set your ActivePerl 5.10 installation location at the beginning of the Cygwin-specific
PATH
. Assuming it is installed inc:\Perl
, put something like this in your~/.bashrc
:export PATH=/cygdrive/c/Perl/bin:$PATH
- Remove the mingw-developer-toolkit supplied (older) perl (but MAKE SURE you have mingw-get-0.2-mingw32-alpha-3 or later as previous version had issue with unlink'ing/deleting files):
Tcl 8.4.5
Download and extract tcl-8.4.5.tar.gz to
$PIDGIN_DEV_ROOT/win32-dev
GtkSpell
- Download and extract gtkspell-2.0.16.tar.bz2 to
$PIDGIN_DEV_ROOT/win32-dev
Enchant
- Download and extract enchant_1.6.0_win32.zip to
$PIDGIN_DEV_ROOT/win32-dev/
(older versions: 1.5.0)
Mozilla NSS
- Download and extract nss-3.12.5-nspr-4.8.2.tar.gz under
$PIDGIN_DEV_ROOT/win32-dev
.- Note: NSS/NSPR are built from the upstream sources using these instructions.
SILC Toolkit
Download and extract silc-toolkit-1.1.8.tar.gz to
$PIDGIN_DEV_ROOT/win32-dev
.
Meanwhile
Download and extract meanwhile-1.0.2_daa2-win32.zip to
$PIDGIN_DEV_ROOT/win32-dev
.
Bonjour SDK
Download the
Bonjour SDK for Windows
from the Apple developer website and install it to$PIDGIN_DEV_ROOT/win32-dev/Bonjour_SDK
.
Note: Bonjour SDK version 2.0.0 or newer is needed as of Pidgin 2.7.4
Note2: The Bonjour SDK may install to its default location (
Program Files\Bonjour SDK
) regardless what you have specified during installation. In that case, simply copy everything fromProgram Files\Bonjour SDK
to$PIDGIN_DEV_ROOT/win32-dev/Bonjour_SDK
.
Cyrus SASL
Download and extract cyrus-sasl-2.1.22-daa1.zip to
$PIDGIN_DEV_ROOT/win32-dev
.
(this also contains the MIT GSSAPI module)
Intltool
Download and extract intltool_0.40.4-1_win32.zip to
$PIDGIN_DEV_ROOT/win32-dev/intltool_0.40.4-1_win32
Crash Reporting Library
Download and extract pidgin-inst-deps-20100315.tar.gz to
$PIDGIN_DEV_ROOT/win32-dev
.
Get the Pidgin source code
The source for Pidgin 2.10.3 is available here (use the latest release if this isn't updated yet).
The development source is available via monotone. See UsingPidginMonotone for more information.
Build Pidgin
First, make absolutely sure you have the GCC installer version 4.4.0 installed -- newer versions will cause the long build process to fail. You can do this by typing
gcc --version
Second, you'll have to edit the (current) Pidgin makefile, because there's a silly flag buried in it that WILL cause your makefile to break. In your Pidgin folder (e.g. /pidgin-devel/pidgin-xxxx/libpurple/win32/global.mak), remove the "-mno-cygwin" flag, leaving your build file like this:
CFLAGS += -O2 -Wall $(GCCWARNINGS) -pipe -mms-bitfields -gIf you don't remove that silly flag, you'll get build errors about halfway through. (It looks like the flag was deprecated about 5-10 years ago anyway.)
Run the following:
cd $PIDGIN_DEV_ROOT/pidgin-<version> make -f Makefile.mingw installNow just wait and let your compiler do its thing. When finished, Pidgin will be in
$PIDGIN_DEV_ROOT/pidgin-<version>/win32-install-dir
.
Build the Pidgin Installer
- If you want to build the Pidgin installer, do the following (skip to the
make
command below if you chose to use the Build Environment Fetcher):- Download and install NSIS. Include NSIS to Cygwin's
PATH
.- For information on the NSIS installer, visit the NSIS website.
- For information on the NSIS installer, visit the NSIS website.
- Download the nsisunz plugin, and extract
nsisunz.dll
into thePlugins
directory of your NSIS installation. - If you are building the installer from a unix-style shell (like the MinGW shell), the options format must be set accordingly. Make sure there is a
pidgin/local.mak
file containing the line:MAKENSISOPT := -
- Download and install NSIS. Include NSIS to Cygwin's
- Now you can actually build the installer.
There are 2 different installers, an "Offline" installer that includes all dependencies (except spellchecking dictionaries) and the debug symbols and an "Online" installer that includes only Pidgin itself and will download the various dependencies if necessary. TheMakefile.mingw
targets for these areinstaller_offline
, andinstaller
respectively. To build both, use theinstallers
target.When it finishes, your installer(s) should be incd $PIDGIN_DEV_ROOT/pidgin-<version> make -f Makefile.mingw installers
$PIDGIN_DEV_ROOT/pidgin-<version>/
.
Customizing the Build Environment
Most people will find that the standard build environment directory is completely adequate. It is, however, possible to override the locations of the various dependencies and target directories. This is often useful to test against a development version of a library dependency or to override compiler flags.
This done is by overriding the various Makefile variables in a
local.mak
file in the$PIDGIN_DEV_ROOT/pidgin-<version>
directory. This file does not exist by default.
Most of the variables that can be overridden with this method are defined in the libpurple/win32/global.mak file. For example, to install Pidgin over
c:\Program Files\Pidgin
instead of$PIDGIN_DEV_ROOT/pidgin/win32-install-dir
, create a$PIDGIN_DEV_ROOT/pidgin/local.mak
containing:#Override the install location PIDGIN_INSTALL_DIR = /cygdrive/c/Program\ Files/Pidgin PURPLE_INSTALL_DIR = /cygdrive/c/Program\ Files/Pidgin
One nice use of the
local.mak
file is for cross compiling, there is an additional example in the section below.
Debugging
There is a quite good Just In Time debugger for MinGW: drmingw. You can download it here.
There is also a version ofgdb
available from MinGW, if you prefer.
Cross Compiling
It is quite easy to cross compile Pidgin for Windows on a Linux machine.
To begin, you'll need to install MinGW. On Debian/Ubuntu?, this involves installing packages
mingw32
,mingw32-binutils
, andmingw32-runtime
. On other distributions, the packages may be named differently.
Set up a build environment as described above, skipping steps 1 and 3.
Create a
local.mak
file in the source directory root to override the Makefile variables - mine looks like this:SHELL := /bin/bash CC := /usr/bin/i586-mingw32msvc-cc GMSGFMT := msgfmt MAKENSIS := /usr/bin/makensis MAKENSISOPT := - WINDRES := /usr/bin/i586-mingw32msvc-windres STRIP := /usr/bin/i586-mingw32msvc-strip INTLTOOL_MERGE := /usr/bin/intltool-merge INCLUDE_PATHS := -I$(PIDGIN_TREE_TOP)/../win32-dev/w32api/include LIB_PATHS := -L$(PIDGIN_TREE_TOP)/../win32-dev/w32api/lib
If your distribution doesn't include a recent enough win32api, you can download it from the MinGW site, extract it into your
win32-dev
directory, and override theINCLUDE_PATHS
andLIB_PATHS
variables in yourlocal.mak
as I have done.
NSIS version 2.46 or greater is required to cross-compile. If compiling NSIS from source, the 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):
.tar.bz2
file contains latest source
.zip
file contains librariesmkdir nsis; cd nsis wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-src.tar.bz2?download wget http://prdownloads.sourceforge.net/nsis/nsis-2.46.zip?download tar -jxvf nsis-2.46-src.tar.bz2 cd nsis-2.46 scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no sudo scons install-compiler cd .. sudo unzip nsis-2.46 -d /usr/local/share sudo mv /usr/local/share/nsis-2.46/ /usr/local/share/nsisIf following the above instructions, the local.mak file (listed above) should be modified
MAKENSIS := /usr/local/bin/makensis
Once this is all set up, you should be able to follow the building instructions above.