Changes between Initial Version and Version 1 of BuildingTransmissionQtWindows


Ignore:
Timestamp:
May 29, 2009, 3:43:20 AM (13 years ago)
Author:
rb07
Comment:

New: build Qtr for Windows.

Legend:

Unmodified
Added
Removed
Modified
  • BuildingTransmissionQtWindows

    v1 v1  
     1= Building Transmission Qt for Windows =
     2[[PageOutline]]
     3
     4The following procedure in not the only one possible, it was just the easiest for me.
     5
     6If you have a MinGW [http://mingw.org/] development environment (Qt SDK [http://www.qtsoftware.com/downloads/downloads#lgpl] installs the basic tools) then you can skip the first part, add as many ported packages as you can find [http://sourceforge.net/project/showfiles.php?group_id=2435], and try the 2nd part.
     7
     8== Cross build environment ==
     9
     10Using the excellent tools from the Fedora project [http://fedoraproject.org/wiki/MinGW] we can build Transmission for running on Windows (XP and above).
     11
     12You don't need to install Fedora 11, I run it under Windows on a virtual machine (VMWare Player [http://www.vmware.com/download/player/download.html]), the Fedora 11 image is from VMplanet [http://vmplanet.net/node/92].
     13
     14Once you have it, log in, su to root, and install the cross-development tools:
     15
     16 * yum install mingw32-gcc mingw32-gtk2 mingw32-crossreport mingw32-nsiswrapper wine
     17 * yum install mingw32-curl
     18 * yum install mingw32-qt
     19 * yum install mingw32-gcc-c++
     20
     21Curl and its dependencies was already ported, so we got that for free.  If you are working on MinGW, go to the Curl site, the downloads include libraries and everything ported to Windows.
     22 
     23I'm not building a multi-language version, just English, so I'm skipping the step about installing intltool (which is not in the yum repository, you have to build it, and I did for the Gtk version which requires it; not difficult).
     24 
     25== Building Transmission library ==
     26 
     27For MinGW replace mingw32-configure with ./configure, qmake-qt4 with qmake, and i686-pc-mingw32-g++ with g++.
     28
     29Start by downloading and installing the source in your workspace:
     30
     31 * curl http://download.m0k.org/transmission/files/transmission-1.61.tar.bz2 -O
     32 * tar xvf transmission-1.61.tar.bz2
     33
     34Download the following patch [wiki:BuildingTransmissionQtWindows/transmission-1.61-Qt-build.diff]
     35
     36Then:
     37 
     38 * cd transmission-1.61
     39 * patch -p1 < transmission-1.61-Qt-build.diff
     40 * mingw32-configure --disable-nls --disable-cli --disable-shared --disable-gtk --disable-daemon
     41 * make CFLAGS="-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -DSTATICLIB"
     42 * make install
     43
     44== Build Transmission Qt ==
     45
     46 * cd qt
     47 * export QMAKESPEC=fedora-win32-cross
     48 * export PKG_CONFIG_LIBDIR=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig
     49 * qmake-qt4 -win32 qtr.pro
     50 * perl -pi -e 's/-fno-rtti//' Makefile.Debug Makefile.Release
     51 * make clean &&  make release
     52 * i686-pc-mingw32-g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug/qtr.exe object_script.qtr.Debug  -L"/usr/i686-pc-mingw32/sys-root/mingw/lib" -lmingw32 -lqtmaind debug/qtr_resource_res.o ../libtransmission/libtransmission.a ../third-party/miniupnp/libminiupnp.a ../third-party/libnatpmp/libnatpmp.a ../third-party/libevent/.libs/libevent.a -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lfontconfig -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lcurl -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lssl -lcrypto -lwsock32 -lws2_32 -lgdi32 -lz -lQtGuid4 -lQtNetworkd4 -lQtCored4 -lintl
     53 * INSTALL_ROOT=/usr/i686-pc-mingw32/sys-root/mingw make release-install
     54
     55Note: after 'make release' everything is compiled but linking fails, that's what the line after that does: links with the correct library names, and the two missing libraries.
     56
     57== Make the Windows installer ==
     58
     59I had to change the Fedora tool a little, make a backup of /usr/bin/nsiswrapper (i.e. cp /usr/bin/nsiswrapper /usr/bin/nsiswrapper.orig), then apply this patch [wiki:BuildingTransmissionQtWindows/nsiswrapper.diff]
     60
     61Finally create the installer:
     62
     63 * nsiswrapper --run --name "!QtTransmission" --outfile QTransmission-1.61_installer.exe --installdir 'C:\Program Files\Transmission-1.61' /usr/i686-pc-mingw32/sys-root/mingw/bin/qtr.exe
     64
     65That's it, now just copy the installer to Windows, I use ftp but of course I have a ftp server... haven't tried other means but scp (putty or OpenSSH) should work, also using a flash drive, a floppy if enabled on the VM.
     66
     67----