summaryrefslogtreecommitdiff
blob: 8e485f8bcb1ff74e83646153c40dd88f0534a990 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit check-reqs edo xdg

MY_PN="${PN^}"
MY_PV="${PV:0:4}-${PV:4:2}-${PV:6:2}" # eg. 20211225 -> 2021-12-25

DESCRIPTION="A flat colorful Design icon theme"
HOMEPAGE="https://github.com/vinceliuice/Tela-icon-theme"

if [[ "${PV}" == 99999999 ]]; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/vinceliuice/Tela-icon-theme.git"
else
	SRC_URI="https://github.com/vinceliuice/Tela-icon-theme/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="amd64 arm64 ppc64"
	S="${WORKDIR}/${MY_PN}-${MY_PV}"
fi

LICENSE="GPL-3+"
SLOT="0"
IUSE="+hardlink kde minimal"
RESTRICT="binchecks strip test"

BDEPEND="
	app-shells/bash
	hardlink? ( sys-apps/util-linux[hardlink] )
"

DOCS=(
	AUTHORS
	README.md
	tela-dark.png
	tela-light.png
)

tela-icon-theme_check-reqs() {
	if ! use minimal; then
		if use hardlink; then
			CHECKREQS_DISK_USR=1700M
		else
			CHECKREQS_DISK_USR=2600M
		fi

		check-reqs_${EBUILD_PHASE_FUNC}
	fi
}

pkg_setup() {
	tela-icon-theme_check-reqs
}

pkg_pretend() {
	tela-icon-theme_check-reqs
}

src_prepare() {
	default

	# We use eclass for that.
	sed -i "/gtk-update-icon-cache/d" install.sh || die
}

src_install() {
	einstalldocs

	dodir /usr/share/icons

	local options=()

	use kde && options+=( -c )

	if use minimal; then
		options+=( standard )
	else
		options+=( -a )
	fi

	edob ./install.sh -d "${ED}/usr/share/icons" "${options[@]}"

	use hardlink && \
		edob -m "Linking duplicate icons" hardlink -pot "${ED}/usr/share/icons"

	# Installs broken symlinks (by design, but we remove it due to QA warnings).
	# https://bugs.gentoo.org/830467
	edob -m "Removing broken symlinks" find "${ED}" -xtype l -print -delete
}