summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorD3SOX2021-06-08 13:18:12 +0200
committerD3SOX2021-06-08 13:18:12 +0200
commitb194eed6ca83042e34b830eb53d6479fc4f2fe03 (patch)
tree00a2b90805e47389dc0b25f0bb099854a18a1b77
parent22f344b76f5da3ad072e1d5ea6ed51abf656ebbb (diff)
downloadaur-b194eed6ca83042e34b830eb53d6479fc4f2fe03.tar.gz
use absolute glyph directory
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD14
-rw-r--r--allow-glyphdir.diff21
3 files changed, 32 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4fdf963c62e2..22161fa2f62e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = nerd-fonts-sf-mono
pkgdesc = Monospaced variant of San Francisco. Sourced directly from Apple, patched with the Nerd Fonts Patcher
pkgver = 2.1.0
- pkgrel = 2
+ pkgrel = 3
url = https://developer.apple.com/fonts/
arch = any
license = custom
@@ -13,10 +13,12 @@ pkgbase = nerd-fonts-sf-mono
provides = nerd-fonts-sf-mono
conflicts = nerd-fonts-sf-mono
source = https://developer.apple.com/design/downloads/SF-Mono.dmg
- source = https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v2.1.0/font-patcher
+ source = font-patcher-2.1.0::https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v2.1.0/font-patcher
+ source = allow-glyphdir.diff
source = svn+https://github.com/ryanoasis/nerd-fonts/tags/v2.1.0/src/glyphs
sha256sums = ec0518e310797d2f9cb924c18e3e7b661359f4fb653d1ad4315758ebcdb5ff11
sha256sums = 3377615be4271f8bdeef66e6f2f82ac3f3cfb7b5677abe7b8e189409da048859
+ sha256sums = 6fad8dead6215b1d8cedbbce3d1bc1fc7c1b0bb06ea70518334bd443a7ba543f
sha256sums = SKIP
pkgname = nerd-fonts-sf-mono
diff --git a/PKGBUILD b/PKGBUILD
index cc32196a79bd..7fd6b098c14a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Nico <d3sox at protonmail dot com>
pkgname=nerd-fonts-sf-mono
pkgver=2.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="Monospaced variant of San Francisco. Sourced directly from Apple, patched with the Nerd Fonts Patcher"
arch=('any')
url='https://developer.apple.com/fonts/'
@@ -9,13 +9,13 @@ license=('custom')
makedepends=('git' 'p7zip' 'python' 'fontforge' 'subversion')
conflicts=('nerd-fonts-sf-mono')
provides=('nerd-fonts-sf-mono')
-source=('https://developer.apple.com/design/downloads/SF-Mono.dmg' "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v$pkgver/font-patcher" "svn+https://github.com/ryanoasis/nerd-fonts/tags/v$pkgver/src/glyphs")
-sha256sums=('ec0518e310797d2f9cb924c18e3e7b661359f4fb653d1ad4315758ebcdb5ff11' '3377615be4271f8bdeef66e6f2f82ac3f3cfb7b5677abe7b8e189409da048859' 'SKIP')
+source=('https://developer.apple.com/design/downloads/SF-Mono.dmg' "font-patcher-$pkgver::https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v$pkgver/font-patcher" "allow-glyphdir.diff" "svn+https://github.com/ryanoasis/nerd-fonts/tags/v$pkgver/src/glyphs")
+sha256sums=('ec0518e310797d2f9cb924c18e3e7b661359f4fb653d1ad4315758ebcdb5ff11' '3377615be4271f8bdeef66e6f2f82ac3f3cfb7b5677abe7b8e189409da048859' '6fad8dead6215b1d8cedbbce3d1bc1fc7c1b0bb06ea70518334bd443a7ba543f' 'SKIP')
build() {
- # prepare glyphs so that font-patcher can find them
- mkdir -p "$srcdir/src"
- ln -sf "$srcdir/glyphs" "$srcdir/src/glyphs"
+ _patcher="font-patcher-$pkgver-glyphdir"
+ # apply patch to font-patcher to allow using custom glyph directory
+ patch -p1 --follow-symlinks -o "$_patcher" < allow-glyphdir.diff
# remove previous files
rm -rf SFMonoFonts
# extract dmg
@@ -29,7 +29,7 @@ build() {
for f in "$srcdir/Library/Fonts"/*.otf; do
printf "%b" "\e[1;32m==> \e[0mNow patching $f\n"
# patch font quiet with complete single-width glyphs
- python "$srcdir/font-patcher" -q -c -s "$f" -out "$srcdir/patched" > /dev/null
+ python "$srcdir/$_patcher" --glyphdir "$srcdir/glyphs/" -q -c -s "$f" -out "$srcdir/patched" &> /dev/null
done
}
diff --git a/allow-glyphdir.diff b/allow-glyphdir.diff
new file mode 100644
index 000000000000..2934c4532c51
--- /dev/null
+++ b/allow-glyphdir.diff
@@ -0,0 +1,21 @@
+diff --git a/font-patcher-2.1.0 b/font-patcher-2.1.0
+index 815d1fd48..55169be26 100755
+--- a/font-patcher-2.1.0
++++ b/font-patcher-2.1.0
+@@ -85,7 +85,7 @@ class font_patcher:
+ if symfont:
+ symfont.close()
+ symfont = None
+- symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])
++ symfont = fontforge.open(self.args.glyphdir + patch['Filename'])
+
+ # Match the symbol font size to the source font size
+ symfont.em = self.sourceFont.em
+@@ -143,6 +143,7 @@ class font_patcher:
+ parser.add_argument('--custom', dest='custom', default=False, type=str, nargs='?', help='Specify a custom symbol font. All new glyphs will be copied, with no scaling applied.')
+ parser.add_argument('-ext', '--extension', dest='extension', default="", type=str, nargs='?', help='Change font file type to create (e.g., ttf, otf)')
+ parser.add_argument('-out', '--outputdir', dest='outputdir', default=".", type=str, nargs='?', help='The directory to output the patched font file to')
++ parser.add_argument('--glyphdir', dest='glyphdir', default=__dir__ + "/src/glyphs/", type=str, nargs='?', help='Path to glyphs to be used for patching')
+
+ # progress bar arguments - https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
+ progressbars_group_parser = parser.add_mutually_exclusive_group(required=False)