Trac is being migrated to new services! Issues can be found in our new YouTrack instance and WIKI pages can be found on our website.

Version 2 (modified by datallah, 14 years ago) (diff)

Add note/link about building Pre 2.7.0 versions

Pidgin for Windows Build Instructions

Note: The instructions for versions prior to 2.7.0 are found here.

Set up your build environment

The easy way

  1. Install the Cygwin Bash shell. Make sure to select Unix file mode during setup. Also make sure you install bash, bzip2, coreutils, gawk, grep, gzip, make, monotone, patch, sed, tar, unzip, wget, and zip (several of these are selected by default, those in bold are not). Be sure to add Cygwin versions of any programs you may use that require Cygwin path names (for example, if you want to use vim to edit monotone commit messages, you need to install the Cygwin version of vim -- native Win32 vim will be unable to read Cygwin-style paths).
    You may prefer to use the native Windows monotone binary available here.
  1. Download the Build Environment Fetcher script. Follow the instructions on the website to fetch and install most of the needed build dependencies. The script can fetch Pidgin's source code distribution; you will be prompted to choose which version you'd like to use.
    Note that this script is occasionally out of date, especially immediately following releases, in which case you will need to perform some of the manual steps in addition. The ChangeLog may clue you into which dependencies have changed.
  1. Skip the The manual way, Install Pidgin's build dependencies, and Get the Pidgin source code sections and go straight to Build Pidgin.

The manual way

  1. Install the Cygwin Bash shell. Also make sure you install bash, bzip2, coreutils, 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.
  1. Install the MinGW "current" packages from the MinGW site.
    The easiest way to install these is to use the Automated MinGW Installer.
    Specifically, you will need gcc-core 3.4.2, binutils 2.15.91, mingw-runtime 3.9 and win32api 3.9 (or newer).
    You will need to set MinGW's bin directory before Cygwin's in your PATH.
    For Example (You can add the following to your ~/.bashrc file (create the file if it doesn't exist yet)):
      export PATH=/cygdrive/c/MinGW/bin:$PATH
    
    You do not want to use any of Cygwin's build tools, with one exception; you need to use Cygwin's make utility. If typing which make produces MinGW's make utility, then just rename the make.exe in the MinGW bin directory to something else so that cygwin's make utility will be used instead. This shouldn't be a problem with recent versions of MinGW.
  1. 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). 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 is c:/development/pidgin_dev in this example):

C:\development\pidgin_dev
(The following is the source tree root, containing config.h.mingw and libpurple.)
C:\development\pidgin_dev\pidgin-<version>
C:\development\pidgin_dev\win32-dev
(If the following file is present, your structure is probably correct.)
C:\development\pidgin_dev\win32-dev\gtk_2_0\include\libintl.h

Install Pidgin's build dependencies

GTK+

Pidgin depends on GTK+ 2.6.10 (newer runtime versions can be used, but building against newer headers will prevent Win98/ME compatibility). For your convenience, we have included all of GTK's dependencies in one tarball. Extract gtk-dev-2.6.10-rev-a.tar.gz within $PIDGIN_DEV_ROOT/win32-dev.
If you wish to run Pidgin from the win32-install-dir directory once it is built, you will need to make sure that you have installed the GTK+ runtime, and make sure that its bin dir is in your PATH.
Visit the GTK+ website for official binary and source releases.

Libxml2

Download and extract libxml2-2.6.30.tar.gz to win32-dev. (older version: 2.6.24)

Perl 5.10

Install Perl 5.10 for Windows (I use ActivePerl), to C:\Perl. If you install Perl anywhere else, you will need to override the PERL and EXTUTILS variables in your pidgin/local.mak file. You will also need to install perl_5-10-0.tar.gz under $PIDGIN_DEV_ROOT/win32-dev (Containing headers and import lib for mingw gcc). (Pidgin 2.4.3 and prior require an older version: perl582.tar.gz)

Tcl 8.4.5

Download and extract tcl-8.4.5.tar.gz to win32-dev

GtkSpell / Aspell

Mozilla NSS

SILC Toolkit

Download and extract silc-toolkit-1.1.8.tar.gz to win32-dev. (older versions: 1.0.2, 1.1.2, 1.1.5, 1.1.7)

Meanwhile

Download and extract meanwhile-1.0.2_daa2-win32.zip to win32-dev. (older versions: 1.0.2, 1.0.2_daa1)

Bonjour SDK

Download the Bonjour SDK for Windows from the Apple developer website and install it to win32-dev/Bonjour_SDK.

Cyrus SASL

Download and extract cyrus-sasl-2.1.22-daa1.zip to win32-dev. (older version: cyrus-sasl-2.1.22.zip)
(this also contains the MIT GSSAPI module)

Get the Pidgin source code

The source for Pidgin 2.6.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

Run the following:

$ cd $PIDGIN_DEV_ROOT/pidgin-<version>
$ make -f Makefile.mingw install

Now 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 your PATH. For information on the NSIS installer, visit the NSIS website.
      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 libraries

$ mkdir 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/nsis 

If following the above instructions, the local.mak file (listed below) should be modified
MAKENSIS := /usr/local/bin/makensis

  • Now you can actually build the installer.
    There are 3 different installers: "Normal" (with GTK+), "No GTK+" and "Debug". The Makefile targets for these are installer, installer_nogtk, and installer_debug respectively. To build all 3, use the installers target.
    $ cd $PIDGIN_DEV_ROOT/pidgin-<version>
    $ make -f Makefile.mingw installers
    
    When it finishes, your installer(s) should be in $PIDGIN_DEV_ROOT/pidgin-<version>/.

Customizing the Build Environment

Most people will find that the standard build evironment 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 overridding 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 of gdb available from MinGW, if you prefer.

Cross Compiling

It is quite easy to cross compile Pidgin for Windows on a Linux machine. Note that cross-compiling does not work properly on Debian Sid on amd64 (also called x86_64 or x64) systems--the most common failure is that the linker will die with a segmentation fault at various points. You may have differing success or failure on other 64-bit Linux distributions.

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, skipping steps 1 and 2.

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 := -
PERL := /usr/bin/perl
EXTUTILS := /usr/share/perl/5.8/ExtUtils
WINDRES := /usr/bin/i586-mingw32msvc-windres
STRIP := /usr/bin/i586-mingw32msvc-strip

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 the INCLUDE_PATHS and LIB_PATHS variables in your local.mak as I have done.

If you want to build the installers, you'll need to install NSIS. On Debian and Ubuntu, the package name is nsis; this will likely be different elsewhere. In order to build the GTK+ installer as mentioned above, the build.sh script referenced above needs to be changed. The line starting with makensis.exe needs to be changed to read:

makensis -V3 -DGTK_VERSION=$gtk_version -DGTK_REVISION=$gtk_revision gtk-installer.nsi

Once this is all set up, you should be able to follow the building instructions above.

All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!