PKGBUILD 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Maintainer: Adrian Lopez <zeioth@hotmail.com>
  2. # Maintainer: txtsd <aur.archlinux@ihavea.quest>
  3. pkgname=linux-command-gpt-git
  4. _pkgname=linux-command-gpt
  5. pkgver=v0.1.2.r0.g952eee1
  6. pkgrel=2
  7. pkgdesc='Get Linux commands in natural language with the power of ChatGPT'
  8. arch=('x86_64' 'aarch64')
  9. url='https://github.com/asrul10/linux-command-gpt'
  10. license=('MIT')
  11. depends=('glibc')
  12. makedepends=('git' 'go')
  13. provides=('linux-command-gpt')
  14. conflicts=('linux-command-gpt')
  15. source=("git+${url}")
  16. sha256sums=('SKIP')
  17. pkgver() {
  18. cd "${_pkgname}"
  19. git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  20. }
  21. build() {
  22. cd "${_pkgname}"
  23. # https://wiki.archlinux.org/index.php/Go_package_guidelines
  24. export CGO_CPPFLAGS="${CPPFLAGS}"
  25. export CGO_CFLAGS="${CFLAGS}"
  26. export CGO_CXXFLAGS="${CXXFLAGS}"
  27. export CGO_LDFLAGS="${LDFLAGS}"
  28. export GOPATH="${srcdir}/go"
  29. export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  30. go build -o lcg
  31. }
  32. check() {
  33. cd "${_pkgname}"
  34. go test ./...
  35. }
  36. package() {
  37. cd "${_pkgname}"
  38. install -Dm755 "lcg" "${pkgdir}/usr/bin/lcg"
  39. install -Dm755 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  40. }