1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
6 pkgdesc='A tool for glamorous shell scripts'
8 url='https://github.com/charmbracelet/gum'
11 makedepends=('git' 'go')
13 _commit='0f0f8e91899ac7a7aa2996623f979dfe6bbc5940'
14 source=("$pkgname::git+$url#commit=$_commit")
20 git describe --tags | sed 's/^v//'
26 # create directory for build output
29 # download dependencies
30 export GOPATH="${srcdir}"
38 export CGO_CPPFLAGS="${CPPFLAGS}"
39 export CGO_CFLAGS="${CFLAGS}"
40 export CGO_CXXFLAGS="${CXXFLAGS}"
41 export GOPATH="${srcdir}"
43 # commit date for binary & man page
44 local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)
50 -ldflags "-compressdwarf=false \
52 -extldflags ${LDFLAGS} \
53 -X main.Version=$pkgver \
54 -X main.CommitSHA=$_commit \
55 -X main.CommitDate=$_commit_date" \
60 ./build/gum man > build/gum.1
62 # i'm not 100% sure where the man sub-command gets the date from, i assume
63 # it uses $TODAYS_DATE, so this should make the man page reproducible
66 -e "s/\"[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\"/\"$_commit_date\"/"
69 for shell in bash fish zsh; do
70 ./build/gum completion "$shell" > "build/$shell-completion"
78 install -vDm755 -t "$pkgdir/usr/bin" build/gum
81 install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
84 install -vDm644 -t "$pkgdir/usr/share/man/man1" build/gum.1
87 install -vDm644 build/bash-completion "$pkgdir/usr/share/bash-completion/completions/gum"
88 install -vDm644 build/fish-completion "$pkgdir/usr/share/fish/vendor_completions.d/gum.fish"
89 install -vDm644 build/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_gum"
92 install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE