Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pkgname=senpai-git
- _pkgname=senpai
- pkgver=v0.4.1.r31.gd893048
- pkgrel=1
- pkgdesc='A modern terminal IRC client'
- arch=(x86_64 aarch64)
- url='https://git.sr.ht/~delthas/senpai'
- license=('ISC')
- depends=('glibc')
- replaces=('senpai')
- conflicts=('senpai')
- makedepends=('git' 'go' 'scdoc')
- options=('!lto')
- source=("${_pkgname}::git+https://git.sr.ht/~delthas/senpai")
- sha512sums=('SKIP')
- pkgver() {
- cd "$_pkgname"
- git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
- }
- prepare() {
- cd "$_pkgname"
- # download dependencies
- export GOPATH="${srcdir}"
- go mod download
- }
- build() {
- cd "$_pkgname"
- # set Go flags
- export CGO_CPPFLAGS="${CPPFLAGS}"
- export CGO_CFLAGS="${CFLAGS}"
- export CGO_CXXFLAGS="${CXXFLAGS}"
- export GOPATH="${srcdir}"
- go build -v \
- -buildmode=pie \
- -mod=readonly \
- -modcacherw \
- -ldflags "-compressdwarf=false \
- -linkmode external \
- -extldflags '${LDFLAGS}'" \
- ./cmd/senpai
- # documentation
- make doc/senpai.{1,5}
- # ensure reproducibility of man pages
- # i'm not 100% sure where the man sub-command gets the date from, i assume
- # it uses $TODAYS_DATE, so this should make the man page reproducible
- local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)
- sed \
- -i doc/*.{1,5} \
- -e "s/\"[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\"/\"$_commit_date\"/"
- }
- check() {
- cd "$_pkgname"
- go test -v ./...
- }
- package() {
- cd "$_pkgname"
- make DESTDIR="$pkgdir" PREFIX=/usr install
- # license
- install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
- }
Advertisement
Add Comment
Please, Sign In to add comment