Skip to content

How to build the latest Tomahawk Player on Ubuntu 11.04

Tomahawk Player Banner

Tomahawk Player is a next generation music player. It features custom stations (building upon the beatuiful Echo Nest), a playlist importer, social connection to Twitter, Google Chat, and Jabber. Maybe most important of all: It's able to find and pull music from different sources like YouTube, last.fm, SoundCloud, Skreemr, Spotify, and more using the Playdar approach. Of course, it can also play songs from your local library. Make sure to check out the video if you like to know more.

First a word of warning: Tomahawk is still beta, version 0.1.0 is the most current release, but there's no PPA yet for Ubuntu systems. The instructions in the wiki are for Maverick and didn't work for me. That's why I thought I write a short tutorial on how to compile Tomahawk Player on Ubuntu 11.04 (Natty Narwhal).

Update: No need to build version 0.1.0 yourself anymore if you are on Ubuntu 11.04, because the PPA has been updated! Just add ppa:paulo-miguel-dias/tomahawk to your sources, update, and install. In more detail:

sudo add-apt-repository ppa:paulo-miguel-dias/tomahawk
sudo aptitude update
sudo aptitude install tomahawk

Meet the dependencies

First of all, make sure you have all the dependencies installed. I am not 100% sure if the following list is complete because I might have already had some of the necessary libs on my system. Anyway:

sudo apt-get install build-essential cmake libtag1c2a libtag1-dev libqt4-dev libqt4-sql-sqlite \
    libphonon-dev libboost-dev zlib1g-dev libqjson-dev libz-dev \
    libqca2-dev pkg-config git-core phonon-backend-gstreamer

This should install all required packages. More experienced users could als try a different backend for phonon.

Furthermore, libechonest and Clucene are prerequesites for Tomahawk, so download the latest tarball from https://projects.kde.org/projects/playground/libs/libechonest/ and extract it. Step into the new directory libechonest-* and run these commands:

mkdir build && cd build
cmake ..
make
sudo make install

Now, clone CLucene from their git repository and install it:

git clone git://clucene.git.sourceforge.net/gitroot/clucene/clucene
cd clucene && mkdir build && cd build
cmake ..
make
sudo make install

Resolvers

Resolvers are small plugins to Tomahawk that enable the player to search and stream music from differen sources. There's already a collection of resolvers for a number of third-party services which can be used.

git clone https://github.com/tomahawk-player/tomahawk-resolvers.git

That's it for now, I show you how to enable various resolvers once we got the player up and running.

Optional Spotify support

If you live in a country where you have access to Spotify, you might want Tomahawk Player be able to stream music directly from this wonderful service. In order to do so, download the archive for your architecture from http://developer.spotify.com/en/libspotify/overview/ and extract it.

cd libspotify-*-linux*
sudo make install prefix=/usr/local

Now, cd into the tomahawk-resolvers directory that was created in the last step.

cd spotify
mkdir build && cd build
cmake ..
make

there should be an executable spotify_tomahawkresolver in the build directory. You can leave it there for the time being.

Build the actual player

Let's compile the Tomahawk Player itself alreaddy:

git clone https://github.com/tomahawk-player/tomahawk.git
cd tomahawk
git submodule init && git submodule update
mkdir build && cd build
cmake -DINTERNAL_JREEN=ON -DINTERNAL_QTWEETLIB=ON ..
make

You can probably go and drink a cup of coffee because the process takes a while ;-)

After this has finished, it's time to run the player for the first time: ./tomahawk. You can set up the location of your local music collection, you can enter various accounts, and you can add resolvers. In order to do so from the Tomahawk settings dialog, klick and the add button, navigate into the respective directory beneath tomahawk-resolvers, and select the *.js/*.py/*.php file or the above-mentioned spotify_tomahawkresolver executable. Play around with your new player a little to get to know all of its features.

Enjoy the future of music listening today!

Update: According to domme's comment, libgnutls-dev libgloox-dev are not required anymore, so I removed them from the instructions.

Selenium Tests mit NetBeans und PHP

Selenium-Tests können elegant direkt in NetBeans für PHP erstellt und aus NetBeans heraus ausgeführt werden. Leider funktioniert das unter bestimmten Umständen nicht out-of-the-box, sondern macht einige Kniffe notwendig.

NetBeans-Plugin installieren

Ich gehe davon aus, dass ihr alles notwendige für die PHP-Entwicklung installiert habt. Das schließt PHPUnit ein, auf das die Selenium-Tests zurückgreifen. Wie man Selenium in PHPUnit integriert, wird hier ausführlich beschrieben.

Auf meinem Ubuntu-Rechner mit NetBeans 6.9.1 und Firefox 3.6.12 lässt sich das Selenium Module for PHP aus dem NetBeans Beta-Repository einfach installieren: Unter "Extras > Plugins > Einstellungen" das Häkchen bei "NetBeans Beta" setzen, dann steht das Selenium-Modul zur Auswahl und kann installiert werden. Anschließend lässt sich nach Rechtsklick auf das Projekt im Projektmanager der Punkt "Run Selenium Tests" aus dem Kontextmenü auswählen. Zunächst muss ein Verzeichnis ausgewählt werden, in dem die Testdateien abgelegt werden. Ich habe den Ordner selenium direkt neben nbprojects in meinem Projektverzeichnis angelegt und als Testverzeichnis ausgewählt.

Da wir noch keine Testdateien erstellt haben, wird auch noch nichts ausgeführt, aber das Verzeichnis wird als Selenium Test Files aufgeführt. Wiederum über das "Kontextmenü > Neu" kann jetzt ein "Selenium Test Case for PHP" erstellt werden. Dabei legt NetBeans freundlicherweise schon das Code-Gerüst für den neuen Test-Case an. Natürlich kann, wer möchte, auch manuell Test-Cases im Test-Verzeichnis anlegen oder den PHP-Code aus der Selenium IDE (= Firefox-Extension) herausgenerieren lassen. Die NetBeans-Vorlage sieht etwa wie folgt aus.

require_once 'PHPUnit/Extensions/SeleniumTestCase.php';

class newSeleneseTest extends PHPUnit_Extensions_SeleniumTestCase
{
    protected function setUp()
    {
        $this->setBrowser("*chrome");
        $this->setBrowserUrl("http://change-this-to-the-site-you-are-testing/");
    }

    public function testMyTestCase()
    {
        
    }
}

Unabhängig davon, welchen Test man in testMyTestCase() implementieren möchte, gilt es jetzt noch einige Stolpersteine aus dem Weg zu räumen.

"Selenium Tests mit NetBeans und PHP" vollständig lesen

Serendipity Screencasts

If you (plan to) use the Serendipity blog software and understand German, then there is a great new resource for you. Serendipity Help is a small but hopefully fast growing collection of screencasts put together by Reinhard Linnemann. Right now, you can find tutorials on the installation process, on the first time you log in, and on Spartacus, the mighty plugin management tool. Reinhard has done a great job in creating these tutorials. Even if don't know German, you might find the screencasts useful.

If you're interested in contributing screencasts, please do so and read this forum discussion for more information. I will also try to produce some screencasts with the help of the wonderful Istanbul. Or maybe I give xvidcap or Wink a try.