diff options
author | txtsd | 2023-03-20 00:26:26 +0530 |
---|---|---|
committer | txtsd | 2023-03-20 00:28:10 +0530 |
commit | b90863140e6ab690f116d9fe0953f91514cde7af (patch) | |
tree | c0d7cb5f7719fcb60e3e2432dab1ac5f411970a9 /PKGBUILD | |
parent | 4557100d90e15b268ea1340ebd586c0944dcc50b (diff) | |
download | aur-b90863140e6ab690f116d9fe0953f91514cde7af.tar.gz |
upgpkg: linux-command-gpt-git v0.1.2.r0.g952eee1-1
Follow best practices
Signed-off-by: txtsd <code@ihavea.quest>
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 63 |
1 files changed, 35 insertions, 28 deletions
@@ -1,39 +1,46 @@ # Maintainer: Adrian Lopez <zeioth@hotmail.com> +# Maintainer: txtsd <aur.archlinux@ihavea.quest> + pkgname=linux-command-gpt-git -pkgver=1.0.r6.59125fa -pkgrel=2 -epoch= -pkgdesc="Get Linux commands in natural language with the power of ChatGPT." -arch=(any) -url="https://github.com/asrul10/linux-command-gpt.git" +_pkgname=linux-command-gpt +pkgver=v0.1.2.r0.g952eee1 +pkgrel=1 +pkgdesc='Get Linux commands in natural language with the power of ChatGPT' +arch=('x86_64' 'aarch64') +url='https://github.com/asrul10/linux-command-gpt' license=('MIT') -groups=() -depends=(go) -makedepends=(go) -checkdepends=() -optdepends=() -provides=(linux-command-gpt-git) -conflicts=(linux-command-gpt) -replaces=() -backup=() -options=() -install= -changelog= -source=("git+$url") -noextract=() +depends=('glibc') +makedepends=('go') +provides=('linux-command-gpt') +conflicts=('linux-command-gpt') +source=("git+${url}") sha256sums=('SKIP') -validpgpkeys=() pkgver() { + cd "${_pkgname}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + cd "${_pkgname}" + # https://wiki.archlinux.org/index.php/Go_package_guidelines + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOPATH="${srcdir}/go" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -o lcg +} + +check() { cd "${_pkgname}" - printf "1.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + go test ./... } package() { - # Compile - cd "${srcdir}"/linux-command-gpt - go build -o lcg - - # Add it to /usr/bin to make it executable - install -Dm755 "${srcdir}/linux-command-gpt/lcg" "${pkgdir}/usr/bin/lcg" + cd "${_pkgname}" + install -Dm755 "lcg" "${pkgdir}/usr/bin/lcg" + install -Dm755 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } + |