Saturday, October 24, 2009

Installing Amaork 1.4 in KDE 4 (Kubuntu 9.10)

As per my previous post, playlist functionality was disappointing in amarok 2.x, so here's a brief tutorial on how to get it working in 9.10 (could work in 9.04 and others I'm assuming too). I am using the command line only, so a user should be somewhat familiar with using it, and installing packages via apt with it, as well as compiling sources.

(Please note, this may break your amarok 2.x application:
amarok: symbol lookup error: /usr/lib/ undefined symbol: _ZTIN6TagLib3MP44FileE , and I can no longer import a collection into amarok 1.4. LastFM does not seem to work.)

Amarok 1.4 source:

1. Install.
You will need -dev packages for compiling. Some of these include: kdelibs-dev, kde-devel, xorg-dev, qt3 and qt4 -dev packages, build-essentials, gcc 4.3 or 4.4 (I'm also assuming you have g++ 4.3 or 4.4), and others that may crop up. There are forums that contain the packages you need to install.

( mentions the following packages to install)

sudo apt-get install cdbs comerr-dev diffstat fdupes gawk gettext-kde kdelibs4-dev kdesdk-scripts libaa1-dev libacl1-dev libart-2.0-dev libasound2-dev libaspell-dev libattr1-dev libaudio-dev libaudiofile-dev libavahi-client-dev libavahi-common-dev libavahi-qt3-dev libbz2-dev libcaca-dev libcucul-dev libcups2-dev libcupsys2-dev libcurl4-gnutls-dev libdbus-qt-1-dev libdirectfb-dev libdirectfb-extra libesd0-dev libfftw3-dev libflac-dev libgcrypt11-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls-dev libgpg-error-dev libidn11-dev libifp-dev libilmbase-dev libjasper-dev libjpeg62-dev libkadm55 libkrb5-dev liblcms1-dev libldap2-dev liblua50-dev liblualib50-dev libmad0-dev libmng-dev libmpcdec-dev libmtp-dev libmusicbrainz4-dev libmysqlclient15-dev libncurses5-dev libnjb-dev libofa0-dev libogg-dev libopenexr-dev libpcre3-dev libpq-dev libqt3-compat-headers libqt3-headers libqt3-mt-dev libsasl2-dev libsdl1.2-dev libslang2-dev libsqlite3-dev libssl-dev libsysfs-dev libtag1-dev libtasn1-3-dev libtiff4-dev libtiffxx0c2 libtunepimp-dev libusb-dev libvisual-0.4-dev libvorbis-dev libxine-dev libxml2-dev libxmu-dev libxmu-headers libxslt1-dev lua50 mesa-common-dev qt3-dev-tools quilt ruby1.8-dev

I'd recommend viewing the blog as it has a lot of info regarding amarok 1.4.

Another quick mention: MTP. This will give you grief unless you have the right version. The issue is, you need to downgrade to in order for this to work.
This one should be an easy .configure/make/make install (as root)

You will also need xine, and might need to compile it from source as well (I did)

2. Ruby.
This one deserves its own point, because it may give you a lot of grief. Install Ruby1.8 or higher (I used Ruby1.9.1) as well as having the rubyfull and ruby (ruby-dev) packages. If amarok is still spitting out some ruby header errors, then do the following:

sudo apt-get install --reinstall ruby

That fixed it for me, but make sure you have ruby installed.

3. Configure.
I'm assuming you have the source extracted, packages installed, and are ready to configure. First, my recommendations:
./configure --without-arts --program-suffix=-1.4
(I didn't add this, but you probably should. '--enable-mysql')

Don't build with arts, as 9.10 and other new-ish versions tend to use xine and pulse.
I added the prefix so I can run both amarok 2.x and amarok 1.4.10.
Be sure to google any errors that occur, many of them are self-explainatory.

4. Make
Here's where you will need to know if you have gcc 4.3 or gcc 4.4.
According to an Arch package report, having the updated 4.4 version will require some cpp file editing.

It's not too difficult even for noobs, but definitely detracts from the experience. Make-ing is the last difficult part of installing amarok 1.4.x.

If compiling with gcc-4.4 and up (as I did), some .cpp files will create errors so you have to add '#include ' to those classes (at the top of the file, I put them before the other include statements) OR '#include ' if that fails. (you may get this error: "error: 'rename' is not a member of 'std'", and including stdio.h will not fix it).
If you are using gcc-4.3, this shouldn't be an issue, but I have not tried it.
I edited approximately 8 .cpp files total. (you can use kate, nano, or any text editor.)

Once make-ing is done, then type

sudo make install

This should go without a hitch.
To run amarok, you MUST call amarokapp-1.4 (program suffix = -1.4, remember)
not amarok-1.4.

One issue I encountered is that the default .ogg file with Matthias's 15 second clip did not play. I already had installed mp3 codec support by running amarok 2's install script so mp3s play great. If I have any issues along the way to using 1.4 now, I'll post them on this blog.

I hope this helps many users hoping to regain the functionality of a quality audio player.
I am not going to test a lot of extra functionality, mostly playlist, tagging, and support.

You can comment or e-mail me if you'd like a hand, but don't expect a solution.

Anyway, cheers all.

EDIT: Just as a point of interest, amarok2 saves playlists in a .xspf format, which is why the amarok1.4 'm3u' extension is not found. I heard that when a collection is being updated, any playlists should be automatically added. I added the playlists to the /home/$USER/.kde/share/apps/amarok/playlists folder after I updated my audio, which could explain it. But I'm sure you diehard 1.4 fans don't mind.


DUDE said...

I have problem ruby.h is missing ... I cant locate it to.. sudo apt-get install --reinstall ruby doesnt fix it either

Fish said...

Yes, I've also edited sources when compiled it on Kubuntu Lucid.

to DUDE: you also should install ruby headers