Thursday, January 6, 2011

Native Spotify ebuild for Gentoo

You also love Spotify? Well, it truly is the best thing since the Interwebs, that's for sure!

A lot of Linux users don't know that the wonderful developers over at Spotify are actually releasing early beta builds of their native Linux client. It's not perfect, but for being early-releases it's damn near close! You just have to love those guys...

Anyway, here's an ebuild I've completely stolen from dstien a couple of months ago, and then updated to new versions as they've come out. I've added the Pulseaudio dependency (dstien doesn't seen to have done that yet) since the previous version didn't work without it).

Ebuild:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

DESCRIPTION="Spotify desktop client"
HOMEPAGE="http://www.spotify.com/"

LICENSE="Spotify"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gnome"

MY_PV="${PV}.g604b4fb-1"
MY_P="${PN}-client-qt_${MY_PV}"

SRC_BASE="http://repository.spotify.com/pool/non-free/${PN:0:1}/${PN}/"
SRC_URI="
    x86?   ( ${SRC_BASE}${MY_P}_i386.deb )
    amd64? ( ${SRC_BASE}${MY_P}_amd64.deb )
    gnome? ( ${SRC_BASE}${PN}-client-gnome-support_${MY_PV}_all.deb )
    "

RDEPEND="
    >=media-libs/alsa-lib-1.0.14
    >=media-sound/pulseaudio-0.9.21
    >=sys-devel/gcc-4.0
    >=sys-libs/glibc-2.6
    >=x11-libs/qt-core-4.5
    >=x11-libs/qt-dbus-4.5
    >=x11-libs/qt-gui-4.5
    >=x11-libs/qt-webkit-4.5
    "

RESTRICT="mirror strip"

src_unpack() {
    for MY_A in ${A}; do
        unpack ${MY_A}
        unpack ./data.tar.gz
    done
}

src_install() {
    mv "${WORKDIR}"/usr "${D}" || die "Install failed"
}
Just copy this into an empty file within your portage overlay (for example /usr/local/portage/) in the media-sound directary, go into the directory and run

> ebuild spotify-0.4.9.302.ebuild digest

and then you're ready to go! Should be at least ;)