net-im/wemeet: Wemeet - Tencent Video Conferencing (#1186)
[gentoo-zh.git] / media-fonts / nerd-fonts / nerd-fonts-2.1.0.ebuild
blobff3d95d3a9393765bf25ae4fcef276e6b2793c7a
1 # Copyright 2021 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}"
12 FONTS=(
13         3270
14         Agave
15         AnonymousPro
16         Arimo
17         AurulentSansMono
18         BigBlueTerminal
19         BitstreamVeraSansMono
20         CascadiaCode
21         CodeNewRoman
22         Cousine
23         DaddyTimeMono
24         DejaVuSansMono
25         DroidSansMono
26         FantasqueSansMono
27         FiraCode
28         FiraMono
29         Go-Mono
30         Gohu
31         Hack
32         Hasklig
33         HeavyData
34         Hermit
35         iA-Writer
36         IBMPlexMono
37         Inconsolata
38         InconsolataGo
39         InconsolataLGC
40         Iosevka
41         JetBrainsMono
42         Lekton
43         LiberationMono
44         Meslo
45         Monofur
46         Monoid
47         Mononoki
48         MPlus
49         Noto
50         OpenDyslexic
51         Overpass
52         ProFont
53         ProggyClean
54         RobotoMono
55         ShareTechMono
56         SourceCodePro
57         SpaceMono
58         Terminus
59         Tinos
60         Ubuntu
61         UbuntuMono
62         VictorMono
65 SRC_URI="
66         3270?                                   ( "${COMMON_URI}/3270.zip" )
67         agave?                  ( "${COMMON_URI}/Agave.zip" )
68         anonymouspro?           ( "${COMMON_URI}/AnonymousPro.zip" )
69         arimo?                  ( "${COMMON_URI}/Arimo.zip" )
70         aurulentsansmono?       ( "${COMMON_URI}/AurulentSansMono.zip" )
71         bigblueterminal?        ( "${COMMON_URI}/BigBlueTerminal.zip" )
72         bitstreamverasansmono?  ( "${COMMON_URI}/BitstreamVeraSansMono.zip" )
73         cascadiacode?           ( "${COMMON_URI}/CascadiaCode.zip" )
74         codenewroman?           ( "${COMMON_URI}/CodeNewRoman.zip" )
75         cousine?                ( "${COMMON_URI}/Cousine.zip" )
76         daddytimemono?          ( "${COMMON_URI}/DaddyTimeMono.zip" )
77         dejavusansmono?         ( "${COMMON_URI}/DejaVuSansMono.zip" )
78         droidsansmono?          ( "${COMMON_URI}/DroidSansMono.zip" )
79         fantasquesansmono?      ( "${COMMON_URI}/FantasqueSansMono.zip" )
80         firacode?               ( "${COMMON_URI}/FiraCode.zip" )
81         firamono?               ( "${COMMON_URI}/FiraMono.zip" )
82         go-mono?                ( "${COMMON_URI}/Go-Mono.zip" )
83         gohu?                   ( "${COMMON_URI}/Gohu.zip" )
84         hack?                   ( "${COMMON_URI}/Hack.zip" )
85         hasklig?                ( "${COMMON_URI}/Hasklig.zip" )
86         heavydata?              ( "${COMMON_URI}/HeavyData.zip" )
87         hermit?                 ( "${COMMON_URI}/Hermit.zip" )
88         ia-writer?              ( "${COMMON_URI}/iA-Writer.zip" )
89         ibmplexmono?            ( "${COMMON_URI}/IBMPlexMono.zip" )
90         inconsolata?            ( "${COMMON_URI}/Inconsolata.zip" )
91         inconsolatago?          ( "${COMMON_URI}/InconsolataGo.zip" )
92         inconsolatalgc?         ( "${COMMON_URI}/InconsolataLGC.zip" )
93         iosevka?                ( "${COMMON_URI}/Iosevka.zip" )
94         jetbrainsmono?          ( "${COMMON_URI}/JetBrainsMono.zip" )
95         lekton?                 ( "${COMMON_URI}/Lekton.zip" )
96         liberationmono?         ( "${COMMON_URI}/LiberationMono.zip" )
97         meslo?                  ( "${COMMON_URI}/Meslo.zip" )
98         monofur?                ( "${COMMON_URI}/Monofur.zip" )
99         monoid?                 ( "${COMMON_URI}/Monoid.zip" )
100         mononoki?               ( "${COMMON_URI}/Mononoki.zip" )
101         mplus?                  ( "${COMMON_URI}/MPlus.zip" )
102         noto?                   ( "${COMMON_URI}/Noto.zip" )
103         opendyslexic?           ( "${COMMON_URI}/OpenDyslexic.zip" )
104         overpass?               ( "${COMMON_URI}/Overpass.zip" )
105         profont?                ( "${COMMON_URI}/ProFont.zip" )
106         proggyclean?            ( "${COMMON_URI}/ProggyClean.zip" )
107         robotomono?             ( "${COMMON_URI}/RobotoMono.zip" )
108         sharetechmono?          ( "${COMMON_URI}/ShareTechMono.zip" )
109         sourcecodepro?          ( "${COMMON_URI}/SourceCodePro.zip" )
110         spacemono?              ( "${COMMON_URI}/SpaceMono.zip" )
111         terminus?               ( "${COMMON_URI}/Terminus.zip" )
112         tinos?                  ( "${COMMON_URI}/Tinos.zip" )
113         ubuntu?                 ( "${COMMON_URI}/Ubuntu.zip" )
114         ubuntumono?             ( "${COMMON_URI}/UbuntuMono.zip" )
115         victormono?             ( "${COMMON_URI}/VictorMono.zip" )
118 LICENSE="MIT
119                 OFL-1.1
120                 Apache-2.0
121                 CC-BY-SA-4.0
122                 BitstreamVera
123                 BSD
124                 WTFPL-2
125                 Vic-Fieger-License
126                 UbuntuFontLicense-1.0"
127 SLOT="0"
128 KEYWORDS="amd64 ~x86"
130 DEPEND="app-arch/unzip"
131 RDEPEND="media-libs/fontconfig"
133 CHECKREQS_DISK_BUILD="3G"
134 CHECKREQS_DISK_USR="4G"
136 IUSE_FLAGS=(${FONTS[*],,})
137 IUSE="${IUSE_FLAGS[*]}"
138 REQUIRED_USE="X || ( ${IUSE_FLAGS[*]} )"
140 S="${WORKDIR}"
141 FONT_CONF=(
142         "${FILESDIR}"/10-nerd-font-symbols.conf
144 FONT_S=${S}
146 pkg_pretend() {
147         check-reqs_pkg_setup
150 src_install() {
151         declare -A font_filetypes
152         local otf_file_number ttf_file_number
154         otf_file_number=$(ls ${S} | grep -i otf | wc -l)
155         ttf_file_number=$(ls ${S} | grep -i ttf | wc -l)
157         if [[ ${otf_file_number} != 0 ]]; then
158                 font_filetypes[otf]=
159         fi
161         if [[ ${ttf_file_number} != 0 ]]; then
162                 font_filetypes[ttf]=
163         fi
165         FONT_SUFFIX="${!font_filetypes[@]}"
167         font_src_install
170 pkg_postinst() {
171         einfo "Installing font-patcher via an ebuild is hard, because paths are hardcoded differently"
172         einfo "in .sh files. You can still get it and use it by git cloning the nerd-font project and"
173         einfo "running it from the cloned directory."
174         einfo "https://github.com/ryanoasis/nerd-fonts"
176         elog "You might have to enable 50-user.conf and 10-nerd-font-symbols.conf by using"
177         elog "eselect fontconfig"