As we have more and more questions for support on how to install Amarok 2.2 from GIT, I thought I might make another synopsis on how to install a local build. Apparently linking to previous posts is not very useful because people tend not to read the links…
Warning: please do not try this if you are not comfortable with compiling from sources, and be aware that compiling from a development branch can break a few things!
Note: as I use Kubuntu, this is heavily biased, but there are a few indications for other distributions, as far as those have been provided by the previous bloggers.
Thanks go to Mark Kretschmann who started that adventure and wrote the first instructions, to Stephan Jau who wrote an excellent How-to for the SVN version for Kubuntu users and to David Faure who corrected some of our settings. And, of course, all the Amarok Team who do a tremendous job every single day
This document explains how to install Amarok 2 from GIT in your home directory - in an easy way
Update:October 12th 2009 I updated a few things since the first edition, in particular the README content in section 5 and adapted it to the upcoming Karmic Koala aka Kubuntu 9.10 (remember, I am biased)
If you already have an Amarok 2.x version installed from your distro, un-install it to prevent setting conflicts and similar. You will need the kdelibs and kdebase-runtime from KDE 4.2 or higher. Please see also the minimal requirements and mandatory dependencies in section 5.
1.Install git, the compiler and KDE 4 development packages:
- In Kubuntu, Debian, and all their derivatives:
sudo aptitude install git-core build-essential kde-devel
- In Archlinux:
sudo pacman -Sy git base-devel kdelibs kdebase-runtime
- In Gentoo:
sudo emerge -av dev-util/git kdelibs plasma-workspace
2. Install ccache to speed up compilation
ccache is a very nice tool that can speed up your compilation. It speeds up re-compilation of C/C++ code by caching previous compiles and detecting when the same compile is being done again. Install the package from your distribution and set the size of the cache to 2 GB with the command
ccache -M 2G
This will take 2Gb of space in your local directory, but the gain of time is really impressive. Enable the use of ccache by adding it to your local .bashrc, described in step 3 below:
3. Define the PATH and local environment
export PATH=$HOME/kde/bin:$PATHexport PATH=/usr/lib/ccache:$PATH
source $HOME/.bashrc
NOTE: if you are not using the bash shell, edit your proper shell config file (~/.zshrc or ~/.tcshrc or whatever it may be).
4. Make KDE aware of Amarok’s plugin location:
echo 'export KDEDIR=$HOME/kde' >> $HOME/.kde/env/myenv.shecho 'export KDEDIRS=$KDEDIR' >> $HOME/.kde/env/myenv.sh
5. Make sure you have all the necessary dependencies
The README file in the source states the required and optional dependencies, but I might as well write it down here, so there is no other document to be read for the lazy ones. Of course, before diving into compiling from source, check if those dependencies are available in the package repository of your distro
Note: you must also install the devel versions of these packages!
- KDE-Libs 4.2 + KDE-Base-runtime 4.2 (or newer)
- TagLib 1.6 (or newer), Metadata tagging library
- http://developer.kde.org/~wheeler/taglib.html
- svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib
Note: You need to compile taglib 1.6 with
-DWITH_ASF=On -DWITH_MP4=Onwhen running cmake, or use./configure --enable-asf --enable-mp4
- TagLib Extras 1.0.1 (or newer), Support for metadata reading of additional file types
- MySQL 5.0 (or newer) Embedded: libmysqld compiled with fPIC (In-process database support)
Note: If you have installed MySQL Embedded in non-default location (i.e. $HOME/usr), Amarok may fail to start with error regarding libmysqlclient library. In this case, add the following string to your ~/.bashrc:
export LD_LIBRARY_PATH=$HOME/usr/lib/mysql:$LD_LIBRARY_PATHwhere
$HOME/usris the path you will use in the--prefixoption when compiling (see step 7. below)
- QtScript Generator, Qt Bindings 0.1.0 (Qt Bindings for QtScript for Amarok’s scripting system)
Note: make sure to follow all steps described when compiling Qtscriptgenerator
- libgpod 0.7.0 (or newer), iPod support
- libmtp 0.3.x, MTP device support
- Mp3tunes.com integration (including synchronization) requires:
- OpenSSL http://www.openssl.org
- libxml2 http://xmlsoft.org
- libcurl http://curl.haxx.se
- Glib2 http://www.gtk.org
- Loudmouth, the Jabber library, http://www.loudmouth-project.org/
- Qt must be compiled with Glib enabled
- Liblastfm 0.3 (For scrobbling, Internet radio, and artist info)
- MySQL 5.0 (or newer) Server (external database support)
5.1.Various dependencies that might cause compile errors and have to be installed:
(these are rather specific to Kubuntu, might have other names in other distributions and/or are already installed)
- libstrigiqtdbusclient-dev
- libsearchclient-dev
- libmysqlclient15off
- libmysqlclient16-dev
- libmysqld-dev
- libmysqld-pic
6. Create folders:
mkdir $HOME/kdemkdir $HOME/kde/srcmkdir $HOME/kde/buildmkdir $HOME/kde/build/amarok
7. Checking out and Building:
Now you need a source checkout from Gitorious. In the folder ~/kde/src/, type the following command:
git clone git://gitorious.org/amarok/amarok.git
this will drag approx. 55-60Mb of data, depending on the moment you actually make this checkout.
Everything is now ready to build:
cd $HOME/kde/build/amarokcmake -DCMAKE_INSTALL_PREFIX=$HOME/kde -DCMAKE_BUILD_TYPE=debugfull $HOME/kde/src/amarokmake install
8. Updating KDE Config:
kbuildsycoca4 --noincremental
Note: this might not be necessary for most of the cases
Now you are ready to run Amarok 2, by typing “amarok” in the shell. We strongly recommend you run amarok with the -d and –nofork option, so you will have debugging enabled and can get a valid backtrace if Amarok crashes.
9. Updating your Amarok build:
Since the development is quite fast with git, you should update your Amarok build regularly, and a daily checkout is not too much. This is made easy with the following command:
cd $HOME/kde/src/amarokgit pull
This will update your local git branch. If you have done modifications to your local branch you would like to keep, make sure you update with the --rebase option. See also the git tutorial for KDE in section 10.
You can now simply build again with
cd $HOME/kde/build/amarokmake install
Since you have installed ccache, a full build will speed up over time. To have an idea about the build time, just type time make install when building. If you have several CPU cores, you can speed up even more with the -j[n] option, where [n] is the number of CPU cores +1. Of course, the more CPU you use for building, the less you will have available for other tasks
10. More information and useful links
Don’t forget: running a development version also means that it is not stable and can break anytime ! This is especially true after a feature freeze, when the developers merge their personal git branches to the master branch.
Note: To be notified about major changes you definitely should subscribe to our mailing list amarok@kde.org at https://mail.kde.org/mailman/listinfo/amarok. Of course you will also find help in our #amarok channel on irc.freenode.net, but reading the mailing list is mandatory and spares us a lot of time.
Since you don’t want to repeat all this completely when you upgrade to a newer version of your preferred distribution, you should consider installing your /home directory on a separate partition from the start, it will spare you quite some time and hassle in the future.
Edit: Casper van Donderen just pointed me to the possibility to have the latest Amarok from git on Windows, too: if you build KDE using the emerge system, just type emerge amarok at the kdeenv command prompt. Thanks for the hint, Casper!
Nice to have this guide. I think that’s it’s pretty easy to follow it. Anyway I’m on kubuntu and a great way to follow amarok development are the amarok-nightly builds from project neon. Using it is really newbie-proof but right now the build is failing from some days. Being in the amarok team and using kubuntu maybe you know how to fix those builds or who to contact about them.
You should ask on the Neon mailing list then, I am not really familiar with it. I would guess it is because the new taglib and taglib-extras packages are not yet in the Neon KDE packages. This is a very new dependency, but it solves a lot of taglib related problems.
Hi,
I think there is a typo “Install ccmake to speed up compilation” shouldn’t it be ccache ?
Thanks for spotting this, Cyrille, I must have done an automatic replace when spell checking. Of course this makes more sense
Afaik prepending /usr/lib/ccache is not enough to use it. You also need to set some symlinks, at least that’s what I get from the manual:
See “Installation” section on:
http://ccache.samba.org/ccache-man.html
nevermind, the lib contains those symlinks - my bad!
[...] This post was mentioned on Twitter by PostRank – OS and FOSSwiki. FOSSwiki said: Myriam Schweingruber (Mamarok): Compiling Amarok from git … http://bit.ly/6jOxB #postrank #opensource http://bit.ly/zHfFW [...]
[...] http://blogs.fsfe.org/myriam/2009/09/compiling-amarok-from-git-locally-full-summary/ a few seconds ago from web [...]