media-fonts/nerd-fonts: add 3.3.0, drop 3.2.1
[gentoo-zh.git] / media-fonts / nerd-fonts / nerd-fonts-3.3.0.ebuild
blob3d5a255b3871a09a8529b6b68be2acaa04a57e8c
1 # Copyright 2021-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 inherit font check-reqs
8 DESCRIPTION="Nerd Fonts is a project that patches developer targeted fonts with glyphs"
9 HOMEPAGE="https://github.com/ryanoasis/nerd-fonts"
10 COMMON_URI="https://github.com/ryanoasis/${PN}/releases/download/v${PV}"
11 TAG_URI="https://github.com/ryanoasis/nerd-fonts/raw/v${PV}"
13 FONTS=(
14 0xproto
15 3270
16 Agave
17 AnonymousPro
18 Arimo
19 AurulentSansMono
20 BigBlueTerminal
21 BitstreamVeraSansMono
22 CascadiaCode
23 CascadiaMono
24 CodeNewRoman
25 ComicShannsMono
26 CommitMono
27 Cousine
28 D2Coding
29 DaddyTimeMono
30 DejaVuSansMono
31 DroidSansMono
32 EnvyCodeR
33 FantasqueSansMono
34 FiraCode
35 FiraMono
36 GeistMono
37 Go-Mono
38 Gohu
39 Hack
40 Hasklig
41 HeavyData
42 Hermit
43 iA-Writer
44 IBMPlexMono
45 Inconsolata
46 InconsolataGo
47 InconsolataLGC
48 IntelOneMono
49 Iosevka
50 IosevkaTerm
51 IosevkaTermSlab
52 JetBrainsMono
53 Lekton
54 LiberationMono
55 Lilex
56 MartianMono
57 Meslo
58 Monofur
59 Monoid
60 Mononoki
61 Monaspace
62 MPlus
63 NerdFontsSymbolsOnly
64 Noto
65 OpenDyslexic
66 Overpass
67 ProFont
68 ProggyClean
69 RobotoMono
70 ShareTechMono
71 SourceCodePro
72 SpaceMono
73 Terminus
74 Tinos
75 Ubuntu
76 UbuntuMono
77 VictorMono
80 SRC_URI="
81 0xproto? ( ${COMMON_URI}/0xProto.zip -> 0xProto-${PV}.zip )
82 3270? ( ${COMMON_URI}/3270.zip -> 3270-nf-${PV}.zip )
83 agave? ( ${COMMON_URI}/Agave.zip -> Agave-nf-${PV}.zip )
84 anonymouspro? ( ${COMMON_URI}/AnonymousPro.zip -> AnonymousPro-nf-${PV}.zip )
85 arimo? ( ${COMMON_URI}/Arimo.zip -> Arimo-nf-${PV}.zip )
86 aurulentsansmono? ( ${COMMON_URI}/AurulentSansMono.zip -> AurulentSansMono-nf-${PV}.zip )
87 bigblueterminal? ( ${COMMON_URI}/BigBlueTerminal.zip -> BigBlueTerminal-nf-${PV}.zip )
88 bitstreamverasansmono? ( ${COMMON_URI}/BitstreamVeraSansMono.zip -> BitstreamVeraSansMono-nf-${PV}.zip )
89 cascadiacode? ( ${COMMON_URI}/CascadiaCode.zip -> CascadiaCode-nf-${PV}.zip )
90 cascadiamono? ( ${COMMON_URI}/CascadiaMono.zip -> CascadiaMono-nf-${PV}.zip )
91 codenewroman? ( ${COMMON_URI}/CodeNewRoman.zip -> CodeNewRoman-nf-${PV}.zip )
92 comicshannsmono? ( ${COMMON_URI}/ComicShannsMono.zip -> ComicShannsMono-nf-${PV}.zip )
93 commitmono? ( ${COMMON_URI}/CommitMono.zip -> CommitMono-nf-${PV}.zip )
94 cousine? ( ${COMMON_URI}/Cousine.zip -> Cousine-nf-${PV}.zip )
95 d2coding? ( ${COMMON_URI}/D2Coding.zip -> D2Coding-nf-${PV}.zip )
96 daddytimemono? ( ${COMMON_URI}/DaddyTimeMono.zip -> DaddyTimeMono-nf-${PV}.zip )
97 envycoder? ( ${COMMON_URI}/EnvyCodeR.zip -> EnvyCodeR-nf-${PV}.zip )
98 dejavusansmono? ( ${COMMON_URI}/DejaVuSansMono.zip -> DejaVuSansMono-nf-${PV}.zip )
99 droidsansmono? ( ${COMMON_URI}/DroidSansMono.zip -> DroidSansMono-nf-${PV}.zip )
100 fantasquesansmono? ( ${COMMON_URI}/FantasqueSansMono.zip -> FantasqueSansMono-nf-${PV}.zip )
101 firacode? ( ${COMMON_URI}/FiraCode.zip -> FiraCode-nf-${PV}.zip )
102 firamono? ( ${COMMON_URI}/FiraMono.zip -> FiraMono-nf-${PV}.zip )
103 geistmono? ( ${COMMON_URI}/GeistMono.zip -> GeistMono-nf-${PV}.zip )
104 go-mono? ( ${COMMON_URI}/Go-Mono.zip -> Go-Mono-nf-${PV}.zip )
105 gohu? ( ${COMMON_URI}/Gohu.zip -> Gohu-nf-${PV}.zip )
106 hack? ( ${COMMON_URI}/Hack.zip -> Hack-nf-${PV}.zip )
107 hasklig? ( ${COMMON_URI}/Hasklig.zip -> Hasklig-nf-${PV}.zip )
108 heavydata? ( ${COMMON_URI}/HeavyData.zip -> HeavyData-nf-${PV}.zip )
109 hermit? ( ${COMMON_URI}/Hermit.zip -> Hermit-nf-${PV}.zip )
110 ia-writer? ( ${COMMON_URI}/iA-Writer.zip -> iA-Writer-nf-${PV}.zip )
111 ibmplexmono? ( ${COMMON_URI}/IBMPlexMono.zip -> IBMPlexMono-nf-${PV}.zip )
112 intelonemono? ( ${COMMON_URI}/IntelOneMono.zip -> IntelOneMono-nf-${PV}.zip )
113 inconsolata? ( ${COMMON_URI}/Inconsolata.zip -> Inconsolata-nf-${PV}.zip )
114 inconsolatago? ( ${COMMON_URI}/InconsolataGo.zip -> InconsolataGo-nf-${PV}.zip )
115 inconsolatalgc? ( ${COMMON_URI}/InconsolataLGC.zip -> InconsolataLGC-nf-${PV}.zip )
116 iosevka? ( ${COMMON_URI}/Iosevka.zip -> Iosevka-nf-${PV}.zip )
117 iosevkaterm? ( ${COMMON_URI}/IosevkaTerm.zip -> IosevkaTerm-nf-${PV}.zip )
118 iosevkatermslab? ( ${COMMON_URI}/IosevkaTermSlab.zip -> IosevkaTermSlab-nf-${PV}.zip )
119 jetbrainsmono? ( ${COMMON_URI}/JetBrainsMono.zip -> JetBrainsMono-nf-${PV}.zip )
120 lekton? ( ${COMMON_URI}/Lekton.zip -> Lekton-nf-${PV}.zip )
121 liberationmono? ( ${COMMON_URI}/LiberationMono.zip -> LiberationMono-nf-${PV}.zip )
122 lilex? ( ${COMMON_URI}/Lilex.zip -> Lilex-nf-${PV}.zip )
123 meslo? ( ${COMMON_URI}/Meslo.zip -> Meslo-nf-${PV}.zip )
124 martianmono? ( ${COMMON_URI}/MartianMono.zip -> MartianMono-nf-${PV}.zip )
125 monofur? ( ${COMMON_URI}/Monofur.zip -> Monofur-nf-${PV}.zip )
126 monoid? ( ${COMMON_URI}/Monoid.zip -> Monoid-nf-${PV}.zip )
127 mononoki? ( ${COMMON_URI}/Mononoki.zip -> Mononoki-nf-${PV}.zip )
128 monaspace? ( ${COMMON_URI}/Monaspace.zip -> Monaspace-nf-${PV}.zip )
129 mplus? ( ${COMMON_URI}/MPlus.zip -> MPlus-nf-${PV}.zip )
130 nerdfontssymbolsonly? ( ${COMMON_URI}/NerdFontsSymbolsOnly.zip -> NerdFontsSymbolsOnly-nf-${PV}.zip )
131 noto? ( ${COMMON_URI}/Noto.zip -> Noto-nf-${PV}.zip )
132 opendyslexic? ( ${COMMON_URI}/OpenDyslexic.zip -> OpenDyslexic-nf-${PV}.zip )
133 overpass? ( ${COMMON_URI}/Overpass.zip -> Overpass-nf-${PV}.zip )
134 profont? ( ${COMMON_URI}/ProFont.zip -> ProFont-nf-${PV}.zip )
135 proggyclean? ( ${COMMON_URI}/ProggyClean.zip -> ProggyClean-nf-${PV}.zip )
136 robotomono? ( ${COMMON_URI}/RobotoMono.zip -> RobotoMono-nf-${PV}.zip )
137 sharetechmono? ( ${COMMON_URI}/ShareTechMono.zip -> ShareTechMono-nf-${PV}.zip )
138 sourcecodepro? ( ${COMMON_URI}/SourceCodePro.zip -> SourceCodePro-nf-${PV}.zip )
139 spacemono? ( ${COMMON_URI}/SpaceMono.zip -> SpaceMono-nf-${PV}.zip )
140 terminus? ( ${COMMON_URI}/Terminus.zip -> Terminus-nf-${PV}.zip )
141 tinos? ( ${COMMON_URI}/Tinos.zip -> Tinos-nf-${PV}.zip )
142 ubuntu? ( ${COMMON_URI}/Ubuntu.zip -> Ubuntu-nf-${PV}.zip )
143 ubuntumono? ( ${COMMON_URI}/UbuntuMono.zip -> UbuntuMono-nf-${PV}.zip )
144 victormono? ( ${COMMON_URI}/VictorMono.zip -> VictorMono-nf-${PV}.zip )
146 S="${WORKDIR}"
147 LICENSE="MIT
148 OFL-1.1
149 Apache-2.0
150 CC-BY-SA-4.0
151 BitstreamVera
153 WTFPL-2
154 Vic-Fieger-License
155 UbuntuFontLicense-1.0"
156 SLOT="0"
157 KEYWORDS="~amd64 ~loong ~x86"
159 DEPEND="app-arch/unzip"
160 RDEPEND="media-libs/fontconfig"
162 CHECKREQS_DISK_BUILD="3G"
163 CHECKREQS_DISK_USR="4G"
165 IUSE_FLAGS=(${FONTS[*],,})
166 IUSE="+nerdfontssymbolsonly ${IUSE_FLAGS[*]}"
167 REQUIRED_USE="|| ( nerdfontssymbolsonly ${IUSE_FLAGS[*]} )"
169 FONT_S=${S}
171 pkg_pretend() {
172 check-reqs_pkg_setup
175 src_install() {
176 declare -A font_filetypes
177 local otf_file_number ttf_file_number
179 otf_file_number=$(ls "${S}" | grep -i otf | wc -l)
180 ttf_file_number=$(ls "${S}" | grep -i ttf | wc -l)
182 if [[ ${otf_file_number} != 0 ]]; then
183 font_filetypes[otf]=
186 if [[ ${ttf_file_number} != 0 ]]; then
187 font_filetypes[ttf]=
190 FONT_SUFFIX="${!font_filetypes[@]}"
192 font_src_install
195 pkg_postinst() {
196 einfo "Installing font-patcher via an ebuild is hard, because paths are hardcoded differently"
197 einfo "in .sh files. You can still get it and use it by git cloning the nerd-font project and"
198 einfo "running it from the cloned directory."
199 einfo "https://github.com/ryanoasis/nerd-fonts"
201 elog "You might have to enable 50-user.conf by using"
202 elog "eselect fontconfig"