You are not logged in.

#1 2017-02-15 21:27:34

0xdec
Member
Registered: 2017-02-15
Posts: 2

PKGBUILD review request: ttf-material-design-icons

I'm trying to create a package for Google's Material Design Icons. This is my first time creating a PKGBUILD, so it was modified from ttf-font-awesome. Could someone review this?

PKGBUILD

# Maintainer: Jordi Pakey-Rodriguez <me@jordi.codes>

pkgname=ttf-material-design-icons
pkgver=3.0.1
pkgrel=1

pkgdesc="Material Design icons by Google"
arch=('any')
url="http://google.github.io/material-design-icons/"
license=('Apache-2.0')

depends=('fontconfig' 'xorg-font-utils')
source=("material-design-icons-${pkgver}.tar.gz::https://github.com/google/material-design-icons/archive/v${pkgver}.tar.gz")
sha256sums=('ea1996f82d39f56357754b2b3d9ad8b812065dc059ad488fb086233c360676a0')
install=${pkgname}.install

package() {
  cd material-design-icons-${pkgver}/iconfont
  install -d "${pkgdir}"/usr/share/fonts/TTF
  install -m644 *.ttf "${pkgdir}"/usr/share/fonts/TTF
}

ttf-material-design-icons.install

post_install() {
  printf 'Updating font cache...'
  fc-cache -s > /dev/null
  mkfontscale /usr/share/fonts/TTF
  mkfontdir /usr/share/fonts/TTF
  printf 'done\n'
}

post_upgrade() {
  post_install $1
}

post_remove() {
  post_install $1
}

op=$1
shift

$op $*

Thanks!

Last edited by 0xdec (2017-02-15 21:34:19)

Offline

#2 2017-02-15 21:58:40

mis
Member
Registered: 2016-03-16
Posts: 234

Re: PKGBUILD review request: ttf-material-design-icons

You don't need (and should remove) the .install file. It's all handled by pacman hooks now. https://www.archlinux.org/todo/pacman-h … mkfontdir/

Offline

#3 2017-02-15 22:53:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: PKGBUILD review request: ttf-material-design-icons

Looks good as-is... I tend to use the variables whenever possible but that is just personal preference.  As well, you are only supplying one font so just call it out rather than the wildcard.  Again, personal preference:

# Maintainer: Jordi Pakey-Rodriguez <me@jordi.codes>

pkgname=ttf-material-design-icons
_pkgname=material-design-icons
pkgver=3.0.1
pkgrel=1
pkgdesc="Material Design icons by Google"
arch=('any')
url="http://google.github.io/material-design-icons/"
license=('Apache-2.0')
depends=('fontconfig' 'xorg-font-utils')
source=("https://github.com/google/$_pkgname/archive/$pkgver.tar.gz")
sha256sums=('ea1996f82d39f56357754b2b3d9ad8b812065dc059ad488fb086233c360676a0')

package() {
  install -d "$pkgdir/usr/share/fonts/TTF"
  install -m644 "$_pkgname-$pkgver/iconfont/MaterialIcons-Regular.ttf" "$pkgdir/usr/share/fonts/TTF/MaterialIcons-Regular.ttf"
}

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2017-02-17 04:57:22

0xdec
Member
Registered: 2017-02-15
Posts: 2

Re: PKGBUILD review request: ttf-material-design-icons

Thanks for the advice! I've removed the .install file and have tested graysky's edited PKGBUILD. I think I'll go ahead and submit it at this point, thanks for the help!

Offline

Board footer

Powered by FluxBB