1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit gnome2-utils pax-utils unpacker xdg-utils
7 DESCRIPTION="Spotify is a social music platform"
8 HOMEPAGE="https://www.spotify.com/ch-de/download/previews/"
9 SRC_BASE="http://repository.spotify.com/pool/non-free/s/${PN}-client/"
10 BUILD_ID_AMD64="237.g378f6f25-11"
12 #SRC_URI="amd64? ( ${SRC_BASE}${PN}-client_${PV}.${BUILD_ID_AMD64}_amd64.deb )
13 # x86? ( ${SRC_BASE}${PN}-client_${PV}.${BUILD_ID_X86}_i386.deb )"
14 SRC_URI="${SRC_BASE}${PN}-client_${PV}.${BUILD_ID_AMD64}_amd64.deb"
18 IUSE="libnotify libressl systray pax_kernel pulseaudio"
19 RESTRICT="mirror strip"
21 DEPEND=">=dev-util/patchelf-0.9_p20180129"
22 # zenity needed for filepicker
24 libressl? ( dev-libs/libressl:0= )
25 !libressl? ( dev-libs/openssl:0= )
36 x11-libs/libXScrnSaver
38 dev-python/pygobject:3
39 dev-python/dbus-python
40 libnotify? ( x11-libs/libnotify )
41 pulseaudio? ( media-sound/pulseaudio )
42 systray? ( gnome-extra/gnome-integration-spotify )"
47 QA_PREBUILT="opt/spotify/spotify-client/spotify"
50 # Fix desktop entry to launch spotify-dbus.py for systray integration
53 -e 's/spotify \%U/spotify-dbus.py \%U/g' \
54 usr/share/spotify/spotify.desktop || die "sed failed"
58 # Spotify links against libcurl-gnutls.so.4, which does not exist in Gentoo.
59 patchelf --replace-needed libcurl-gnutls.so.4 libcurl.so.4 usr/bin/spotify \
60 || die "failed to patch libcurl library dependency"
64 gunzip usr/share/doc/spotify-client/changelog.gz || die
65 dodoc usr/share/doc/spotify-client/changelog
67 SPOTIFY_PKG_HOME=usr/share/spotify
68 insinto /usr/share/pixmaps
69 doins ${SPOTIFY_PKG_HOME}/icons/*.png
71 # install in /opt/spotify
72 SPOTIFY_HOME=/opt/spotify/spotify-client
73 insinto ${SPOTIFY_HOME}
74 doins -r ${SPOTIFY_PKG_HOME}/*
75 fperms +x ${SPOTIFY_HOME}/spotify
78 cat <<-EOF >"${D}"/usr/bin/spotify || die
80 exec ${SPOTIFY_HOME}/spotify "\$@"
82 fperms +x /usr/bin/spotify
85 for size in 16 22 24 32 48 64 128 256 512; do
86 newicon -s ${size} "${S}${SPOTIFY_PKG_HOME}/icons/spotify-linux-${size}.png" \
89 domenu "${S}${SPOTIFY_PKG_HOME}/spotify.desktop"
90 if use pax_kernel; then
91 #create the headers, reset them to default, then paxmark -m them
92 pax-mark C "${ED}${SPOTIFY_HOME}/${PN}" || die
93 pax-mark z "${ED}${SPOTIFY_HOME}/${PN}" || die
94 pax-mark m "${ED}${SPOTIFY_HOME}/${PN}" || die
95 eqawarn "You have set USE=pax_kernel meaning that you intend to run"
96 eqawarn "${PN} under a PaX enabled kernel. To do so, we must modify"
97 eqawarn "the ${PN} binary itself and this *may* lead to breakage! If"
98 eqawarn "you suspect that ${PN} is being broken by this modification,"
99 eqawarn "please open a bug."
104 gnome2_icon_cache_update
105 xdg_mimeinfo_database_update
106 xdg_desktop_database_update
108 ewarn "If Spotify crashes after an upgrade its cache may be corrupt."
109 ewarn "To remove the cache:"
110 ewarn "rm -rf ~/.cache/spotify"
114 gnome2_icon_cache_update
115 xdg_mimeinfo_database_update
116 xdg_desktop_database_update