spotify: 0.9.17.1 -> 1.0.19.106

changes by @globin:
used wrapper instead of propagatedUserEnvPkgs for zenity

closes #12191

Signed-off-by: Robin Gloster <mail@glob.in>

authored by

Christopher Lübbemeier and committed by
Robin Gloster
ebd1a4ca ff837f92

+19 -95
+19 -29
pkgs/applications/audio/spotify/default.nix
··· 1 - { fetchurl, stdenv, dpkg, xorg, qt4, alsaLib, makeWrapper, openssl_1_0_1, freetype 2 , glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf 3 - , libgcrypt, chromium, udev, fontconfig 4 - , dbus, expat, ffmpeg_0_10 }: 5 6 assert stdenv.system == "x86_64-linux"; 7 8 let 9 - version = "0.9.17.1.g9b85d43.7"; 10 11 deps = [ 12 alsaLib 13 atk 14 cairo 15 cups 16 dbus 17 expat 18 ffmpeg_0_10 ··· 26 libpng 27 nss 28 pango 29 - qt4 30 stdenv.cc.cc 31 udev 32 xorg.libX11 33 xorg.libXcomposite 34 xorg.libXdamage 35 xorg.libXext 36 xorg.libXfixes 37 xorg.libXi 38 xorg.libXrandr 39 xorg.libXrender 40 - xorg.libXrender 41 xorg.libXScrnSaver 42 ]; 43 44 in ··· 48 49 src = 50 fetchurl { 51 - url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}-1_amd64.deb"; 52 - sha256 = "0x87q7gd2997sgppsm4lmdiz1cm11x5vnd5c34nqb5d4ry5qfyki"; 53 }; 54 55 buildInputs = [ dpkg makeWrapper ]; ··· 61 libdir=$out/lib/spotify 62 mkdir -p $libdir 63 dpkg-deb -x $src $out 64 - mv $out/opt/spotify/* $out/ 65 - rm -rf $out/usr $out/opt 66 67 # Work around Spotify referring to a specific minor version of 68 # OpenSSL. ··· 72 ln -s ${nspr}/lib/libnspr4.so $libdir/libnspr4.so 73 ln -s ${nspr}/lib/libplc4.so $libdir/libplc4.so 74 75 - mkdir -p $out/bin 76 - 77 - rpath="$out/spotify-client/Data:$libdir:$out/spotify-client:${stdenv.cc.cc}/lib64" 78 - 79 - ln -s $out/spotify-client/spotify $out/bin/spotify 80 - 81 - patchelf \ 82 - --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 83 - --set-rpath $rpath $out/spotify-client/spotify 84 85 patchelf \ 86 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 87 - --set-rpath $rpath $out/spotify-client/Data/SpotifyHelper 88 89 - preload=$out/libexec/spotify/libpreload.so 90 librarypath="${stdenv.lib.makeLibraryPath deps}:$libdir" 91 - mkdir -p $out/libexec/spotify 92 - gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC 93 - 94 - wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "$librarypath" 95 - wrapProgram $out/spotify-client/Data/SpotifyHelper --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "$librarypath" 96 97 # Desktop file 98 mkdir -p "$out/share/applications/" 99 - cp "$out/spotify-client/spotify.desktop" "$out/share/applications/" 100 - sed -i "s|Icon=.*|Icon=$out/spotify-client/Icons/spotify-linux-512.png|" "$out/share/applications/spotify.desktop" 101 - ''; # */ 102 103 dontStrip = true; 104 dontPatchELF = true;
··· 1 + { fetchurl, stdenv, dpkg, xorg, alsaLib, makeWrapper, openssl_1_0_1, freetype 2 , glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf 3 + , libgcrypt, udev, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome }: 4 5 assert stdenv.system == "x86_64-linux"; 6 7 let 8 + version = "1.0.19.106.gb8a7150f"; 9 10 deps = [ 11 alsaLib 12 atk 13 cairo 14 cups 15 + curl 16 dbus 17 expat 18 ffmpeg_0_10 ··· 26 libpng 27 nss 28 pango 29 stdenv.cc.cc 30 udev 31 xorg.libX11 32 xorg.libXcomposite 33 + xorg.libXcursor 34 xorg.libXdamage 35 xorg.libXext 36 xorg.libXfixes 37 xorg.libXi 38 xorg.libXrandr 39 xorg.libXrender 40 xorg.libXScrnSaver 41 + xorg.libXtst 42 + zlib 43 ]; 44 45 in ··· 49 50 src = 51 fetchurl { 52 + url = "http://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_${version}_amd64.deb"; 53 + sha256 = "be6b99329bb2fccdc9d77bc949dd463576fdb40db7f56195b4284bd348c470be"; 54 }; 55 56 buildInputs = [ dpkg makeWrapper ]; ··· 62 libdir=$out/lib/spotify 63 mkdir -p $libdir 64 dpkg-deb -x $src $out 65 + mv $out/usr/* $out/ 66 + rm -rf $out/usr 67 68 # Work around Spotify referring to a specific minor version of 69 # OpenSSL. ··· 73 ln -s ${nspr}/lib/libnspr4.so $libdir/libnspr4.so 74 ln -s ${nspr}/lib/libplc4.so $libdir/libplc4.so 75 76 + rpath="$out/share/spotify:$libdir" 77 78 patchelf \ 79 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 80 + --set-rpath $rpath $out/share/spotify/spotify 81 82 librarypath="${stdenv.lib.makeLibraryPath deps}:$libdir" 83 + wrapProgram $out/share/spotify/spotify \ 84 + --prefix LD_LIBRARY_PATH : "$librarypath" \ 85 + --prefix PATH : "${gnome.zenity}/bin" 86 87 # Desktop file 88 mkdir -p "$out/share/applications/" 89 + cp "$out/share/spotify/spotify.desktop" "$out/share/applications/" 90 + sed -i "s|Icon=.*|Icon=$out/share/spotify/Icons/spotify-linux-512.png|" "$out/share/applications/spotify.desktop" 91 + ''; 92 93 dontStrip = true; 94 dontPatchELF = true;
-66
pkgs/applications/audio/spotify/preload.c
··· 1 - /* Spotify looks for its theme data in /usr/share/spotify/theme. This 2 - LD_PRELOAD library intercepts open() and stat() calls to redirect 3 - them to the corresponding location in $out. */ 4 - 5 - #define _GNU_SOURCE 6 - #include <stdio.h> 7 - #include <stdarg.h> 8 - #include <stdlib.h> 9 - #include <dlfcn.h> 10 - #include <sys/types.h> 11 - #include <sys/stat.h> 12 - #include <fcntl.h> 13 - #include <limits.h> 14 - 15 - char themeDir [] = "/usr/share/spotify/theme"; 16 - char realThemeDir [] = OUT "/share/spotify/theme"; 17 - 18 - const char * rewrite(const char * path, char * buf) 19 - { 20 - if (strncmp(path, themeDir, sizeof(themeDir) - 1) != 0) return path; 21 - if (snprintf(buf, PATH_MAX, "%s%s", realThemeDir, path + sizeof(themeDir) - 1) >= PATH_MAX) 22 - abort(); 23 - return buf; 24 - } 25 - 26 - int open(const char *path, int flags, ...) 27 - { 28 - char buf[PATH_MAX]; 29 - int (*_open) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open"); 30 - mode_t mode = 0; 31 - if (flags & O_CREAT) { 32 - va_list ap; 33 - va_start(ap, flags); 34 - mode = va_arg(ap, mode_t); 35 - va_end(ap); 36 - } 37 - return _open(rewrite(path, buf), flags, mode); 38 - } 39 - 40 - int open64(const char *path, int flags, ...) 41 - { 42 - char buf[PATH_MAX]; 43 - int (*_open64) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open64"); 44 - mode_t mode = 0; 45 - if (flags & O_CREAT) { 46 - va_list ap; 47 - va_start(ap, flags); 48 - mode = va_arg(ap, mode_t); 49 - va_end(ap); 50 - } 51 - return _open64(rewrite(path, buf), flags, mode); 52 - } 53 - 54 - int __xstat64(int ver, const char *path, struct stat64 *st) 55 - { 56 - char buf[PATH_MAX]; 57 - int (*___xstat64) (int ver, const char *, struct stat64 *) = dlsym(RTLD_NEXT, "__xstat64"); 58 - return ___xstat64(ver, rewrite(path, buf), st); 59 - } 60 - 61 - int access(const char *path, int mode) 62 - { 63 - char buf[PATH_MAX]; 64 - int (*_access) (const char *path, int mode) = dlsym(RTLD_NEXT, "access"); 65 - return _access(rewrite(path, buf), mode); 66 - }
···