You are not logged in.

#1 2021-11-23 16:28:51

Supreme
Member
Registered: 2021-11-23
Posts: 4

PKGBUILD review request: mspdebug-git

Looking for feedback for my PKGBUILD for https://github.com/dlbeer/mspdebug. There's a package in the AUR already for it, but it's for the releases and not the latest commit, which is more updated and fixed an issue for me.

pkgname='mspdebug-git'
pkgrel=1
pkgver=r827.a1a06e7
pkgdesc="Free debugger for MSP430 MCUs"
arch=('x86_64')
url="https://github.com/dlbeer/mspdebug"
license=('GPL')
depends=('libusb' 'readline')
conflicts=('mspdebug')
source=("$pkgname-$pkgver::git+https://github.com/dlbeer/mspdebug.git")

pkgver() {
    cd "$pkgname-$pkgver"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build(){
    cd "$pkgname-$pkgver"
    make
}
package(){
    cd "$pkgname-$pkgver"
    make DESTDIR="$pkgdir" PREFIX="/usr" install
}
sha256sums=('SKIP')

Offline

#2 2021-11-23 17:40:32

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: PKGBUILD review request: mspdebug-git

Missing makdepends on git.  Fails to build in a clean chroot using libusb,  replacing with libusb-compat it does build.
Formatting minor gripe by convention the checksums go just after the source entry.

Offline

#3 2021-11-23 17:50:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: PKGBUILD review request: mspdebug-git

The repo has tags, the pkgver should use them.
Missing provides array.
You really, REALLY should not be renaming the source dir like that. It will keep cloning the upstream repo over and over instead of updating it, and I don't even know how it will handle it when the pkgver changes on a single run.

Offline

#4 2021-11-23 17:55:53

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: PKGBUILD review request: mspdebug-git

Scimmia wrote:

I don't even know how it will handle it when the pkgver changes on a single run.

==> Starting pkgver()...
==> Updated version: mspdebug-git r827.a1a06e7-1
==> Starting build()...
/startdir/PKGBUILD: line 18: cd: mspdebug-git-r827.a1a06e7: No such file or directory

Offline

#5 2021-11-24 20:06:00

Supreme
Member
Registered: 2021-11-23
Posts: 4

Re: PKGBUILD review request: mspdebug-git

Scimmia wrote:

The repo has tags, the pkgver should use them.

The last tag is from 2017 though, and there have been a lot of commits since then. Should I still use that tag?

Offline

#6 2021-11-24 20:32:07

Supreme
Member
Registered: 2021-11-23
Posts: 4

Re: PKGBUILD review request: mspdebug-git

I re-read the PKGBUILD guidelines for VCS and I think I understand what you mean now. Here's an updated PKGBUILD:

# Maintainer: Supreme <criteria32 at gmail dot com>
pkgname='mspdebug-git'
pkgrel=1
pkgver=v0.25.r76.ga1a06e7
pkgdesc="Free debugger for MSP430 MCUs"
arch=('x86_64')
url="https://github.com/dlbeer/mspdebug"
license=('GPL')
depends=('libusb-compat' 'readline')
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/dlbeer/mspdebug.git")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/${pkgname%-git}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' 
}
build(){
    cd "$srcdir/${pkgname%-git}"
    make
}
package(){
    cd "$srcdir/${pkgname%-git}"
    make DESTDIR="$pkgdir" PREFIX="/usr" install
}

Last edited by Supreme (2021-11-24 20:39:43)

Offline

#7 2021-11-24 20:38:04

loqs
Member
Registered: 2014-03-06
Posts: 17,194

Re: PKGBUILD review request: mspdebug-git

==> ERROR: conflicts contains invalid characters: '${%}'
==> ERROR: provides contains invalid characters: '${%}'

String substitution needs double quotes.

Offline

#8 2021-11-24 20:40:05

Supreme
Member
Registered: 2021-11-23
Posts: 4

Re: PKGBUILD review request: mspdebug-git

Yeah just caught that lol

Offline

Board footer

Powered by FluxBB