community/nerd-fonts: restore nerd fonts

Upstream nerd fonts ships:

- The nerd font symbols themselves.
- Several other fonts patched to include nerd font symbols.

The upgrade to upgrade to 2.3.3 was a full rewrite of this package, and
dropped font-nerd-fonts-symbols; only patched versions of other fonts
were retained. I believe this drop was done inadvertently during the
refactor and not intentional.

Previously the nerd font symbols font came in two variants,
font-nerd-fonts-symbols-2048em and font-nerd-fonts-symbols-1000em.
As of v3.0.0, both variants have been merged into one. This commit
re-introduces nerd font symbols as "font-nerd-fonts-symbols".

A replaces= directive is also included so that existing installations of
the previous version will upgrade to this one (upstream has dropped the
two variations that previously existed and now only ships a single one).

This also includes the upstream-provided fontconfig file.

Fixes: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/38362
This commit is contained in:
Hugo Osvaldo Barrera 2023-10-25 13:23:16 +02:00 committed by Jakub Jirutka
parent 79a539be4f
commit fba8224210

View File

@ -2,20 +2,23 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=nerd-fonts
pkgver=3.0.2
pkgrel=0
provides="nerd-fonts-stable=$pkgver-r$pkgrel"
replaces="nerd-fonts-stable"
pkgrel=1
pkgdesc="Patched developer targeted fonts with a high number of glyphs"
url="https://nerdfonts.com"
arch="noarch"
license="MIT AND OFL-1.1 AND Apache-2.0"
provides="nerd-fonts-stable=$pkgver-r$pkgrel"
replaces="nerd-fonts-stable"
options="!check" # no testsuite provided
builddir="$srcdir"
# The following CSV has columns: <id>,<zipname>,<fontname>,<origname>
# <id> is the suffix for the resulting package.
# <fontname> is the name of the file itself.
#
# If <fontname> is empty, <zipname> will be used instead.
# <origname> is used only for pkgdesc and it may be empty.
# "~" will be replaced with " "
# <id>,<zipname>,<fontname>,<origname>
# "~" will be replaced with a single whitespace.
_fonts="
anonymous-pro,AnonymousPro,Anonymice,Anonymous~Pro
arimo,Arimo,,
@ -49,8 +52,13 @@ _fonts="
victor-mono,VictorMono,VictorMono,Victor~Mono
"
_depends_all=""
subpackages="nerd-fonts-all:_all"
source=""
subpackages="
nerd-fonts-all:_all
font-nerd-fonts-symbols:_symbols
"
source="$pkgname-symbols-$pkgver.tar.xz::https://github.com/ryanoasis/nerd-fonts/releases/download/v$pkgver/NerdFontsSymbolsOnly.tar.xz
10-nerd-font-symbols-$pkgver.conf::https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v$pkgver/10-nerd-font-symbols.conf
"
for _font in $_fonts; do
_pkgname="font-${_font%%,*}-nerd"
_filename=${_font#*,}; _filename=${_filename%%,*}
@ -91,6 +99,15 @@ _subpackage() {
install -Dm644 ./"$fontname"*.*tf -t "$subpkgdir"/usr/share/fonts/${subpkgname#font-}/
}
_symbols() {
depends="fontconfig"
pkgdesc="Nerd Font (Symbols Only)"
install -Dm644 "$srcdir"/SymbolsNerdFont*.ttf -t "$subpkgdir"/usr/share/fonts/nerd-fonts/
install -Dm644 "$srcdir"/10-nerd-font-symbols-$pkgver.conf \
"$subpkgdir"/usr/share/fontconfig/conf.avail/10-nerd-font-symbols.conf
}
_all() {
pkgdesc="Meta package for all patched Nerd Fonts"
depends="$_depends_all"
@ -99,6 +116,8 @@ _all() {
}
sha512sums="
23ba74bb2bef96003a2cfb6def85eee67117f49ff0fcfc4352c2b16b12be80837bce99465d4317e73b894c2cfe3eb7d92b20bbd237a3d832b1489d640e981a88 nerd-fonts-symbols-3.0.2.tar.xz
2f0d5d72a1e03397cde6f1b178556601bcca8c133d53f0bf25784dc382ab444abbf90c59df6a58bb729eaae57e52fc757962206d191247fc431a793877e83330 10-nerd-font-symbols-3.0.2.conf
224d831b367ff90c762ce360caa6bffe5448aa2ac9c9ba1983c7a6d7b4dde421e9488dd123d49298182a7cfebfca19aa9b7c4e1758f1269bd340bf72c55091e6 font-anonymous-pro-nerd-3.0.2.tar.xz
7c658db1105acb87ae254f9dcc0796d3f270659f6332ee66c9f6dade2214548bd38ace8b4f3158f5bc33ba32ea8a62256abcce8cd655bc80ff7a591d7ba6c95e font-arimo-nerd-3.0.2.tar.xz
8c81471f07312e17b2339165aabf9829fb084b2cdeb28cbc11791f4a3757d6e1ed8de7cb5a1742af188ff79f31f06ca707af7f3cb175c523eef8cf125363b398 font-bitstrom-wera-sans-mono-nerd-3.0.2.tar.xz