Windows
Note: These instructions are kept current for the development version of
release-2.x.y branch of Pidgin. You may need to look at an older version of
this page in order to build a released version of Pidgin. Alternatively, you
may need the instructions for 3.0.0 branch.
Set up your build environment
Install A Bash Shell
The Pidgin build system requires a full Unix shell to run. You can install Cygwin or MSYS2 to accomplish this. However, these instructions are heavily geared towards Cygwin so MSYS steps may be different and/or missing all together.
Alternatively, you may use the third-party script Pidgin Windev, which creates the development environment automatically. This tool works for both Cygwin and MSYS2.
Cygwin
When installing Cygwin you will be asked which additional packages you would like to install. You need to make sure that the following packages are installed. Some of these are selected by default, but the ones in bold are not installed by default.
- bash
- bzip2
- ca-certificates
- coreutils
- gawk
- gnupg
- grep
- gzip
- libiconv
- make
- patch
- sed
- tar
- unzip
- wget
- zip
MSYS2
After installing MSYS2, you’ll need to make sure that you have all the base dependencies installed as well. You can do that with the following command:
Setup
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 and win32-dev directories should be on the same level). Similar to the example below:
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.
Customizing
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 is done 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.
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:
One nice use of the local.mak file is for cross compiling, there is an
additional example in the [#cross-compiling section below].
Get the Pidgin source code
The development source is available via Mercurial in the release-2.x.y
branch.
If you want to build a release tarball, the instructions in the rest of this document should work for you, however they are written for the most recent 2.x.y release so there may be issues with older versions.
Build Dependencies
Compiler
Installing all of the build dependencies can be tedious, so you may want to check out Pidgin Windev which will automate it.
Install the MinGW “GCC Version 4.7.2” packages from the MinGW site by following their instructions.
Download the following:
- binutils-2.24
- mingw-runtime-3.20 (dev and dll)
- w32api-3.17
- Required runtime libraries for GCC:
- mpc-0.8.1-1 (dev and dll)
- mpfr-2.4.1-1 (dev and dll)
- gmp-5.0.1-1 (dev and dll)
- pthreads-2.9.0-pre-20110507-2 (dev and dll)
- iconv (dev and dll)
- intl-0.18.1.1-2
- gomp-4.7.2-1
- ssp-4.7.2-1
- quadmath-4.7.2-1
- gcc-core-4.7.2-1 (bin and dev and dll)
- gcc-4.7.2-1-mingw32-src
- so we can distribute the libssp source since we distribute the binary
Extract all of the above into the desired location (e.g.
$PIDGIN_DEV_ROOT/win32-dev/mingw-4.7.2)
Prepare a libssp-src.tar.gz file containing the libssp sources and licenses:
Finally, set the MinGW gcc’s bin directory to be before Cygwin’s in your
PATH.
For example (You should add the following to your ~/.bashrc file, which is
found in C:\cygwin\home\YourUsername\ by default):
Installing
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 and extract
libxml2-2.9.2_daa1.tar.gz
to $PIDGIN_DEV_ROOT/win32-dev.
Perl 5.20
You’ll need a functioning perl 5.20.x runtime (if the perl executable isn’t in
your PATH, you will need to override the PERL variable in
pidgin/local.mak to point to the appropriate perl executable). A good option
is Strawberry Perl.
Download the
perl-5.20.1.1.tar.gz
development package and extract to $PIDGIN_DEV_ROOT/win32-dev (it creates its
own directory). This is a subset of the full 32-bit strawberry perl zip
containing just the headers, import lib, and source for perl.
Note If using MSYS and you installed the mingw-developer-toolkit, keep
in mind that it installs msys-perl-bin (Perl 5.6) which takes precedence
over the newer perl in your path, and that will cause problems! The easiest
solution is to set the PERL variable in your pidgin/local.mak to point to
the right perl.exe.
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/.
Mozilla NSS
Download and extract
nss-3.24-nspr-4.12.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.12.tar.gz
to $PIDGIN_DEV_ROOT/win32-dev.
Meanwhile
Download and extract
meanwhile-1.0.2_daa3-win32.zip
to $PIDGIN_DEV_ROOT/win32-dev.
Cyrus SASL
Download and extract
cyrus-sasl-2.1.26_daa1.tar.gz
to $PIDGIN_DEV_ROOT/win32-dev.
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-20130214.tar.gz
to $PIDGIN_DEV_ROOT/win32-dev.
Build
Building Pidgin
The Windows build will take a while, but you can start it with the following command:
Now just wait and let your compiler do its thing. When finished, Pidgin will
be in $PIDGIN_DEV_ROOT/pidgin-<version>/win32-install-dir.
Building the Installer
If you would like to build the Pidgin installer, you’ll need to setup
NSIS. Once you have installed
NSIS, please make sure that it is in your shell’s PATH. Note if you’re
building with msys2 do not use the version available in pacman. There are
multiple issues with it including that executables produced by it will not be
able to run if Mandatory ASLR is enabled.
Next you’ll need to download a few plugins and put them into the
Plugins/x86-unicode folder of your NSIS install.
Finally, you’ll need to decide if you would like to sign the executables though this is not necessary for personal use.
To sign the executables, you need to get an appropriate code signing
certificate and then install
osslsigncode. If you’re using
msys2 this can be installed with pacman -S mingw-w64-i686-osslsigncode.
In your local.mak file (see customizing above), define the
OSSLSIGNCODE variable to the fully qualified path to the signcode
executable. You’ll also need to assign the SIGNCODE_SPC and
SIGNCODE_PVK variables to the appropriate files in your certificate. If you
just have a pfx file, you’ll need to extract the certificate and key to the
spc and pvk files. You can find documentation to do so
here.
Also, you’ll need a PGP key to add pgp signatures to the files. GnuPG is the primary PGP client most people use. You can read more here.
Once you have everything setup your local.mak should look something like the
following:
If you aren’t going to be signing anything, your local.mak should look like
the following:
At this point, you can finally build the installer. However, there are actually two 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.
The Makefile.mingw targets for these are installer_offline and installer
respectively. You can build both with the installers target.
When it finishes, your installer(s) should be in
$PIDGIN_DEV_ROOT/pidgin-<version>/ directory.
Debugging
There is a quite good Just In Time debugger for MinGW named drmingw. You can download it from their releases.
There is also a version of gdb 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, and mingw32-runtime. On
other distributions, the packages may be named differently.
Set up a build environment as described above. You should already have a bash shell and have just installed the mingw compiler.
Create a local.mak file in the source directory root to override the
Makefile variables, something like the following:
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 the INCLUDE_PATHS and LIB_PATHS
variables in your local.mak as shown above.
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).
Once this is done, you’ll need to update local.mak to point to the new NSIS
location:
Finally, you should be able to follow the build instructions above.