[aur-general] Critique my pkgbuild

Morten Linderud foxboron at archlinux.org
Wed Oct 10 13:48:31 UTC 2018


On Wed, Oct 10, 2018 at 01:34:25PM +0000, Ethan Rakoff wrote:
> # Maintainer: Ethan Rakoff <ethan at ethanrakoff.com>
> 
> pkgname=threemawebqt

Needs to have a -git suffix as it builds from a git source and is thus a VCS
package.

> pkgver=0.1

You need a pkgver() function as this is an VCS package. Since you don't have
tags yet you should count the number of revisions.

    pkgver() {
      cd "$pkgname"
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    }

https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git

> pkgrel=1
> pkgdesc="Thin client for Threema Web, the web client for Threema, an E2E encrypted messaging app."
> arch=('i686' 'x86_64')
> url="https://github.com/ethanrakoff/${pkgname}"
> license=('MIT')
> depends=('qt5-base' 'qt5-webengine')
> makedepends=('make')

`make` is present in `base-devel` thus shouldn't be a listed dependency. Unsure
if its however worth listing it as it's the only needed build-time dependency?

> source=("git+${url}")

I personally dislike the need to use variables just because they exist.

This reads much better:
    source=("git+https://github.com/ethanrakoff/threemawebqt")

> md5sums=('SKIP')
> 
> build() {
>   cd "${pkgname}/src"
> 
>   qmake
>   make
> }
> 
> package() {
>   cd "${srcdir}/${pkgname}/src"

You omitted `$srcdir` from `build()` but added it here. This is mostly a style
thing, but I'd just omit it all together.

>   make INSTALL_ROOT="${pkgdir}" install
> 
>   install -Dm644 icon.png "${pkgdir}/usr/share/icons/${pkgname}/icon.png"
>   install -Dm644 ../threemawebqt.desktop "${pkgdir}/usr/share/applications/threemawebqt.desktop"
>   install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
> }
> 




-- 
Morten Linderud
PGP: 9C02FF419FECBE16
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20181010/d13ccdc9/attachment.asc>


More information about the aur-general mailing list