Windows build guide

From LeechCraft
Jump to: navigation, search
Apps-help-browser-icon.png
This article is incomplete, help us improve it.


General information

Tested platforms and toolchains

Issues

MinGW

There are some known issues with the MinGW compiler. MinGW impementation of WinAPI headers defines some macros with names like GetObject or SendMessage, and these macros conflict with the names of some API methods in LeechCraft. Since Qt pulls these headers in, LeechCraft becames unbuildable.

One possible solution could be just renaming these functions in upstream, but that seems very kludgy and is rejected — better use better WinAPI headers.

Fixed in upstream some time before 0.5.95.

Build instructions

Dependencies overview

  • git to check out our source code. msysgit is recommended.
  • Qt 4.8.
  • Boost 1.48 or higher.
  • CMake 2.8.7 or higher.
  • OpenSSL 0.9.8 or higher.
  • Rasterbar Libtorrent 0.15 or higher (though 0.15 is recommended) for the BitTorrent plugin.
  • QJson 0.7 or higher for NetStoreManager GoogleDrive and Poshuku OnlineBookmarks plugins.
  • QXmpp from our git master branch for the Azoth Xoox plugin.
  • libmsn 4.1 or higher for the Azoth Zheet plugin.
  • Speex 1.0 or higher for the Azoth plugin with ENABLE_MEDIACALLS feature enabled.
  • Qross 0.2 for our Qrosp plugin.
  • QScintilla 2.5 or higher for the Popishu plugin.
  • [Gpg4win|http://www.gpg4win.org/]. Проследить, чтобы gpg.exe был в PATH

Instructions

Visual Studio 2012

Building Qt

Current Qt stable version (4.8.2) doesn't support MSVC2012 compiler. To achieve compatibility try following steps:

or download my patched build

Notes:

  • There is no Qt Visual Add-in version exists for MSVC2012 at this moment.
  • Use this method at your own risk and bugs :)
Building QXmpp
mkdir build
cd build
qmake ../ -config release PREFIX=C:\\Project\\installed\\qxmpp
nmake
nmake install
Building pcre
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DPCRE_SUPPORT_JIT=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\pcre

build and install in msvc2012

Building QJson
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qjson

build and install in msvc2012 Hint: If CMake gives an error like sh.exe was found in your PATH, just ignore it and run the command again. CMake always seems to do this in an empty build directory.

Building TagLib
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\taglib

build and install in msvc2012

Building Gpg4win

Качнуть и установить http://www.gpg4win.org/. Проследить, чтобы gpg.exe был в PATH

Building QCA

Last svn trunk version has CMake support. We'll use it.

svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/qca
cd qca
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qca

build and install in msvc2012 copy crypto.prf.in and installwin.bat into install dir

cd D:\Project\installed\qca
installwin.bat
Building Qxt
configure.bat -release -prefix D:\Project\installed\qxt
nmake
nmake install
Building liblastfm
git clone https://github.com/eartle/liblastfm.git
cd liblastfm
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\liblastfm
Building Qwt

Get Qwt:

svn checkout svn://svn.code.sf.net/p/qwt/code/trunk/qwt qwt-trunk

Edit qwtconfig.pri and set:

win32 {
    QWT_INSTALL_PREFIX    = C:/Qwt-$$QWT_VERSION-svn
}

to

win32 {
    QWT_INSTALL_PREFIX    = D:/Project/installed/qwt
}

Then

mkdir build
cd build
qmake ../
nmake
nmake install
Building Qross
git clone https://github.com/0xd34df00d/Qross.git qross-trunk
mkdir build
cd build
cmake ../src/qross -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qross
Building LeechCraft

TODO

git clone https://github.com/0xd34df00d/leechcraft.git
cd leechcraft
set CMAKE_PREFIX_PATH=D:\Project\installed\boost;D:\Project\installed\OpenSSL-Win32;D:\Project\installed\pcre;D:\Project\installed\perl;D:\Project\installed\qca;D:\Project\installed\qjson;D:\Project\installed\qross;D:\Project\installed\qwt;D:\Project\installed\qxmpp;D:\Project\installed\liblastfm;D:\Project\installed\qxt;D:\Project\installed\taglib;D:\Project\speex-dev;D:\Project\libogg\include
cd \leechcraft\tools\win32\build32
build32.bat
collect32.bat

Visual Studio 2010

MinGW

Building Qt

Скачать последний Qt 4.8.x, распаковать.

Создать файл configure.cache в папке с Qt:

-platform 
win32-g++-4.6 
-opensource 
-debug 
-debug-and-release 
-fast 
-nomake 
examples 
-nomake 
demos 
-no-dsp 
-no-vcproj 
-phonon
-qt-style-windowsxp
-qt-style-windowsvista
-native-gestures

В обычном cmd.exe (с путями к компилятору mingw в PATH) выполняем (хотя, можно и вручную, через диалог Windows):

setx LIB "%LIB%;C:\Installed\OpenSSL\lib;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86"
setx INCLUDE "%INCLUDE%;C:\Installed\OpenSSL\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"

Перезапускаем cmd.exe и пишем:

cd c:\Dev\qt-4.8.4
configure -redo
mingw32-make -j6

Идем гулять...

Building Boost
cd c:\Dev\boost
bootstrap.bat mingw
bjam install toolset=gcc link=shared runtime-link=shared threading=multi --without-context --prefix="c:\\installed\\boost-1.53"
Building hunspell

Скачать Hunspell, распаковать. В MinGW Shell:

cd /c/Dev/hunspell-1.3.2
./configure --prefix=/c/Installed/hunspell-1.3.2
make
make install
Building LibMagic (File utility)

Скачать _ftp://ftp.astron.com/pub/file/_, распаковать.

cd /tmp
wget http://prdownloads.sourceforge.net/mingw/mingw-libgnurx-2.5.1-bin.tar.gz
wget http://prdownloads.sourceforge.net/mingw/mingw-libgnurx-2.5.1-dev.tar.gz
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-bin.tar.gz
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-dev.tar.gz
cd /c/Dev/file-5.14
./configure --prefix=/c/Installed/file-5.14
make
make install
Building kQOAuth

Open regular cmd.exe with mingw enviroment, cd to yuor build dir then

git clone git://github.com/kypeli/kQOAuth.git kQOAuth-trunk
cd kQOAuth-trunk
mkdir build
cd build
qmake ../
mingw32-make
mingw32-make install