Guest User

Untitled

a guest
Dec 29th, 2025
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. pkgname=senpai-git
  2. _pkgname=senpai
  3. pkgver=v0.4.1.r31.gd893048
  4. pkgrel=1
  5. pkgdesc='A modern terminal IRC client'
  6. arch=(x86_64 aarch64)
  7. url='https://git.sr.ht/~delthas/senpai'
  8. license=('ISC')
  9. depends=('glibc')
  10. replaces=('senpai')
  11. conflicts=('senpai')
  12. makedepends=('git' 'go' 'scdoc')
  13. options=('!lto')
  14. source=("${_pkgname}::git+https://git.sr.ht/~delthas/senpai")
  15. sha512sums=('SKIP')
  16.  
  17. pkgver() {
  18. cd "$_pkgname"
  19. git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  20. }
  21.  
  22. prepare() {
  23. cd "$_pkgname"
  24.  
  25. # download dependencies
  26. export GOPATH="${srcdir}"
  27. go mod download
  28. }
  29.  
  30. build() {
  31. cd "$_pkgname"
  32.  
  33. # set Go flags
  34. export CGO_CPPFLAGS="${CPPFLAGS}"
  35. export CGO_CFLAGS="${CFLAGS}"
  36. export CGO_CXXFLAGS="${CXXFLAGS}"
  37. export GOPATH="${srcdir}"
  38.  
  39. go build -v \
  40. -buildmode=pie \
  41. -mod=readonly \
  42. -modcacherw \
  43. -ldflags "-compressdwarf=false \
  44. -linkmode external \
  45. -extldflags '${LDFLAGS}'" \
  46. ./cmd/senpai
  47.  
  48. # documentation
  49. make doc/senpai.{1,5}
  50.  
  51. # ensure reproducibility of man pages
  52. # i'm not 100% sure where the man sub-command gets the date from, i assume
  53. # it uses $TODAYS_DATE, so this should make the man page reproducible
  54. local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)
  55. sed \
  56. -i doc/*.{1,5} \
  57. -e "s/\"[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\"/\"$_commit_date\"/"
  58. }
  59.  
  60. check() {
  61. cd "$_pkgname"
  62.  
  63. go test -v ./...
  64. }
  65.  
  66. package() {
  67. cd "$_pkgname"
  68.  
  69. make DESTDIR="$pkgdir" PREFIX=/usr install
  70.  
  71. # license
  72. install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment