2011-09-23 17:37:15 +02:00
|
|
|
{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl }:
|
2011-01-06 00:23:22 +01:00
|
|
|
|
2011-01-06 11:17:18 +01:00
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
|
|
|
|
2011-09-23 17:23:30 +02:00
|
|
|
let version = "0.6.1.309"; in
|
2011-01-06 00:23:22 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2011-01-06 11:17:18 +01:00
|
|
|
name = "spotify-${version}";
|
2011-01-06 00:23:22 +01:00
|
|
|
|
2011-01-06 11:17:18 +01:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2011-09-23 17:23:30 +02:00
|
|
|
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client-qt_${version}.gb871a7d-1_i386.deb";
|
|
|
|
sha256 = "01bavmv78vd3lxsinbls72v2sj8czbcwzdg6sc2f9yd5g7snb3im";
|
2011-01-06 11:17:18 +01:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2011-09-23 17:23:30 +02:00
|
|
|
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client-qt_${version}.gb871a7d-1_amd64.deb";
|
|
|
|
sha256 = "13ki1pcpna7f5sxf1j2axww95c4kqhj0r1d11y98mfvzxxjqimjs";
|
2011-01-06 11:17:18 +01:00
|
|
|
}
|
|
|
|
else throw "Spotify not supported on this platform.";
|
2011-01-06 00:23:22 +01:00
|
|
|
|
2011-02-11 12:16:18 +01:00
|
|
|
buildInputs = [ dpkg makeWrapper ];
|
2011-01-06 00:23:22 +01:00
|
|
|
|
|
|
|
unpackPhase = "true";
|
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out
|
|
|
|
dpkg-deb -x $src $out
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
rmdir $out/usr
|
|
|
|
|
2011-09-23 17:37:15 +02:00
|
|
|
# Work around Spotify referring to a specific minor version of
|
|
|
|
# OpenSSL.
|
|
|
|
mkdir $out/lib
|
|
|
|
ln -s ${openssl}/lib/libssl.so $out/lib/libssl.so.0.9.8
|
|
|
|
ln -s ${openssl}/lib/libcrypto.so $out/lib/libcrypto.so.0.9.8
|
|
|
|
|
2011-01-06 00:23:22 +01:00
|
|
|
patchelf \
|
|
|
|
--interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
2011-09-23 17:37:15 +02:00
|
|
|
--set-rpath ${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib openssl stdenv.gcc.gcc ]}:${stdenv.gcc.gcc}/lib64:$out/lib \
|
2011-01-06 00:23:22 +01:00
|
|
|
$out/bin/spotify
|
2011-02-11 12:16:18 +01:00
|
|
|
|
|
|
|
preload=$out/libexec/spotify/libpreload.so
|
|
|
|
mkdir -p $out/libexec/spotify
|
2011-02-11 12:26:40 +01:00
|
|
|
gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
|
2011-02-11 12:16:18 +01:00
|
|
|
|
|
|
|
wrapProgram $out/bin/spotify --set LD_PRELOAD $preload
|
2011-01-06 00:23:22 +01:00
|
|
|
''; # */
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://www.spotify.com/download/previews/;
|
|
|
|
description = "Spotify for Linux allows you to play music from the Spotify music service";
|
|
|
|
license = "unfree";
|
2011-01-06 11:17:18 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
|
|
|
|
|
|
|
longDescription =
|
|
|
|
''
|
|
|
|
Spotify is a digital music streaming service. This package
|
|
|
|
provides the Spotify client for Linux. At present, it does not
|
|
|
|
work with free Spotify accounts; it requires a Premium or
|
|
|
|
Unlimited account.
|
|
|
|
'';
|
2011-01-06 00:23:22 +01:00
|
|
|
};
|
|
|
|
}
|