Gentoo Archives: gentoo-commits

From: Matthew Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/spotify/, media-sound/spotify/files/
Date: Tue, 11 Jan 2022 23:11:59
Message-Id: 1641942710.253b5cce58ee7e965d48da56adc81f5df30d45d3.prometheanfire@gentoo
1 commit: 253b5cce58ee7e965d48da56adc81f5df30d45d3
2 Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
3 AuthorDate: Tue Jan 11 20:54:19 2022 +0000
4 Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 11 23:11:50 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=253b5cce
7
8 media-sound/spotify: Fix POSIX sh violations in the wrapper script
9
10 Adjust the wrapper script template so as to operate correctly in POSIX
11 sh(1), in addition to incorporating some minor quality improvements.
12 Relocate the template to FILESDIR and use envsubst(1) to substitute the
13 SPOTIFY_HOME and LIBDIR variables at the point that the wrapper is
14 generated. Doing so makes it simpler to read and maintain.
15
16 Closes: https://bugs.gentoo.org/831029
17 Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
18 Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>
19
20 media-sound/spotify/files/spotify-wrapper | 23 ++++++
21 media-sound/spotify/spotify-1.1.72-r2.ebuild | 116 +++++++++++++++++++++++++++
22 2 files changed, 139 insertions(+)
23
24 diff --git a/media-sound/spotify/files/spotify-wrapper b/media-sound/spotify/files/spotify-wrapper
25 new file mode 100644
26 index 000000000000..db8f8b948780
27 --- /dev/null
28 +++ b/media-sound/spotify/files/spotify-wrapper
29 @@ -0,0 +1,23 @@
30 +#!/bin/sh
31 +
32 +export LD_LIBRARY_PATH="/usr/$LIBDIR/apulse"
33 +
34 +if command -v spotify-dbus.py > /dev/null; then
35 + echo "Launching spotify with Gnome systray integration."
36 + spotify-dbus.py "$@"
37 +elif command -v spotify-tray > /dev/null; then
38 + echo "Launching spotify with generic systray integration."
39 + minimized=
40 + for arg; do
41 + if [ "$arg" = --minimized ]; then
42 + minimized=$arg
43 + break
44 + fi
45 + done
46 + spotify-tray \
47 + --client-path="$SPOTIFY_HOME/spotify" --toggle $minimized -- "$@"
48 +else
49 + echo "Neither gnome-integration-spotify nor spotify-tray are installed."
50 + echo "Launching spotify without systray integration."
51 + exec "$SPOTIFY_HOME/spotify" "$@"
52 +fi
53
54 diff --git a/media-sound/spotify/spotify-1.1.72-r2.ebuild b/media-sound/spotify/spotify-1.1.72-r2.ebuild
55 new file mode 100644
56 index 000000000000..d3f98c51dd26
57 --- /dev/null
58 +++ b/media-sound/spotify/spotify-1.1.72-r2.ebuild
59 @@ -0,0 +1,116 @@
60 +# Copyright 1999-2022 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=8
64 +
65 +inherit desktop optfeature pax-utils unpacker xdg
66 +
67 +DESCRIPTION="Spotify is a social music platform"
68 +HOMEPAGE="https://www.spotify.com/download/linux/"
69 +SRC_BASE="http://repository.spotify.com/pool/non-free/s/${PN}-client/"
70 +BUILD_ID_AMD64="439.gc253025e"
71 +SRC_URI="${SRC_BASE}${PN}-client_${PV}.${BUILD_ID_AMD64}_amd64.deb"
72 +
73 +LICENSE="Spotify"
74 +SLOT="0"
75 +KEYWORDS="~amd64"
76 +IUSE="libnotify local-playback pax-kernel pulseaudio"
77 +RESTRICT="mirror strip"
78 +
79 +BDEPEND="
80 + >=dev-util/patchelf-0.10
81 + sys-devel/gettext
82 +"
83 +RDEPEND="
84 + dev-libs/nss
85 + dev-python/dbus-python
86 + libnotify? ( x11-libs/libnotify )
87 + dev-libs/openssl:0=
88 + media-libs/alsa-lib
89 + media-libs/fontconfig
90 + media-libs/harfbuzz
91 + media-libs/mesa[X(+)]
92 + net-misc/curl[ssl]
93 + net-print/cups[ssl]
94 + pulseaudio? ( media-sound/pulseaudio )
95 + !pulseaudio? ( media-sound/apulse )
96 + local-playback? ( media-video/ffmpeg:0/56.58.58 )
97 + x11-libs/gtk+:3
98 + app-accessibility/at-spi2-atk
99 + x11-libs/libxkbcommon
100 + x11-libs/libXScrnSaver
101 + x11-libs/libXtst
102 + x11-libs/libSM
103 + x11-libs/libICE
104 +"
105 + #sys-libs/glibc
106 +
107 +S="${WORKDIR}/"
108 +
109 +QA_PREBUILT="
110 + opt/spotify/spotify-client/spotify
111 + opt/spotify/spotify-client/libEGL.so
112 + opt/spotify/spotify-client/libGLESv2.so
113 + opt/spotify/spotify-client/libcef.so
114 + opt/spotify/spotify-client/libvk_swiftshader.so
115 + opt/spotify/spotify-client/libvulkan.so.1
116 + opt/spotify/spotify-client/swiftshader/libEGL.so
117 + opt/spotify/spotify-client/swiftshader/libGLESv2.so
118 +"
119 +
120 +src_prepare() {
121 + default
122 + # Spotify links against libcurl-gnutls.so.4, which does not exist in Gentoo.
123 + patchelf --replace-needed libcurl-gnutls.so.4 libcurl.so.4 usr/bin/spotify \
124 + || die "failed to patch libcurl library dependency"
125 +}
126 +
127 +src_install() {
128 + gunzip usr/share/doc/spotify-client/changelog.gz || die
129 + dodoc usr/share/doc/spotify-client/changelog
130 +
131 + SPOTIFY_PKG_HOME=usr/share/spotify
132 + insinto /usr/share/pixmaps
133 + doins ${SPOTIFY_PKG_HOME}/icons/*.png
134 +
135 + # install in /opt/spotify
136 + SPOTIFY_HOME=/opt/spotify/spotify-client
137 + insinto ${SPOTIFY_HOME}
138 + doins -r ${SPOTIFY_PKG_HOME}/*
139 + fperms +x ${SPOTIFY_HOME}/spotify
140 +
141 + dodir /usr/bin
142 + SPOTIFY_HOME=${SPOTIFY_HOME} LIBDIR=$(get_libdir) \
143 + envsubst '$SPOTIFY_HOME $LIBDIR' \
144 + < "${FILESDIR}/spotify-wrapper" > "${D}/usr/bin/spotify" || die
145 + fperms +x /usr/bin/spotify
146 +
147 + local size
148 + for size in 16 22 24 32 48 64 128 256 512; do
149 + newicon -s ${size} "${S}${SPOTIFY_PKG_HOME}/icons/spotify-linux-${size}.png" \
150 + "spotify-client.png"
151 + done
152 + domenu "${S}${SPOTIFY_PKG_HOME}/spotify.desktop"
153 + if use pax-kernel; then
154 + #create the headers, reset them to default, then paxmark -m them
155 + pax-mark C "${ED}${SPOTIFY_HOME}/${PN}" || die
156 + pax-mark z "${ED}${SPOTIFY_HOME}/${PN}" || die
157 + pax-mark m "${ED}${SPOTIFY_HOME}/${PN}" || die
158 + eqawarn "You have set USE=pax-kernel meaning that you intend to run"
159 + eqawarn "${PN} under a PaX enabled kernel. To do so, we must modify"
160 + eqawarn "the ${PN} binary itself and this *may* lead to breakage! If"
161 + eqawarn "you suspect that ${PN} is being broken by this modification,"
162 + eqawarn "please open a bug."
163 + fi
164 +}
165 +
166 +pkg_postinst() {
167 + xdg_pkg_postinst
168 +
169 + ewarn "If Spotify crashes after an upgrade its cache may be corrupt."
170 + ewarn "To remove the cache:"
171 + ewarn "rm -rf ~/.cache/spotify"
172 +
173 + optfeature "Gnome specific systray integration" gnome-extra/gnome-integration-spotify
174 + optfeature "systray integration on non-Gnome DEs" media-sound/spotify-tray
175 +}