123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- # Copyright 1999-2024 Gentoo Authors
- # Distributed under the terms of the GNU General Public License v2
- EAPI=8
- inherit font check-reqs
- DESCRIPTION="Nerd Fonts is a project that patches developer targeted fonts with glyphs"
- HOMEPAGE="https://github.com/ryanoasis/nerd-fonts"
- COMMON_URI="https://github.com/ryanoasis/${PN}/releases/download/v${PV/_rc/-RC}"
- FONTS=(
- 0xProto
- 3270
- Agave
- AnonymousPro
- Arimo
- AurulentSansMono
- BigBlueTerminal
- BitstreamVeraSansMono
- CascadiaCode
- CascadiaMono
- CodeNewRoman
- ComicShannsMono
- CommitMono
- Cousine
- D2Coding
- DaddyTimeMono
- DejaVuSansMono
- DepartureMono
- DroidSansMono
- EnvyCodeR
- FantasqueSansMono
- FiraCode
- FiraMono
- GeistMono
- Go-Mono
- Gohu
- Hack
- Hasklig
- HeavyData
- Hermit
- iA-Writer
- IBMPlexMono
- Inconsolata
- InconsolataGo
- InconsolataLGC
- IntelOneMono
- Iosevka
- IosevkaTerm
- IosevkaTermSlab
- JetBrainsMono
- Lekton
- LiberationMono
- Lilex
- MartianMono
- Meslo
- Monofur
- Monoid
- Mononoki
- Monaspace
- MPlus
- NerdFontsSymbolsOnly
- Noto
- OpenDyslexic
- Overpass
- ProFont
- ProggyClean
- RobotoMono
- Recursive
- ShareTechMono
- SourceCodePro
- SpaceMono
- Terminus
- Tinos
- Ubuntu
- UbuntuMono
- UbuntuSans
- VictorMono
- ZedMono
- )
- gen_src_uri() {
- for f in ${FONTS[*]}; do
- echo "${f,,}? ( ${COMMON_URI}/${f}.zip -> ${f}-nf-${PV}.zip )"
- done
- }
- SRC_URI="
- $(gen_src_uri)
- https://github.com/ryanoasis/nerd-fonts/raw/v${PV}/10-nerd-font-symbols.conf -> ${P}-10-nerd-font-symbols.conf
- "
- RESTRICT="mirror"
- LICENSE="MIT
- OFL-1.1
- Apache-2.0
- CC-BY-SA-4.0
- BitstreamVera
- BSD
- WTFPL-2
- Vic-Fieger-License
- UbuntuFontLicense-1.0"
- SLOT="0"
- KEYWORDS="*"
- DEPEND="app-arch/unzip"
- RDEPEND="media-libs/fontconfig"
- CHECKREQS_DISK_BUILD="3G"
- CHECKREQS_DISK_USR="4G"
- IUSE_FLAGS=(${FONTS[*],,})
- IUSE="${IUSE_FLAGS[*]}"
- REQUIRED_USE="X || ( ${IUSE_FLAGS[*]} )"
- S="${WORKDIR}"
- FONT_CONF=(
- "${S}/10-nerd-font-symbols.conf"
- )
- FONT_S=${S}
- pkg_pretend() {
- check-reqs_pkg_setup
- }
- src_prepare() {
- default
- cp "${DISTDIR}/${P}-10-nerd-font-symbols.conf" "10-nerd-font-symbols.conf"
- }
- src_install() {
- declare -A font_filetypes
- local otf_file_number ttf_file_number
- otf_file_number=$(ls "${S}" | grep -i otf | wc -l)
- ttf_file_number=$(ls "${S}" | grep -i ttf | wc -l)
- if [[ ${otf_file_number} != 0 ]]; then
- font_filetypes[otf]=
- fi
- if [[ ${ttf_file_number} != 0 ]]; then
- font_filetypes[ttf]=
- fi
- FONT_SUFFIX="${!font_filetypes[@]}"
- font_src_install
- }
- pkg_postinst() {
- einfo "Installing font-patcher via an ebuild is hard, because paths are hardcoded differently"
- einfo "in .sh files. You can still get it and use it by git cloning the nerd-font project and"
- einfo "running it from the cloned directory."
- einfo "https://github.com/ryanoasis/nerd-fonts"
- elog "You might have to enable 50-user.conf and 10-nerd-font-symbols.conf by using"
- elog "eselect fontconfig"
- }
|