[Pidgin] BuildingWinPidgin/3.0.0 added
trac at pidgin.im
Mon Apr 22 10:26:10 EDT 2013
Page "BuildingWinPidgin/3.0.0" was added by tomkiewicz
= Pidgin for Windows Build Instructions =
Note: These instructions are for 3.0.0 branch. The current instructions for 2.x.y are found [wiki:BuildingWinPidgin here].
== Set up your build environment ==
1. Install the [http://cygwin.com Cygwin] Bash shell. Make sure to select Unix file mode during setup.
Also make sure you install bash, bzip2, '''ca-certificates''', coreutils, gawk, '''gnupg''', grep, gzip, '''libiconv''', '''make''', '''mercurial''', '''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). [[BR]]
You may prefer to use [hxxp://sourceforge.net/projects/mingw/files/MSYS/ MSYS] instead of Cygwin.
2. Download the `Bonjour SDK for Windows` from [hxxps://developer.apple.com/bonjour/ the Apple developer website] (Apple ID may be necessary) and install it to default location.
3. Download `Perl 5.10` or newer and install it, preferably to `C:\Perl`. You may use [hxxp://www.activestate.com/activeperl/downloads ActivePerl Community Edition].
4. Extract or check out [#GetthePidginsourcecode the Pidgin source] into `$PIDGIN_DEV_ROOT/pidgin-<version>`.
Some users may find the [#CustomizingtheBuildEnvironment 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:\devel\pidgin-devel` in this example):
(The following is the source tree root, containing config.h.mingw.)
(If the following file is present, your structure is probably correct.)
5. Go through the rest of setting build environment using automatic setup script by running the following from Cygwin terminal:
== Get the Pidgin source code ==
The source for Pidgin 3.x.y is available [hxxp://prdownloads.sourceforge.net/pidgin/pidgin-3.x.y.tar.bz2 here] (use the latest release if this isn't updated yet).[[BR]][[BR]]
The 3.0.0 branch isn't released yet, so there are no source packages for this at the moment.[[BR]][[BR]]
The development source is available via mercurial. See [wiki:UsingPidginMercurial] for more information.
== Build Pidgin ==
Run the following:
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 [hxxp://nsis.sourceforge.net/Download NSIS]. Include NSIS to Cygwin's `PATH`.
* For information on the NSIS installer, visit the [hxxp://nsis.sourceforge.net NSIS website].[[BR]]
* Download the [hxxp://nsis.sourceforge.net/Nsisunz_plug-in nsisunz plugin], and extract `nsisunz.dll` into the `Plugins` directory of your NSIS installation.
* Copy `$PIDGIN_DEV_ROOT/win32-dev/pidgin-inst-deps-20130214/SHA1Plugin.dll` into the `Plugins` directory of your NSIS installation.
* Now you'll need to decide if you want to sign the executables (not necessary for personal use)
* If you do, you'll need to get an appropriate code signing certificate, generate a GPG key if you don't already have one, then download and install [hxxp://www.mono-project.com/Download Mono]. In your `local.mak` file (see [wiki:"BuildingWinPidgin#CustomizingtheBuildEnvironment" below]), define the `MONO_SIGNCODE` variable to the fully qualified path to the `signcode` batch file in the Mono `bin` directory, and the `SIGNCODE_SPC` and `SIGNCODE_PVK` variables to the appropriate files from your certificate. E.g.:
MONO_SIGNCODE=/cygdrive/c/Program\ Files\ \(x86\)/Mono-2.10.8/bin/signcode
#Set up gpg to use a separate keyring
GPG_SIGN=gpg --no-default-keyring --secret-keyring /path/to/secring.gpg
* Otherwise, in your `local.mak` file (see [wiki:"BuildingWinPidgin#CustomizingtheBuildEnvironment" below]),add the following:
MONO_SIGNCODE=echo ***Bypassing signcode***
GPG_SIGN=echo ***Bypassing gpg***
* Now you can actually build the installer.[[BR]]
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.
The `Makefile.mingw` targets for these are `installer_offline`, and `installer` respectively. To build both, use the `installers` target.
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 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 [hxxp://hg.pidgin.im/pidgin/main/file/default/libpurple/win32/global.mak 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 [#CrossCompiling section below].
== Debugging ==
There is a quite good '''Just In Time''' debugger for MinGW: [hxxp://code.google.com/p/jrfonseca/wiki/DrMingw drmingw].[[BR]]
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 [#Themanualway 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
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 [hxxp://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.
NSIS version 2.46 or greater is required to cross-compile. If compiling NSIS from source, the [hxxp://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):
`.tar.bz2` file contains latest source[[BR]]
`.zip` file contains libraries
mkdir nsis; cd nsis
tar -jxvf nsis-2.46-src.tar.bz2
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no
sudo scons install-compiler
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 ([#CrossCompiling listed above]) should be modified[[BR]]
MAKENSIS := /usr/local/bin/makensis
Once this is all set up, you should be able to follow the [#BuildPidgin building instructions above].
Page URL: <https://developer.pidgin.im/wiki/BuildingWinPidgin/3.0.0>
This is an automated message. Someone added your email address to be
notified of changes on 'BuildingWinPidgin/3.0.0' page.
If it was not you, please report to datallah at pidgin.im.
More information about the Wikiedit