You are not logged in.
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
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.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
Makes sense. I've edited my post to show my updated pkgbuild.
Offline
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.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
Alright, I'll add it and use _name. Thanks
Last edited by WTechNinja (2022-04-16 14:37:45)
Offline