Add spicetify-cli package

This commit is contained in:
Sravan Balaji
2024-05-13 16:38:57 -04:00
parent f4d7775756
commit ffcc0e8f2e
3 changed files with 103 additions and 0 deletions

View File

@ -0,0 +1,2 @@
DIST spicetify-cli-2.36.11-deps.tar.xz 5223520 BLAKE2B baca6229ff613537375da05f7d7c25e6c44301f3e2dd7b30d31f11bc77d5c89c9f8b5e8be5201127ad5d8a2f3356b3e701b837b555dfbe52145cfeb4ef7ea0e3 SHA512 167cc92e9f6fe249ac025185e587fd75d0a61b670b65d5496b19a1cc9826c9509858e6b947d7b06d1ed016bc1121ba0b1680e4cc8e6472624dff92dc35891a99
DIST spicetify-cli-2.36.11.tar.gz 2018637 BLAKE2B 0822e88c915f33bf3cdfb743ff133e3fff94c7ab4c5cbfe5033492601998ad5edf0940e2ec18005d1ca6140616ef40d33e50281ff00ca8499db14c059614ffe5 SHA512 88e8b07be6207a3d2781dbd1a29b504ab424356c22171de4617e4c1fcf1d19c7f68b17289f85f8342fec026d87d86009bb9e8ef2323db6617d89e64ba0058a0b

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /opt/spicetify-cli/spicetify-cli "$@"

View File

@ -0,0 +1,99 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module
WHITELIST_VERSIONS=(
"<> 1.2.8 1.2.37"
)
whitelist_versions() {
local version_spec version1 version2
local -a deps
SPOTIFY_VERSIONS=
# Iterate in reverse for elog
for ((index = $(( ${#WHITELIST_VERSIONS[@]} - 1 )); index >= 0; index--)); do
read -r version_spec version1 version2 <<< "${WHITELIST_VERSIONS[${index}]}"
case ${version_spec} in
"<>")
deps[$index]="( <=media-sound/spotify-${version2} >=media-sound/spotify-${version1} )"
SPOTIFY_VERSIONS+="${version1} -> ${version2}"
;;
"~")
deps[$index]="~media-sound/spotify-${version1}"
SPOTIFY_VERSIONS+="${version1}"
;;
*)
die "Invalid version specifier in WHITELIST_VERSIONS"
;;
esac
if [[ ${index} == 0 ]]; then
SPOTIFY_VERSIONS+=". "
elif [[ ${index} == 1 ]]; then
SPOTIFY_VERSIONS+=" and "
else
SPOTIFY_VERSIONS+=", "
fi
done
RDEPEND=" || ( ${deps[@]} )"
}
whitelist_versions
DESCRIPTION="Commandline tool to customize Spotify client."
HOMEPAGE="https://spicetify.app/"
SRC_URI="
https://github.com/spicetify/spicetify-cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://gitlab.com/api/v4/projects/37881342/packages/generic/${PN}/${PV}/${P}-deps.tar.xz
"
LICENSE="Apache-2.0 BSD LGPL-2.1 MIT"
SLOT="0"
KEYWORDS="~amd64"
# no tests
RESTRICT="test"
INSTALLDIR="/opt/${PN}"
src_compile() {
ego build -ldflags "-X main.version=${PV}"
}
src_install() {
insinto "${INSTALLDIR}"
doins -r {CustomApps,Extensions,Themes,jsHelper,spicetify-cli}
dobin "${FILESDIR}/spicetify"
fperms +x "${INSTALLDIR}/spicetify-cli"
}
pkg_postinst() {
elog "Spicetify requires a Spotify install that it can modify."
elog "To give read and write permissions to everyone on the system to run the following commands as root."
elog "# chmod a+wr /opt/spotify/spotify-client"
elog "# chmod a+wr /opt/spotify/spotify-client/Apps -R"
elog ""
elog "WARNING: Do not run spicetify as root please"
elog ""
elog "Spicetify compatibility is limited to the following Spotify versions:"
elog " ${SPOTIFY_VERSIONS}"
elog ""
elog "Otherwise you can install spotify to a user modifiable location like as a flatpak:"
elog " https://spicetify.app/docs/advanced-usage/installation#spotify-installed-from-flatpak"
elog ""
elog "To install themes see:"
elog " https://spicetify.app/docs/advanced-usage/themes"
if $(has_version -r ">=media-sound/spotify-1.2.25"); then
elog ""
elog "The New Releases custom app no longer works with Spotify 1.2.25 and higher. As an alternative,"
elog "please use What's New which was created by Spotify and can be enabled via Experimental Features"
elog "if it isn't already enabled."
fi
}