You are not logged in.

#1 2022-04-15 05:17:06

WTechNinja
Member
Registered: 2020-11-16
Posts: 7

PKGBUILD review request: dict-git

Hello,
If this looks good to you guys, it'll be my first aur pkgbuild.

# Maintainer: Walter Broemeling <wallebroem at gmail dot com>

pkgname=dict-git
_name=dict
pkgver=r14.c4c929a
pkgrel=1
pkgdesc="A dictionary, for the command line."
arch=('x86_64')
url="https://github.com/BetaPictoris/dict"
license=('MIT')
depends=('glibc')
makedepends=('go' 'git')
provides=('dict')
conflicts=('dict')
source=('git+https://github.com/BetaPictoris/dict.git')
md5sums=('SKIP')

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

build() {
	cd "$_name"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
	go build -o dict ./src/main.go
}

package() {
	cd "$_name"
	install -Dm755 dict "$pkgdir/usr/bin/dict"
	install -Dm644 license "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

If anything can be improved, please let me know.

Last edited by WTechNinja (2022-04-16 14:41:08)

Offline

#2 2022-04-15 10:49:14

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,067

Re: PKGBUILD review request: dict-git

from upstream

git clone git@github.com:BetaPictoris/dict.git      # Clone the repository
cd dict                                             # Change into the repository's directory
make                                                # Build Wiki CLI
sudo make install                                   # Install Wiki CLI to "/usr/local/bin" with the mode "755"

That suggests you need to run make install in package() and make sure both build() and package() use /usr instead of /usr/local .

Hmmm, the make file looks very limited and doesn't support changing install location .

It's probably easier to ignore the makefile and use go directly .
See https://wiki.archlinux.org/title/Go_package_guidelines


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2022-04-15 14:18:33

WTechNinja
Member
Registered: 2020-11-16
Posts: 7

Re: PKGBUILD review request: dict-git

Makes sense. I've edited my post to show my updated pkgbuild.

Offline

#4 2022-04-16 10:55:24

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,067

Re: PKGBUILD review request: dict-git

dict-git E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6'] needed in files ['usr/bin/dict'])

Building in a clean chroot (extra-x86_64-build from devtools)  gives the above error, and there are no dependencies listed at all in the PKGBUILD.
While glibc is very common on archlinux and *nix systems in general there are alternatives like musl .

I suggest you add glibc as dependency .

nitpick :

pkgbase is useful for split packages with multiple package() functions.
This pkgbuild has only one package() function which makes seeing _pkgbase feeling like it doesn't fit.
I would use _name or _pkgname instead.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2022-04-16 13:33:29

WTechNinja
Member
Registered: 2020-11-16
Posts: 7

Re: PKGBUILD review request: dict-git

Alright, I'll add it and use _name. Thanks

Last edited by WTechNinja (2022-04-16 14:37:45)

Offline

Board footer

Powered by FluxBB