Commit a45b21b7 authored by Ian Goldberg's avatar Ian Goldberg

Major update to mingw32 cross-compile instructions

parent fbf0c821
Here are some rough notes that might help you create a pidgin-otr Win32 build on Here are some rough notes that might help you create a pidgin-otr Win32
a Linux system with mingw32. These have been tested on Ubuntu 11.04. build on a Linux system with mingw32. These have been tested on Ubuntu
12.04.
tl;dr download and install for files before disconnecting from the internet: tl;dr download and install for files before disconnecting from the internet:
wget -c ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.0.tar.gz \ wget -c http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz \
ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.2.1.tar.gz \ http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.3.tar.xz \
https://otr.cypherpunks.ca/rndw32.diff \ ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.17.tar.gz \
https://otr.cypherpunks.ca/gpg-error-1.17-mingw.diff \
ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.4.tar.gz \
https://otr.cypherpunks.ca/gcrypt-1.5.4-mingw.diff \
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip \ http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip \
http://downloads.sourceforge.net/project/pidgin/Pidgin/2.10.6/pidgin-2.10.6.tar.bz2 \ http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.9/pidgin-2.10.9.tar.bz2 \
http://downloads.sourceforge.net/project/pidgin/Pidgin/2.10.6/pidgin-2.10.6-win32-bin.zip \ http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.9/pidgin-2.10.9-win32-bin.zip \
https://otr.cypherpunks.ca/nsisunz.zip https://otr.cypherpunks.ca/nsisunz.zip
apt-get install mingw32 nsis wget unzip tar apt-get install mingw32 nsis
The above files have the following SHA1 values: The above files have the following SHA1 values:
895072c22f5bfd4ac9054d48d62d6c8b2a487098 gtk+-bundle_2.24.10-20120208_win32.zip be7d67e50d72ff067b2c0291311bc283add36965 libiconv-1.14.tar.gz
8627d483e26e73b4cfabb4807ae8423875c37cda libgcrypt-1.2.1.tar.gz 5c8e37c5275742b6acc1257e2df9b5d1874c12e3 gettext-0.19.3.tar.xz
1c91787f208c30a91678ebb2f173308f8fab3d36 libgpg-error-1.0.tar.gz 7c47e46a9b3af7fcca78f98ee71f36045bfc680c libgpg-error-1.17.tar.gz
caeeb30321966279285228f9afa088c7f4cace84 nsisunz.zip b308288c9c277e9685eddf41f3cf7edf11d3821d gpg-error-1.17-mingw.diff
a0532e7ba2acd205d6a5a4e3624156a980fe3d43 pidgin-2.10.6.tar.bz2 71e432e0ae8792076a40c6059667997250abbb9d libgcrypt-1.5.4.tar.gz
e2758a47f911850a2afe7ad3764a383b43e405ba pidgin-2.10.6-win32-bin.zip 0c4396fecd2ca796ad167bf6af30d5e5038e7003 gcrypt-1.5.4-mingw.diff
7513069475a3717f851867ab5f729f3a871421c0 rndw32.diff 895072c22f5bfd4ac9054d48d62d6c8b2a487098 gtk+-bundle_2.24.10-20120208_win32.zip
f3de8fd94dba1f4c98d5402a02430f9f323e665a pidgin-2.10.9.tar.bz2
23f330a2280e8f63e3b2c89752919cc3383886fa pidgin-2.10.9-win32-bin.zip
caeeb30321966279285228f9afa088c7f4cace84 nsisunz.zip
Packages and their build instructions in the order they should be built. Good luck!
Packages and their build instructions in the order they should be built.
Good luck!
mingw: mingw:
apt-get install mingw32 apt-get install mingw32
libgpg-error-1.0:
cd /tmp; libiconv-1.14:
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.0.tar.gz wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -xvzf libgpg-error-1.0.tar.gz tar xzvvf libiconv-1.14.tar.gz
# (before configure) cd libiconv-1.14
HOST_CC=gcc CFLAGS="-g -O2 -fwrapv -fno-strict-overflow"
DLLTOOL=i586-mingw32msvc-dlltool LDFLAGS="-pie"
AS=i586-mingw32msvc-as export CFLAGS LDFLAGS
./configure --enable-static --disable-shared --with-pic --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
make
sudo make install
gettext-0.19.3:
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.3.tar.xz
tar xJvvf gettext-0.19.3.tar.xz
cd gettext-0.19.3
CFLAGS="-g -O2 -fwrapv -fno-strict-overflow"
LDFLAGS="-pie"
export CFLAGS LDFLAGS
./configure --enable-static --disable-shared --with-pic --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
make
sudo make install
libgpg-error-1.17:
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.17.tar.gz
tar xzvvf libgpg-error-1.17.tar.gz
CFLAGS="-g -O2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fno-strict-overflow" CFLAGS="-g -O2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fno-strict-overflow"
LDFLAGS="-pie" LDFLAGS="-pie"
export HOST_CC DLLTOOL AS CFLAGS LDFLAGS export CFLAGS LDFLAGS
./configure --with-pic --build=`./config.guess` --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc cd libgpg-error-1.17
patch -p0 < ../gpg-error-1.17-mingw.diff
./configure --enable-static --disable-shared --with-pic --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
cp src/syscfg/lock-obj-pub.mingw32.h src/syscfg/lock-obj-pub.mingw32msvc.h
make make
sudo make install sudo make install
libgcrypt-1.2.1: libgcrypt-1.5.4:
cd /tmp; wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.4.tar.gz
wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.2.1.tar.gz tar xzvvf libgcrypt-1.5.4.tar.gz
wget https://otr.cypherpunks.ca/rndw32.diff cd libgcrypt-1.5.4
tar -xvzf libgcrypt-1.2.1.tar.gz
cd /tmp/libgcrypt-1.2.1
CFLAGS="-g -O2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fno-strict-overflow" CFLAGS="-g -O2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fno-strict-overflow"
LDFLAGS="-pie" LDFLAGS="-pie"
export CFLAGS LDFLAGS export CFLAGS LDFLAGS
patch -p0 < ../gcrypt-1.5.4-mingw.diff
w32root=/usr/i586-mingw32msvc ./autogen.sh --build-w32 w32root=/usr/i586-mingw32msvc ./autogen.sh --build-w32
# Apply a basic configuration change patch
patch -p0 < /path/to/pidgin-otr/patches/win32/libgcrypt-config.h.patch
# Apply windows slow random fix patch
patch -p0 < /path/to/pidgin-otr/patches/win32/rndw32.diff
make make
sudo make install sudo make install
...@@ -65,17 +92,19 @@ nsis: ...@@ -65,17 +92,19 @@ nsis:
# Locate the "nsisunz" plugin (a google search for "nsisunz.zip" should be sufficient) # Locate the "nsisunz" plugin (a google search for "nsisunz.zip" should be sufficient)
# Extract the DLL to /usr/share/nsis/Plugins # Extract the DLL to /usr/share/nsis/Plugins
# (yes it's a DLL extension, but it will still work for GNU/Linux nsis) # (yes it's a DLL extension, but it will still work for GNU/Linux nsis)
# set LIBOTRSRCDIR to the libotr src directory
cd /tmp;
wget -c https://otr.cypherpunks.ca/nsisunz.zip wget -c https://otr.cypherpunks.ca/nsisunz.zip
unzip nsisunz.zip unzip nsisunz.zip
sudo cp /tmp/nsisunz/Release/nsisunz.dll /usr/share/nsis/Plugins/ sudo cp nsisunz/Release/nsisunz.dll /usr/share/nsis/Plugins/
libotr: libotr-4.1.0:
autoreconf -s -i autoreconf -s -i
./configure --with-pic --build=`./config.guess` --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc \ unset CFLAGS
--with-libgcrypt-prefix=/usr/i586-mingw32msvc unset LDFLAGS
./configure --with-pic --host=i586-mingw32msvc \
--prefix=/usr/i586-mingw32msvc \
--enable-static --disable-shared \
--with-libgcrypt-prefix=/usr/i586-mingw32msvc
make make
sudo make install sudo make install
...@@ -90,21 +119,17 @@ pidgin-otr: ...@@ -90,21 +119,17 @@ pidgin-otr:
# Ensure either pkg-config will correctly resolve all the dependencies for # Ensure either pkg-config will correctly resolve all the dependencies for
# glib-2.0 and gtk+-2.0. There is a README in the GTK+ bundle about this, or # glib-2.0 and gtk+-2.0. There is a README in the GTK+ bundle about this, or
# uncomment (and perhaps revise) the hardcoded list of includes for GTK_HDRS # uncomment (and perhaps revise) the hardcoded list of includes for GTK_HDRS
cd /tmp; wget http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.9/pidgin-2.10.9.tar.bz2
wget -c http://prdownloads.sourceforge.net/pidgin/pidgin-2.10.3.tar.bz2 wget http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.9/pidgin-2.10.9-win32-bin.zip
wget -c http://downloads.sourceforge.net/project/pidgin/Pidgin/2.10.6/pidgin-2.10.6-win32-bin.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip
wget -c http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip sudo mkdir -p /usr/i586-mingw32msvc/misc/gtk_bundle
sudo mkdir -p /usr/i586-mingw32msvc/misc/gtk_bundle; sudo unzip -d /usr/i586-mingw32msvc/misc/gtk_bundle gtk+-bundle_2.24.10-20120208_win32.zip
cd /usr/i586-mingw32msvc/misc/gtk_bundle; unzip pidgin-2.10.9-win32-bin.zip
sudo unzip /tmp/gtk+-bundle_2.24.10-20120208_win32.zip
cd /tmp;
unzip pidgin-2.10.6-win32-bin.zip
sudo mkdir -p /usr/i586-mingw32msvc/misc/pidgin_dlls sudo mkdir -p /usr/i586-mingw32msvc/misc/pidgin_dlls
sudo mv /tmp/pidgin-2.10.6-win32bin/*.dll /usr/i586-mingw32msvc/misc/pidgin_dlls/ sudo mv pidgin-2.10.9-win32bin/*.dll /usr/i586-mingw32msvc/misc/pidgin_dlls/
tar -xvjf pidgin-2.10.6.tar.bz2 tar xjvvf pidgin-2.10.9.tar.bz2
sudo mkdir -p /usr/i586-mingw32msvc/include/ sudo mv pidgin-2.10.9/libpurple /usr/i586-mingw32msvc/include/
sudo mv /tmp/pidgin-2.10.6/libpurple /usr/i586-mingw32msvc/include/ sudo mv pidgin-2.10.9/pidgin /usr/i586-mingw32msvc/include/
sudo mv /tmp/pidgin-2.10.6/pidgin /usr/i586-mingw32msvc/include/
cd /path/to/pidgin-otr/ cd /path/to/pidgin-otr/
# Finally build pidgin-otr plugin # Finally build pidgin-otr plugin
make -f Makefile.mingw make -f Makefile.mingw
...@@ -113,8 +138,9 @@ pidgin-otr: ...@@ -113,8 +138,9 @@ pidgin-otr:
# This should now build the zipfile # This should now build the zipfile
make -f Makefile.mingw zip make -f Makefile.mingw zip
The pidgin-otr plugin is now available in the current working directory - The pidgin-otr plugin will be created in the current working directory;
inspect it with unzip: inspect it with unzip:
unzip -l pidgin-otr-4.0.1.zip unzip -l pidgin-otr-4.0.1.zip
The installer will be created in packaging/windows/pidgin-otr-4.0.1.exe .
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment