summary refs log tree commit diff
path: root/media-fonts/sarasa-gothic/sarasa-gothic-0.6.0.ebuild
blob: ccab30e4e96b605b2269ce4f27522fc5d6e49805 (plain) (blame)
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
# Copyright 2018-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit font

DESCRIPTION="A CJK programming font based on Iosevka and Source Han Sans"
HOMEPAGE="https://github.com/be5invis/${PN}"
SRC_URI="https://github.com/be5invis/${PN}/releases/download/v${PV/_/-}/"
SRC_URI="ttc? ( ${SRC_URI}${PN}-ttc-${PV%_*}.7z )
	ttf? ( ${SRC_URI}${PN}-ttf-${PV%_*}.7z )
"
RESTRICT="primaryuri"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE_FONT_TYPES=( ttc +ttf )
IUSE_FONT_VARIANTS=( gothic +mono term ui )
IUSE_L10N=( ja ko zh-CN zh-TW )
IUSE="${IUSE_L10N[@]/#/l10n_} ${IUSE_FONT_TYPES[@]} ${IUSE_FONT_VARIANTS[@]}"
REQUIRED_USE="|| ( l10n_ja l10n_ko l10n_zh-CN l10n_zh-TW )
	?? ( ${IUSE_FONT_TYPES[@]/#+/} )
"

DEPEND="app-arch/p7zip"
RDEPEND="${DEPEND}"

S="${WORKDIR}"

src_prepare() {
	default

	use ttc && return

	rm -f \
		$(usex !l10n_ja "${PN%-*}*-j-*.ttf") \
		$(usex !l10n_ko "${PN%-*}*-cl-*.ttf") \
		$(usex !l10n_zh-CN "${PN%-*}*-sc-*.ttf") \
		$(usex !l10n_zh-TW "${PN%-*}*-tc-*.ttf")

	local i
	for i in "${IUSE_FONT_VARIANTS[@]/#+/}"; do
		use ${_v} || rm -f ${PN%-*}-${i}-*.ttf
	done
}

Consider giving Nix/NixOS a try! <3