- Getting prerequesites
- Getting sources
- Building and installing
- Microsoft Windows
- LeechCraft segfaults on startup
- LeechCraft doesn't start, outputting into console complaints about liblcutil.so.0.5.0
- Linking/startup problems on FreeBSD/Mac OS X in BitTorrent plugin
- LeechCraft fails to build with your_compiler_name
- CMake outputs `Package libtorrent-rasterbar was not found in the pkg-config search path` and fails with an error
|Qt||≥4.7||≥4.8||For most new plugins Qt 4.8 is required.|
|Boost||≥1.50||≥1.50||The following libraries are required, besides header-only ones:
|Rasterbar libtorrent||=0.15.x||≥0.15.x||Unicode and DHT support is required.|
|QJson||≥0.7.0||≥0.7.0||Required for several plugins like SB2, Poshuku OnlineBookmarks, etc.|
|libmsn||≥4.1||≥4.1||Required for the Azoth Zheet plugin.|
|libotr||≥3.1.0||≥3.1.0||Required for the Azoth OTRoid plugin.|
|hunspell||≥1.3.0||≥1.3.0||Required for the Azoth Rosenthal plugin.|
|Speex||≥1.0||≥1.0||Required for the Azoth plugin compiled with
|Taglib||≥1.7.0||≥1.7.0||Required for the LMP plugin.|
|liblastfm||≥0.3.3||≥0.3.3||Required for the LastFMScrobble plugin.|
|ffmpeg||≥1.0.0||≥1.0.0||Used by the MusicZombie plugin (libav would be fine too).|
|chromaprint||≥0.6||≥0.6||Used by the MusicZombie plugin.|
|poppler||≥0.22.0||≥0.22.0||Required for the Monocle PDF plugin (0.20.x will work too, but it has some issues with threading).|
|libspectre||≥0.2.6||≥0.2.6||Required for the Monocle PostRus plugin.|
|djvu||≥3.5.24||≥3.5.24||Required for the Monocle Seen plugin.|
|Qwt||≥6.0||≥6.0||Required for the Lemon, Liznoo and HotSensors plugins.|
|Qross||≥0.2.0||≥0.2.0||Required for the Qrosp plugin.|
|QScintilla2||≥2.5||≥2.5||Required for the Popishu plugin.|
|kdelibs||≥4.2||≥4.2||Required for the AnHero plugin.|
A pretty decent compiler is required for LeechCraft from master. Particularly, it should support the following features from C++11:
- Lambda functions.
- Variadic templates.
- Initializer lists.
gcc 4.6 and later is known to build LeechCraft successfully. MSVS 2012 with CTP update pack seems to support C++11 well enough, though building LeechCraft for Windows is a very different story.
Note: this guide suggests a *NIX-like OS like Linux or FreeBSD. Building with Windows is possible but is full of patching and heavy work, and it hasn't been properly documented yet.
Some distros allow easy installation of all the required prerequesites, and the process is documented here.
It's as simple as running the following from root:
sudo add-apt-repository ppa:tehnick/leechcraft-unstable sudo apt-get update sudo apt-get build-dep leechcraft-unstable
Execute the following replacing openSUSE_Tumbleweed with your distro version:
sudo zypper ar http://download.opensuse.org/repositories/home:Reki:leechcraft:masterbranch/openSUSE_Tumbleweed/home:Reki:leechcraft:masterbranch.repo sudo zypper ref sudo zypper si -d leechcraft
You can either download (an extremely outdated) source package from https://sourceforge.net/projects/leechcraft/files/ or check out the files from git (you will need
git for this). The later is strongly advised.
To check out the sources from git,
cd into a directory where you want
leechcraft subdirectory to be placed. In this guide we assume it's
~/Programming. Issue the following from that directory:
git clone git://github.com/0xd34df00d/leechcraft.git
This would create
~/Programming/leechcraftand put the project's sources and commit history there. To later update the repository, just issue:
cd ~/Programming/leechcraft git pull
Building and installing
We use so-called out-of-source builds. They support having different builds with different configurations simultaneously as well as easily remove the build directory if something goes wrong.
So, create a directory in
cd into it. Type
cmake -DCMAKE_BUILD_TYPE=BuildType ../src
Here BuildType specifies what type of the build you want:
- Release version with no debugging information and optimizations enabled.
- Debug version with debugging information and no optimizations at all.
- A version with both debugging information and optimizations enabled (recommended).
- Release version with optimizations for producing executables of minimal size.
cmake successfully prepares the build system, type
ccmake and check the list of plugins to be built. You can enable or disable them there nicely. Alternatively, you can manually edit the
CMakeCache.txt file in the build directory, modifying values of variables starting with ENABLE_.
After you've selected what you want to build, run
make and have a cup of coffee while LeechCraft compiles. To compile things faster, append the -jN option, where N is number of cores you have. For a decent Core i7 system that would be
make -j8, for example. If it fails, join the Jabber conference email@example.com and feel free to ask.
Become root and issue
make install to install LeechCraft into
/usr/local. That's it!
Please note that LeechCraft won't work without installing.
cd ~/Programming/leechcraft/build sudo cmake -P cmake_uninstall.cmake
Hehe. It's tricky. Don't try.
More seriously, building on Win32 requires a good knowledge of the build process, Qt and Boost pecularities and various typical but subtle errors.
Nevertheless, if you are brave enough, you could follow the Win32 building guide.
LeechCraft segfaults on startup
make install is required, really.
LeechCraft doesn't start, outputting into console complaints about liblcutil.so.0.5.0
If you get something like
leechcraft: error while loading shared libraries: liblcutil.so.0.5.0: cannot open shared object file: No such file or directory
then just run
ldconfig from root, like,
If you still can't run LeechCraft with the same error, check that
are present in your
/etc/ld.so.conf. For example, default Mandriva setups are known to miss these lines.
Linking/startup problems on FreeBSD/Mac OS X in BitTorrent plugin
If you get linking errors in
libleechcraft_bittorrent.dylib on Mac OS X), particularly, something like:
Undefined symbols: "boost::filesystem2::no_check(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: LeechCraft::Plugins::BitTorrent::TorrentMaker::Start(LeechCraft::Plugins::BitTorrent::NewTorrentParams)in torrentmaker.cpp.o ld: symbol(s) not found
make sure you are building with optimizations enabled (setting
CMAKE_BUILD_TYPE to Release will do). Make sure there is only one Boost installation on your system or, at least, that the plugin (and libtorrent) is being linked to the same version of the Boost libraries that it's compiled with.
LeechCraft fails to build with your_compiler_name
Please see prerequesites.
CMake outputs `Package libtorrent-rasterbar was not found in the pkg-config search path` and fails with an error
The full error message is:
Package libtorrent-rasterbar was not found in the pkg-config search path. Perhaps you should add the directory containing `libtorrent-rasterbar.pc' to the PKG_CONFIG_PATH environment variable No package 'libtorrent-rasterbar' found
If you get that, you should find where your
locate libtorrent-rasterbar.pccommand will do, though you would probably need to update its search base) is and issue the following command:
and then re-run CMake in the same shell with the same command line.
If you re-configure LeechCraft often, you'd probably want to add this export declaration to your