URI:
       spicetify-cli-2.38.5-r1.ebuild - overlay - dark gentoo overlay
  HTML git clone https://git.drkhsh.at/overlay.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
       ---
       spicetify-cli-2.38.5-r1.ebuild (2842B)
       ---
            1 # Copyright 1999-2024 Gentoo Authors
            2 # Distributed under the terms of the GNU General Public License v2
            3 
            4 EAPI=8
            5 
            6 inherit go-module
            7 
            8 MY_PN="cli"
            9 
           10 WHITELIST_VERSIONS=(
           11         "<> 1.2.14 1.2.50"
           12 )
           13 
           14 whitelist_versions() {
           15         local version_spec version1 version2
           16         local -a deps
           17 
           18         SPOTIFY_VERSIONS=
           19 
           20         # Iterate in reverse for elog
           21         for ((index = $(( ${#WHITELIST_VERSIONS[@]} - 1 )); index >= 0; index--)); do
           22                 read -r version_spec version1 version2 <<< "${WHITELIST_VERSIONS[${index}]}"
           23 
           24                 case ${version_spec} in
           25                         "<>")
           26                                 deps[$index]="( <=media-sound/spotify-${version2} >=media-sound/spotify-${version1} )"
           27                                 SPOTIFY_VERSIONS+="${version1} -> ${version2}"
           28                                 ;;
           29                         "~")
           30                                 deps[$index]="~media-sound/spotify-${version1}"
           31                                 SPOTIFY_VERSIONS+="${version1}"
           32                                 ;;
           33                         *)
           34                                 die "Invalid version specifier in WHITELIST_VERSIONS"
           35                                 ;;
           36                 esac
           37 
           38                 if [[ ${index} == 0 ]]; then
           39                         SPOTIFY_VERSIONS+=". "
           40                 elif [[ ${index} == 1 ]]; then
           41                         SPOTIFY_VERSIONS+=" and "
           42                 else
           43                         SPOTIFY_VERSIONS+=", "
           44                 fi
           45         done
           46 
           47         RDEPEND=" || ( ${deps[@]} )"
           48 }
           49 whitelist_versions
           50 
           51 DESCRIPTION="Commandline tool to customize Spotify client."
           52 HOMEPAGE="https://spicetify.app/"
           53 SRC_URI="
           54         https://github.com/spicetify/cli/archive/v${PV}.tar.gz -> ${P}.tar.gz
           55         https://gitlab.com/api/v4/projects/37881342/packages/generic/${PN}/${PV}/${P}-deps.tar.xz
           56 "
           57 S="${WORKDIR}/${MY_PN}-${PV}"
           58 
           59 LICENSE="Apache-2.0 BSD LGPL-2.1 MIT"
           60 SLOT="0"
           61 KEYWORDS="~amd64"
           62 
           63 # no tests
           64 RESTRICT="test"
           65 
           66 INSTALLDIR="/opt/${PN}"
           67 
           68 src_compile() {
           69         ego build -ldflags "-X main.version=${PV}"
           70 }
           71 
           72 src_install() {
           73         insinto "${INSTALLDIR}"
           74         doins -r {CustomApps,Extensions,Themes,jsHelper,cli}
           75         newbin - spicetify <<-EOF
           76         #!/usr/bin/env sh
           77         exec /opt/spicetify-cli/cli \$@
           78         EOF
           79         fperms +x "${INSTALLDIR}/cli"
           80 }
           81 
           82 pkg_postinst() {
           83         elog "Spicetify requires a Spotify install that it can modify."
           84         elog "To give read and write permissions to everyone on the system to run the following commands as root."
           85         elog "# chmod a+wr /opt/spotify/spotify-client"
           86         elog "# chmod a+wr /opt/spotify/spotify-client/Apps -R"
           87         elog ""
           88         elog "WARNING: Do not run spicetify as root please"
           89         elog ""
           90         elog "Spicetify compatibility is limited to the following Spotify versions:"
           91         elog " ${SPOTIFY_VERSIONS}"
           92         elog ""
           93         elog "Otherwise you can install spotify to a user modifiable location like as a flatpak:"
           94         elog " https://spicetify.app/docs/advanced-usage/installation#spotify-installed-from-flatpak"
           95         elog ""
           96         elog "To install themes see:"
           97         elog " https://spicetify.app/docs/advanced-usage/themes"
           98 
           99         if $(has_version -r ">=media-sound/spotify-1.2.25"); then
          100                 elog ""
          101                 elog "The New Releases custom app no longer works with Spotify 1.2.25 and higher. As an alternative,"
          102                 elog "please use What's New which was created by Spotify and can be enabled via Experimental Features"
          103                 elog "if it isn't already enabled."
          104         fi
          105 }