# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Markus Tacker <m@cto.hiv>
# Contributor: Peter Hoeg <peter@hoeg.com>
# Included in Slint by Didier Spaier dideratslintdotfr
pkgname=font-hack-ttf
export srcname=Hack
pkgver=3.003
pkgrel=1slint
slackdesc=("$pkgname (A hand groomed font based on Bitstream Vera Mono)"
"this typeface is optically balanced"
"url: https://sourcefoundry.org/hack/"
)
docs=("LICENSE.html" "README.html" "FAQ.html" "CONTRIBUTING.html")
options=("nosrcpack" "noautodotnew")
source=("https://github.com/source-foundry/Hack/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('3c6f1a20e86744077e83c9bacf879a5b13f659f1c07e9c5c57d6efc3cbe66c07')
doinst() {
  if [ -x /usr/bin/mkfontdir ]; then
    mkfontscale usr/share/fonts/TTF 2> /dev/null
    mkfontdir usr/share/fonts/TTF 2> /dev/null
  fi
  if [ -x /usr/bin/fc-cache ]; then
    /usr/bin/fc-cache -f 2> /dev/null
  fi
}
build() {
  cd ${srcname}-$pkgver
  for i in LICENSE README FAQ CONTRIBUTING; do
    pandoc -f gfm -t html5 -o ${i}.html ${i}.md || exit 1
  done
  mkdir -p "$PKG"/usr/share/fonts/TTF
  cp -r build/ttf/Hack-*.ttf "$PKG"/usr/share/fonts/TTF
  install -Dm644 config/fontconfig/45-Hack.conf -t $PKG/etc/fonts/conf.avail
}
