Initial try to update spotify to version 0.8.4.103. Still need to get rid

of LD_LIBRARY_PATH wrapper, and properly patchelf any libs in the spotify
prefix.
This commit is contained in:
Rob Vermaas 2012-07-02 10:46:30 +02:00
parent 8d1ff12cdc
commit b512e3e934
2 changed files with 42 additions and 12 deletions

View file

@ -1,29 +1,44 @@
{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl }:
{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng12, GConf, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer }:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
let version = "0.8.3.278"; in
let
version = "0.8.4.103";
qt4webkit =
if stdenv.system == "i686-linux" then
fetchurl {
name = "libqtwebkit4_2.2_i386.deb";
url = http://mirrors.us.kernel.org/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_i386.deb;
sha256 = "0hi6cwx2b2cwa4nv5phqqw526lc8p9x7kjkcza9x47ny3npw2924";
}
else
fetchurl {
name = "libqtwebkit4_2.2_amd64.deb";
url = http://ie.archive.ubuntu.com/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_amd64.deb;
sha256 = "0bvy6qz9y19ck391z8c049v07y4vdyvgykpxi7x1nvn078p1imiw";
};
in
stdenv.mkDerivation {
name = "spotify-${version}";
src =
if stdenv.system == "i686-linux" then
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g21c7566.632-1_i386.deb";
sha256 = "7f587585365498c5182bd7f3beafaf511d883102f5cece66cf84f4f94077765b";
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g9cb177b.260-1_i386.deb";
sha256 = "1iri6pgavgb06nx0l3myqryx7zd7cf22my8vh2v6w4kbvaajjl31";
}
else if stdenv.system == "x86_64-linux" then
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g21c7566.632-1_amd64.deb";
sha256 = "a37a13b1c1a8088a811054c732d85b9d6ccf0bd92ad4da75bfee6d70dc344b5e";
url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g9cb177b.260-1_amd64.deb";
sha256 = "0y5kyfa1gk16d9z67hgssam8hgzw6g5f7xsxk0lz3ak487xdwl6k";
}
else throw "Spotify not supported on this platform.";
buildInputs = [ dpkg makeWrapper ];
unpackPhase = "true";
installPhase =
''
mkdir -p $out
@ -36,17 +51,30 @@ stdenv.mkDerivation {
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
ln -s ${nss}/lib/libnss3.so $out/lib/libnss3.so.1d
ln -s ${nss}/lib/libnssutil3.so $out/lib/libnssutil3.so.1d
ln -s ${nss}/lib/libsmime3.so $out/lib/libsmime3.so.1d
ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so.0d
ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so.0d
for f in ${chromium}/libexec/chromium/*; do
ln -s $f $out/bin/$(basename $f)
done
patchelf \
--interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath ${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib openssl stdenv.gcc.gcc ]}:${stdenv.gcc.gcc}/lib64:$out/lib \
--set-rpath $out/lib:$out/share/spotify:${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc freetype glib pango cairo atk gdk_pixbuf gtk GConf cups sqlite]}:${stdenv.gcc.gcc}/lib64 \
$out/bin/spotify
dpkg-deb -x ${qt4webkit} ./
mkdir -p $out/lib/
cp -v usr/lib/*/* $out/lib/
preload=$out/libexec/spotify/libpreload.so
mkdir -p $out/libexec/spotify
gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
wrapProgram $out/bin/spotify --set LD_PRELOAD $preload
wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ GConf libpng12 cups libgcrypt sqlite gst_plugins_base gstreamer]}:$out/lib"
''; # */
dontStrip = true;

View file

@ -7741,7 +7741,9 @@ let
sox = callPackage ../applications/misc/audio/sox { };
spotify = callPackage ../applications/audio/spotify { };
spotify = callPackage ../applications/audio/spotify {
inherit (gnome) GConf;
};
libspotify = callPackage ../development/libraries/libspotify {
apiKey = config.libspotify.apiKey or null;