Feedback for PKGBUILD before AUR submission

I have created the following PKGBUILD for WebFontKitGenerator. I have checked that it builds successfully. I would be glad to have some feedback before I submit it to the AUR.

# Maintainer: Archisman Panigrahi <apandada1 at gmail dot com>
pkgname=webfontkitgenerator-git
_pkgname=webfontkitgenerator
pkgver=v0.3.0.r36.gc8b41a1
pkgrel=1
pkgdesc="Webfont Kit Generator is a simple utility that allows you to generate woff, woff2 and the necessary CSS boilerplate from non-web font formats (otf & ttf)."
arch=('any')
url="https://github.com/rafaelmardojai/webfontkitgenerator"
provides=('webfontkitgenerator')
conflicts=('webfontkitgenerator')
license=('GPL3')
depends=('gtk3' 'gtksourceview4' 'gst-python' 'libhandy-git' 'python-fonttools' 'python-brotli')
makedepends=('meson')
source=("git+https://github.com/rafaelmardojai/webfontkitgenerator.git")
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	arch-meson $_pkgname build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install -C build
}

When I run namcap I get the following warning. Is this normal?

$ namcap webfontkitgenerator-git-v0.3.0.r36.gc8b41a1-1-any.pkg.tar.zst 
webfontkitgenerator-git W: Dependency included and not needed ('gtk3')
webfontkitgenerator-git W: Dependency included and not needed ('gtksourceview4')
webfontkitgenerator-git W: Dependency included and not needed ('gst-python')
webfontkitgenerator-git W: Dependency included and not needed ('python-fonttools')
webfontkitgenerator-git W: Dependency included and not needed ('libhandy-git')
webfontkitgenerator-git W: Dependency included and not needed ('python-brotli')

All these dependencies are indeed needed.

Looks good. Corrections and critique:

  • If tag contains a prefix, like v or project name then it should be cut off

    See: The pkgver() function

  • No need to create an unnecessary $_pkgname variable, use ${pkgname%-git}.

    See Package etiquette and /usr/share/pacman/PKGBUILD-vcs.proto

  • Try and keep each line no more than 80 - 100 characters and do not include the package name in the description. Use the About header which is also the Debian package description.

    See pkgdesc

  • git is missing from makedepends()

  • Optionally include the check() function to run the Meson tests.

For Meson and Python packages, yes. namcap cannot detect Python module dependencies and has trouble when there are no ELF files.

1 Like

@Yochanan Thanks, how about this?

# Maintainer: Archisman Panigrahi <apandada1 at gmail dot com>
pkgname=webfontkitgenerator-git
pkgver=0.3.0.r36.gc8b41a1
pkgrel=1
pkgdesc="Create @font-face kits easily"
arch=('any')
url="https://github.com/rafaelmardojai/webfontkitgenerator"
provides=('webfontkitgenerator')
conflicts=('webfontkitgenerator')
license=('GPL3')
depends=('gtk3' 'gtksourceview4' 'gst-python' 'libhandy-git' 'python-fonttools' 'python-brotli')
makedepends=('meson' 'git')
source=("git+https://github.com/rafaelmardojai/webfontkitgenerator.git")
sha256sums=('SKIP')

pkgver() {
  cd ${pkgname%-git}
  # cutting off 'v' prefix in the git tag
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	arch-meson ${pkgname%-git} build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install -C build
}

Can I also add the following line? :grin:

# Special thanks to: Mark Wagie (yochananmarqos) 

Looks great! :+1:

Not important, but you can also use ${pkgname%-git} in the provides() and conflicts() arrays.

Sure.

Done.
https://aur.archlinux.org/packages/webfontkitgenerator-git/

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.