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="78.gb45d2a6b-10"
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 systray pax_kernel pulseaudio"
19 RESTRICT="mirror strip"
21 DEPEND=">=dev-util/patchelf-0.9_p20180129"
22 # zenity needed for filepicker
35 x11-libs/libXScrnSaver
37 dev-python/pygobject:3
38 dev-python/dbus-python
39 libnotify? ( x11-libs/libnotify )
40 pulseaudio? ( media-sound/pulseaudio )
41 systray? ( gnome-extra/gnome-integration-spotify )"
46 QA_PREBUILT="opt/spotify/spotify-client/spotify"
49 # Fix desktop entry to launch spotify-dbus.py for systray integration
52 -e 's/spotify \%U/spotify-dbus.py \%U/g' \
53 usr/share/spotify/spotify.desktop || die "sed failed"
57 # Spotify links against libcurl-gnutls.so.4, which does not exist in Gentoo.
58 patchelf --replace-needed libcurl-gnutls.so.4 libcurl.so.4 usr/bin/spotify \
59 || die "failed to patch libcurl library dependency"
63 gunzip usr/share/doc/spotify-client/changelog.gz || die
64 dodoc usr/share/doc/spotify-client/changelog
66 SPOTIFY_PKG_HOME=usr/share/spotify
67 insinto /usr/share/pixmaps
68 doins ${SPOTIFY_PKG_HOME}/icons/*.png
70 # install in /opt/spotify
71 SPOTIFY_HOME=/opt/spotify/spotify-client
72 insinto ${SPOTIFY_HOME}
73 doins -r ${SPOTIFY_PKG_HOME}/*
74 fperms +x ${SPOTIFY_HOME}/spotify
77 cat <<-EOF >"${D}"/usr/bin/spotify || die
79 exec ${SPOTIFY_HOME}/spotify "\$@"
81 fperms +x /usr/bin/spotify
84 for size in 16 22 24 32 48 64 128 256 512; do
85 newicon -s ${size} "${S}${SPOTIFY_PKG_HOME}/icons/spotify-linux-${size}.png" \
88 domenu "${S}${SPOTIFY_PKG_HOME}/spotify.desktop"
89 if use pax_kernel; then
90 #create the headers, reset them to default, then paxmark -m them
91 pax-mark C "${ED}${SPOTIFY_HOME}/${PN}" || die
92 pax-mark z "${ED}${SPOTIFY_HOME}/${PN}" || die
93 pax-mark m "${ED}${SPOTIFY_HOME}/${PN}" || die
94 eqawarn "You have set USE=pax_kernel meaning that you intend to run"
95 eqawarn "${PN} under a PaX enabled kernel. To do so, we must modify"
96 eqawarn "the ${PN} binary itself and this *may* lead to breakage! If"
97 eqawarn "you suspect that ${PN} is being broken by this modification,"
98 eqawarn "please open a bug."
103 gnome2_icon_cache_update
104 xdg_mimeinfo_database_update
105 xdg_desktop_database_update
107 ewarn "If Spotify crashes after an upgrade its cache may be corrupt."
108 ewarn "To remove the cache:"
109 ewarn "rm -rf ~/.cache/spotify"
113 gnome2_icon_cache_update
114 xdg_mimeinfo_database_update
115 xdg_desktop_database_update