PKGBUILD 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Maintainer: txtsd <aur.archlinux@ihavea.quest>
  2. pkgname=gtkcord4-git
  3. _pkgname=gtkcord4
  4. pkgver=r191.9648b7c
  5. pkgrel=1
  6. pkgdesc='Discord client written in go and gtk4'
  7. arch=('x86_64' 'aarch64')
  8. url='https://github.com/diamondburned/gtkcord4'
  9. license=('GPL3')
  10. depends=('gtk4' 'gobject-introspection' 'libadwaita')
  11. provides=('gtkcord4')
  12. conflicts=('gtkcord4')
  13. makedepends=('git' 'go')
  14. source=('git+https://github.com/diamondburned/gtkcord4')
  15. sha256sums=('SKIP')
  16. pkgver() {
  17. cd "${_pkgname}"
  18. printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  19. }
  20. prepare() {
  21. cd "${_pkgname}"
  22. mkdir -p build
  23. }
  24. build() {
  25. cd "${_pkgname}"
  26. # https://wiki.archlinux.org/index.php/Go_package_guidelines
  27. export CGO_CPPFLAGS="${CPPFLAGS}"
  28. export CGO_CFLAGS="${CFLAGS}"
  29. export CGO_CXXFLAGS="${CXXFLAGS}"
  30. export CGO_LDFLAGS="${LDFLAGS}"
  31. export GOPATH="${srcdir}/go"
  32. export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  33. go build -o build
  34. }
  35. package() {
  36. cd "${_pkgname}/build"
  37. install -Dm755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  38. install -Dm644 "${srcdir}/${_pkgname}/LICENSE.md" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
  39. sed -i "s/Chat;/Chat;InstantMessaging;/" "${srcdir}/${_pkgname}/nix/xyz.diamondb.gtkcord4.desktop"
  40. install -Dm644 "${srcdir}/${_pkgname}/nix/xyz.diamondb.gtkcord4.desktop" "${pkgdir}/usr/share/applications/gtkcord4.desktop"
  41. install -Dm644 "${srcdir}/${_pkgname}/xyz.diamondb.gtkcord4.metainfo.xml" "${pkgdir}/usr/share/metainfo/gtkcord4.metainfo.xml"
  42. install -Dm644 "${srcdir}/${_pkgname}/internal/icons/png/logo.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/gtkcord4.png"
  43. install -Dm644 "${srcdir}/${_pkgname}/internal/icons/svg/logo.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/gtkcord4.png"
  44. }