Version 10 (modified by rb07, 13 years ago) (diff) |
---|
Building Transmission Qt for Windows
The following procedure in not the only one possible, it was just the easiest for me.
If you have a MinGW http://mingw.org/ development environment (Qt SDK http://www.qtsoftware.com/downloads/downloads#lgpl installs the basic tools but with an old winapi that is not enough) 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, port the rest, and try the 2nd part.
Cross build environment
Using the excellent tools from the Fedora project http://fedoraproject.org/wiki/MinGW we can build Transmission for running on Windows (XP and above).
You 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 one of the available options http://www.vmware.com/appliances/directory/cat/9833.
Once you have it, log in, su to root, and install the cross-development tools:
- Create the file /etc/yum.repos.d/mingw.repo running:
echo "[mingw] name=Fedora Windows cross-compiler, libraries, and tools. baseurl=http://homes.merjis.com/~rich/mingw/fedora-rawhide/x86_64/ enabled=1 gpgcheck=0 " > /etc/yum.repos.d/mingw.repo
- yum install mingw32-gcc mingw32-gtk2 mingw32-crossreport mingw32-nsiswrapper wine
- yum install mingw32-curl
- yum install mingw32-qt
- yum install mingw32-gcc-c++
- yum install patch
Curl 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. I'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).
Building Transmission library
For native MinGW replace mingw32-configure with ./configure, qmake-qt4 with qmake, and i686-pc-mingw32-g++ with g++.
Start by downloading and installing the source in your workspace:
- curl http://download.m0k.org/transmission/files/transmission-1.83.tar.bz2 -O
- tar xvf transmission-1.83.tar.bz2
We are using one patch BuildingTransmissionQtWindows/transmission-1.83-Qt-build.diff; the download is done in one of the steps below.
Then:
- cd transmission-1.83
- curl "http://trac.transmissionbt.com/wiki/BuildingTransmissionQtWindows/transmission-1.83-Qt-build.diff?format=txt" -O transmission-1.83-Qt-build.diff
- patch -p1 < transmission-1.83-Qt-build.diff
- mingw32-configure --disable-nls --disable-largefile --disable-cli --disable-gtk
- make CFLAGS="-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -DSTATICLIB"
- make install
Build Transmission Qt
- cd qt
- Just once, either copy the Gtk icon (if you have it) or download it:
- cp ../gtk/transmission.ico qtr.ico
- curl http://trac.transmissionbt.com/export/8538/trunk/gtk/transmission.ico -o qtr.ico
- Just once, either copy the Gtk icon (if you have it) or download it:
- export QMAKESPEC=fedora-win32-cross
- export PKG_CONFIG_LIBDIR=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig
- qmake-qt4 -win32 QT_LIBINFIX=4 qtr.pro
- perl -pi -e 's/-fno-rtti' Makefile.Debug Makefile.Release
- make clean && make release
- INSTALL_ROOT=/usr/i686-pc-mingw32/sys-root/mingw make release-install
Make the Windows installer
The following steps are to correct a deficiency of nsiswrapper :
- ln -s /usr/i686-pc-mingw32/sys-root/mingw/bin/QtCore4.dll /usr/i686-pc-mingw32/sys-root/mingw/bin/qtcore4.dll
- ln -s /usr/i686-pc-mingw32/sys-root/mingw/bin/QtGui4.dll /usr/i686-pc-mingw32/sys-root/mingw/bin/qtgui4.dll
- ln -s /usr/i686-pc-mingw32/sys-root/mingw/bin/QtNetwork4.dll /usr/i686-pc-mingw32/sys-root/mingw/bin/qtnetwork4.dll
You may also have to set the PATH to include /usr/i686-pc-mingw32/sys-root/mingw/bin (unless my latest patch is already included in the distributed nsiswrapper).
Finally create the installer:
- nsiswrapper --run --name "QtTransmission" --outfile QtTransmission-1.83_installer.exe --installdir 'C:\Program Files\Transmission' /usr/i686-pc-mingw32/sys-root/mingw/bin/qtr.exe
That'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, or a Windows/Samba? share.