summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSon Tran2017-08-14 19:16:53 -0700
committerSon Tran2017-08-14 19:16:53 -0700
commita66f958ccc93ef8c95035c03ab762cae92dac32f (patch)
tree12077501a05b4f2ce4b09d7edce0b899a5385a80
parent34a53c1247ec753e4d834494a62338de7206bb4b (diff)
downloadaur-a66f958ccc93ef8c95035c03ab762cae92dac32f.tar.gz
Follow Arch packaging standards
Thanks to @midgard for suggestions
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD37
2 files changed, 20 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5eedc50a61bf..b59786be562f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,11 @@
pkgbase = nerd-fonts-complete
pkgdesc = collection of over 20 patched fonts (complete variant) for powerline, devicons, and vim-devicons: includes Droid Sans, Meslo, AnonymousPro, ProFont, Inconsolta, and many more
pkgver = 1.1.0
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/ryanoasis/nerd-fonts
install = nerd-fonts-complete.install
arch = any
license = MIT
- makedepends = wget
depends = fontconfig
depends = xorg-font-utils
conflicts = nerd-fonts-git
diff --git a/PKGBUILD b/PKGBUILD
index f7ece53841d4..eec5b4109eb5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Maintainer: glider <samtron1412 {at} gmail {dot} com>
pkgname=nerd-fonts-complete
pkgver=1.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="collection of over 20 patched fonts (complete variant) for \
powerline, devicons, and vim-devicons: includes Droid Sans, \
Meslo, AnonymousPro, ProFont, Inconsolta, and many more"
@@ -10,16 +10,15 @@ arch=('any')
url="https://github.com/ryanoasis/nerd-fonts"
license=('MIT')
depends=('fontconfig' 'xorg-font-utils')
-makedepends=('wget')
conflicts=('nerd-fonts-git' 'nerd-fonts-complete-mono-glyphs')
install=$pkgname.install
source=("$pkgname-$pkgver.tar.gz::https://github.com/ryanoasis/nerd-fonts/archive/v$pkgver.tar.gz")
sha256sums=('ee7ae13f09ec576e2fb3da71b8aa217eae152a64e375697f16529b7182cedb27')
prepare() {
- extension="otf"
- nerdfonts_dir="$srcdir/nerd-fonts-$pkgver/patched-fonts"
- fonts_dir="\"$nerdfonts_dir\""
+ local extension="otf"
+ local nerdfonts_dir="$srcdir/nerd-fonts-$pkgver/patched-fonts"
+ local fonts_dir="'${nerdfonts_dir//\'/\'\\\'\'}'"
#
# Start constructing `find` expression
#
@@ -32,28 +31,30 @@ prepare() {
shift 3 || shift $(($#))
printf -v "$retname" "%s" "$ret${@/#/$sep}"
}
- find_include=
- find_exclude=
+ local find_include=
+ local find_exclude=
# Include things
- include=("Complete")
+ local include=("Complete")
if [ ! -z "${include[*]}" ]; then
implode find_include "*' -and -name '*" "${include[@]}"
find_include="-and -name '*${find_include}*'"
fi
# Exclude everything we didn’t include
- exclude=("Font Awesome" "Font Linux" "Octicons" "Pomicons" "Windows Compatible")
+ local exclude=("Font Awesome" "Font Linux" "Octicons" "Pomicons" \
+ "Windows Compatible")
if [ ! -z "${exclude[*]}" ]; then
implode find_exclude "*' -and \! -name '*" "${exclude[@]}"
find_exclude="-and \! -name '*${find_exclude}*'"
fi
# Put it all together into the find command we want
- find_command="find $fonts_dir \( \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) $find_include $find_exclude \) -type f -print0"
+ local find_command="find $fonts_dir \( \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) \
+ $find_include $find_exclude \) -type f -print0"
# Find all the font files and store in array
- files=()
+ local files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(eval "$find_command")
@@ -62,7 +63,7 @@ prepare() {
# Remove duplicates (i.e. when both otf and ttf version present)
#
# Get list of file names without extensions
- files_dedup=( "${files[@]}" )
+ local files_dedup=( "${files[@]}" )
for i in "${!files_dedup[@]}"; do
files_dedup[$i]="${files_dedup[$i]%.*}"
done
@@ -72,7 +73,7 @@ prepare() {
for j in "${!files_dedup[@]}"; do
[ $i = $j ] && continue
if [ "${files_dedup[$i]}" = "${files_dedup[$j]}" ]; then
- ext="${files[$i]##*.}"
+ local ext="${files[$i]##*.}"
# Only remove if the extension is the one we don’t want
if [ "$ext" != "$extension" ]; then
unset files[$i]
@@ -82,12 +83,12 @@ prepare() {
done
# Copy fonts to the NerdFonts directory
- mkdir -p "$srcdir/NerdFonts"
- cp -f "${files[@]}" "$srcdir/NerdFonts"
+ mkdir -p "$srcdir"/NerdFonts
+ cp -f "${files[@]}" "$srcdir"/NerdFonts
}
package() {
- install -Dm644 -t $pkgdir/usr/share/fonts/OTF $srcdir/NerdFonts/*.otf
- install -Dm644 -t $pkgdir/usr/share/fonts/TTF $srcdir/NerdFonts/*.ttf
- install -Dm644 -t $pkgdir/usr/share/licenses/$pkgname $srcdir/nerd-fonts-$pkgver/LICENSE
+ install -Dm644 -t "$pkgdir"/usr/share/fonts/OTF "$srcdir"/NerdFonts/*.otf
+ install -Dm644 -t "$pkgdir"/usr/share/fonts/TTF "$srcdir"/NerdFonts/*.ttf
+ install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname "$srcdir"/nerd-fonts-$pkgver/LICENSE
}