summaryrefslogtreecommitdiff
path: root/media-sound/spotify-adblock/spotify-adblock-1.0.2.ebuild
blob: 06b6403c4f9ce005872ac2a121b7877a8dca8a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.5.1

EAPI=8

CRATES="
	aho-corasick-0.7.18
	lazy_static-1.4.0
	libc-0.2.119
	memchr-2.4.1
	proc-macro2-1.0.36
	quote-1.0.15
	regex-1.5.4
	regex-syntax-0.6.25
	serde-1.0.136
	serde_derive-1.0.136
	syn-1.0.86
	toml-0.5.8
	unicode-xid-0.2.2
"

inherit cargo

DESCRIPTION="Adblocker for Spotify"
HOMEPAGE="https://github.com/abba23/spotify-adblock/"
SRC_URI="
	https://github.com/abba23/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	$(cargo_crate_uris)
"
LICENSE="
	GPL-3
	|| ( Apache-2.0 MIT )
	|| ( MIT Unlicense )
"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
	media-sound/spotify
"

src_prepare(){
	default
	# assigned here to use get_libdir
	QA_FLAGS_IGNORED="usr/$(get_libdir)/${PN}.so"
}

src_install(){
	# executable
	SPOTIFY_HOME=/opt/spotify/spotify-client
	cat <<-EOF > "${T}/spotify-adblock" || die
		#! /bin/sh
		LD_LIBRARY_PATH="${SPOTIFY_HOME}" \\
		LD_PRELOAD=/usr/$(get_libdir)/spotify-adblock.so \\
		exec ${SPOTIFY_HOME}/spotify "\$@"
	EOF
	dobin "${T}/spotify-adblock"

	# library
	newlib.so "$(cargo_target_dir)/libspotifyadblock.so" "${PN}.so"

	# config
	insinto "/etc/${PN}"
	doins config.toml
}