Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old March 22nd, 2009   #1
hyper_ch
Day Old Decaf
 
Join Date: Jun 2006
Location: Switzerland
My beans are hidden!
Kubuntu Jaunty Jackalope (testing)
HOWTO: Compile Amarok 2 from SVN

HOWTO: Compile Amarok 2 from SVN


Introduction

Amarok is a pretty nifty and advance music player for the KDE desktop. However the current version in the *buntu 8.10 repos is hopelessly outdated and (IMHO) totally bugged. There's also the Amarok Neon Project, which aims at providing daily SVN builds for *buntu however lately they have not been updated. So, if you want to be up-to-date with latest Amarok development you either wait until the Neon Project provides binaries again or you compile it on your own. If you want to compile it on your own, you require KDE 4.2. There are also PPA repos for that, use my generator http://repogen.simplylinux.ch to get the according info.

The following howto will feature a few more things than are necessary. I like especially to add the medibuntu repos so that together with kubuntu-restricted-extras I have codecs for just about everyting. The package I install from medibuntu in this howto is the w32codecs (or w64codecs if you are on a 64bit OS).

I tested this howto on a vanilla Kubuntu 8.10 install. Depending on how you modified your system over time you will need to adjust a few things.

Thanks goes to markey and mamarok in the #amarok channel in irc.freenode.org. Also the groundwork for this howto are the following two pages:
http://amarok.kde.org/blog/archives/...directory.html
http://amarok.kde.org/wiki/Development/MySQL_Embedded


Step 1: Remove current amarok installation


JAUNTY USERS: Have a look at this post here: http://ubuntuforums.org/showpost.php...5&postcount=12


Code:
sudo apt-get purge amarok amarok-common amarok-engine-xine
Instead of "purge" you can also use "remove". The difference is that purge will delete config and user data files (e.g. your statistics and stuff) - you may want to make a backup first.


Step 2: Update your sources.list

You can use my repo generator: http://repogen.simplylinux.ch . It's important that you select the "main, restricted, universe, multiverse" branches, the "security, updates, proposed, backport" updates and the "KDE 4.2 PPA, Medibuntu" 3rd party repos. Medibuntu isn't required but it's recommended (although some people don't like it /me glances at HymnToLife).

That should generate a list like this:

Code:
#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################

###### Ubuntu Main Repos
deb http://ch.archive.ubuntu.com/ubuntu/ intrepid main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://ch.archive.ubuntu.com/ubuntu/ intrepid-security main restricted universe multiverse 
deb http://ch.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted universe multiverse 
deb http://ch.archive.ubuntu.com/ubuntu/ intrepid-proposed main restricted universe multiverse 
deb http://ch.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse 

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu intrepid partner

##############################################################
##################### UNOFFICIAL  REPOS ######################
##############################################################

###### 3rd Party Binary Repos

#### KDE 4.2 PPA Repos - http://www.kubuntu.org/news/kde-4.2
## Run this command: gpg --keyserver keyserver.ubuntu.com --recv-keys 493B3065 && gpg --export -a 493B3065 | sudo apt-key add -
deb http://ppa.launchpad.net/kubuntu-experimental/ubuntu intrepid main

#### Medibuntu - http://www.medibuntu.org/
## Run this command: sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
deb http://packages.medibuntu.org/ intrepid free non-free
Replace your /etc/apt/sources.list with this list above (or your own) or add the missing parts to it.

Finally you just need to import that gpg keys to get rid of the error message that would appear otherwise:

Code:
gpg --keyserver keyserver.ubuntu.com --recv-keys 493B3065 && gpg --export -a 493B3065 | sudo apt-key add -
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

Step 3: Upgrade

After you added the KDE 4.2 repos you need to upgrade your system:

Code:
sudo apt-get dist-upgrade
And then remove the obsolete dependencies (not necessary but recommended):

Code:
sudo apt-get autoremove

Step 4: Reboot

Reboot your system:

Code:
sudo reboot

Step 5: Installe required packages

Now install the required packages. If you're on 64-bit then use the w64codecs package instead of the w32codecs one.:

Code:
sudo apt-get install kubuntu-restricted-extras w32codecs build-essential kde-devel subversion libmysqlclient15-dev libncurses5-dev libtag1-dev libstrigiqtdbusclient-dev

Step 6: Extend your .bashrc and myenv.sh

You need to extend your .bashrc and myenv.sh files with a few things. Just run those commands:

Code:
echo '' >> ${HOME}/.bashrc
echo 'export PATH=$HOME/kde/bin:$PATH' >> ${HOME}/.bashrc
mkdir -p ${HOME}/.kde/env
touch ${HOME}/.kde/env/myenv.sh
echo '' >> ${HOME}/.kde/env/myenv.sh
echo 'export KDEDIR=$HOME/kde' >> ${HOME}/.kde/env/myenv.sh
echo 'export KDEDIRS=$KDEDIR' >> ${HOME}/.kde/env/myenv.sh
Non-KDE users need to run this code instead:
Code:
echo '' >> ${HOME}/.bashrc
echo 'export PATH=$HOME/kde/bin:$PATH' >> ${HOME}/.bashrc
echo 'export KDEDIR=$HOME/kde' >> ${HOME}/.bashrc
echo 'export KDEDIRS=$KDEDIR' >> ${HOME}/.bashrc

And verify whether those were really added:

Code:
cat ${HOME}/.bashrc
cat ${HOME}/.kde/env/myenv.sh
Non-KDE users just run the first command.

Step 7: Reload your .bashrc

Reload your .bashrc:

Code:
source ${HOME}/.bashrc

Step 8: Created required folders

Create the required folders:

Code:
mkdir -p ${HOME}/kde/src
mkdir -p ${HOME}/kde/build/amarok

Step 9: Download amarok and taglib-extras by svn

Download Amarok and libtag-extras by issuing these commands:

Code:
cd ${HOME}/kde/src
svn co svn://anonsvn.kde.org/home/kde/trunk/extragear/multimedia/amarok amarok
svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib-extras/ taglib-extras
At the time I did this I checked out revision 942886.


Step 10: Download MySQL

MySQL is now integrated in Amarok 2 directly, this means we require the source for it. You can download MySQL here http://dev.mysql.com/downloads/mysql/5.1.html#source (select the tar.gz version). The current version is 5.1.32 and for the next commands to be correct you need to change the version number accordingly if you use a newer one. If you opt to manually download MySQL then download it to: ${HOME}/kde/src

Or you can just follow those commands below to get the MySQL source into the proper place:

Code:
cd ${HOME}/kde/src
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.32.tar.gz/from/http://mirror.switch.ch/ftp/mirror/mysql/

Step 11: Extract and compile MySQL

As said before, if you use a different version, you need to alter the version number in the following steps:


Code:
tar xzvf mysql-5.1.32.tar.gz
cd mysql-5.1.32
cp -R ${HOME}/kde/src/amarok/supplementary_scripts/mysqle/* .
In case you got a multicore cpu or more cpus then you can change the number of cores to be used to compile. If you have a dual core then set the option below to "-j3". If you have a quadcore set it to "-j5". In rare cases there are problems by using multicore; if that's the case then just set it to "-j1":

Code:
export MAKEOPTS=-j2
Now you can compile MySQL:

Code:
./build-mysqle.sh --prefix=${HOME}/usr

Step 12: compile taglib-extras

This has lately been moved out of the amarok svn and needs to be compiled on its own. Run the following steps:

Code:
cd ${HOME}/kde/src/taglib-extras/
mkdir build
cd build
export LD_LIBRARY_PATH=${HOME}/kde/build/taglib-extras/taglib-extras
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/kde ..
make
make install

Step 13: Compile QtScriptGenerator

This is another part that was recently moved out of the amarok svn and there are still a few issues with it. Just run the code below or download newer versions at http://code.google.com/p/qtscriptgen...downloads/list :

Code:
cd ${HOME}/kde/src
wget http://qtscriptgenerator.googlecode.com/files/qtscriptgenerator-src-0.1.0.tar.gz
tar xfvz qtscriptgenerator-src-0.1.0.tar.gz
cd qtscriptgenerator-src-0.1.0
The current version 0.1.0 has a few issues with *buntu. Because of that you need to patch it by running the following from the qtscriptgenerator-0.1.0 directory:

Code:
nano include_everything.patch
And add this code to it:

Code:
--- b/generator/qtscript_masterinclude.h	2009-03-21 20:37:30.719523909 -0400
+++ a/generator/qtscript_masterinclude.h	2009-03-21 21:00:25.108149339 -0400
@@ -31,17 +31,41 @@
 
 #include <QtUiTools/QtUiTools>
 
-#ifndef QT_NO_XMLPATTERNS
-#  include <QtXmlPatterns/QtXmlPatterns>
-#endif
-
-#ifndef QT_NO_WEBKIT
-#  include <QtWebKit/QtWebKit>
-#endif
-
-#ifndef QT_NO_PHONON
-#  include <phonon/phonon>
-#endif
+#include <QtXmlPatterns/QtXmlPatterns>                                                              
+
+#include <QtWebKit/QtWebKit>                                                                        
+                                                                                                    
+#include "phonon/abstractaudiooutput.h"                                                             
+#include "phonon/abstractmediastream.h"                                                             
+#include "phonon/abstractvideooutput.h"                                                             
+#include "phonon/addoninterface.h"                                                                  
+#include "phonon/audiooutput.h"                                                                     
+#include "phonon/audiooutputinterface.h"                                                            
+#include "phonon/backendcapabilities.h"                                                             
+#include "phonon/backendinterface.h"
+#include "phonon/effect.h"
+#include "phonon/effectinterface.h"
+#include "phonon/effectparameter.h"
+#include "phonon/effectwidget.h"
+#include "phonon/mediacontroller.h"
+#include "phonon/medianode.h"
+#include "phonon/mediaobject.h"
+#include "phonon/mediaobjectinterface.h"
+#include "phonon/mediasource.h"
+#include "phonon/objectdescription.h"
+#include "phonon/objectdescriptionmodel.h"
+#include "phonon/path.h"
+#include "phonon/phonondefs.h"
+#include "phonon/phononnamespace.h"
+#include "phonon/platformplugin.h"
+#include "phonon/seekslider.h"
+#include "phonon/streaminterface.h"
+#include "phonon/videoplayer.h"
+#include "phonon/videowidget.h"
+#include "phonon/videowidgetinterface.h"
+#include "phonon/volumefadereffect.h"
+#include "phonon/volumefaderinterface.h"
+#include "phonon/volumeslider.h"
 
 #include "../qtbindings/qtscript_core/qtscriptconcurrent.h"
Now run the following command to patch the source:

Code:
patch -p1 < include_everything.patch
Once you've done that, you can compile qtscriptgenerator and the plugings by running the following:

Code:
export INCLUDE=/usr/include/qt4
cd generator
qmake
make
./generator
cd ../qtbindings
qmake
make
Once you're done you'll need to copy the plugins to /usr/lib/qt4/plugins/script:

Code:
cd ../plugins/script
sudo cp -R * /usr/lib/qt4/plugins/script/

Step 14: Compile Amarok 2

Finally we've reached the point where we can compile Amarok 2:

Code:
cd ${HOME}/kde/src/amarok
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/kde -DCMAKE_BUILD_TYPE=debugfull ${HOME}/kde/src/amarok
make
make install
After the cmake you will get a few warnings but compiling and installation should go without errors.


Step 15: Update KDE config

Now you need to update the KDE config:

Code:
kbuildsycoca4 --noincremental

Step 16: Run Amarok 2

Finally you can run Amarok 2 by issuing the following command in the terminal. I have yet to find a way to start it from the menu.:

Code:
amarok

Last edited by hyper_ch; April 13th, 2009 at 11:04 AM.. Reason: typing errors
hyper_ch is offline   Reply With Quote
Old April 3rd, 2009   #2
linleno
First Cup of Ubuntu
 
Join Date: Nov 2008
Beans: 2
Re: HOWTO: Compile Amarok 2 from SVN

This howto also works on Kubuntu Jaunty.
Thanks hyper_ch for this great howto!
linleno is offline   Reply With Quote
Old April 3rd, 2009   #3
hyper_ch
Day Old Decaf
 
Join Date: Jun 2006
Location: Switzerland
My beans are hidden!
Kubuntu Jaunty Jackalope (testing)
Re: HOWTO: Compile Amarok 2 from SVN

of course, on jaunty you need to have the jaunty repos (and not intrepid ones as in the howto) however they can easily be created by my tool
hyper_ch is offline   Reply With Quote
Old April 3rd, 2009   #4
binbash
Skinny Extra Sweet Ubuntu
 
binbash's Avatar
 
Join Date: Sep 2006
Beans: 3,172
Ubuntu Karmic Koala (testing)
Re: HOWTO: Compile Amarok 2 from SVN

Excellent howto, thanks
binbash is offline   Reply With Quote
Old April 3rd, 2009   #5
linleno
First Cup of Ubuntu
 
Join Date: Nov 2008
Beans: 2
Re: HOWTO: Compile Amarok 2 from SVN

BTW If someone also need to use ipod support, you may also need to have libgpod 0.7.0 installed. You could easily install the apt package "libgpod-common", "libgpod4-dev" and "libgpod4" in Jaunty. Not sure for other distro or previous k/ubuntu release.

sudo apt-get install libgpod-common libgpod4-dev libgpod4
linleno is offline   Reply With Quote
Old April 10th, 2009   #6
clintonthegeek
5 Cups of Ubuntu
 
Join Date: Mar 2006
Location: Southern Ontario
Beans: 38
Kubuntu 6.10 Edgy
Send a message via AIM to clintonthegeek Send a message via MSN to clintonthegeek Send a message via Yahoo to clintonthegeek
Re: HOWTO: Compile Amarok 2 from SVN

Quote:
Amarok could not find any collection plugins. it is possible that Amarok is installed under the wrong prefix, please fix your installation using:
$ cd /path/to/amarok/source-code/
$ su -c "make uninstall"
$ cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` && su -c "make install"
$ kbuildsycoca4 --noincremental
$ amarok
More information can be found in the README file. For further assistance join us at #amarok on irc.freenode.net.
This is what happens when I finally try to run "amarok" from the command line. It appears in a pop-up window after the Amarok splash screen pops up. This is on brand new Jaunty amd64 installation.

I've tried a few different things, but can't figure it out. Any ideas?

edit: Here's the debug output:

Code:
clinton@clinton-desktop:~/kde/src$ amarok --debug
amarok(4805) Phonon::KdePlatformPlugin::createBackend: using backend:  "Xine"
amarok:  ************************************************************************************************************
amarok:  ** DEBUGGING OUTPUT IS NOW ENABLED. PLEASE NOTE THAT YOU WILL ONLY SEE THE FULL OUTPUT ON THE NEXT START. **
amarok:  ************************************************************************************************************
amarok: END__: static void App::handleCliArgs() - Took 0.0004s
amarok: END__: virtual int App::newInstance() - Took 0.00055s
clinton@clinton-desktop:~/kde/src$ amarok: [PluginManager] Plugin trader constraint:  "[X-KDE-Amarok-framework-version] == 40 and [X-KDE-Amarok-plugintype] == 'collection' and [X-KDE-Amarok-rank] > 0"
amarok: [CollectionManager] Second attempt: Received [ "0" ] collection plugin offers

Last edited by clintonthegeek; April 10th, 2009 at 03:11 AM..
clintonthegeek is offline   Reply With Quote

Bookmarks

Tags
amarok, compile, svn

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:17 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry