diff options
author | Chocobo1 | 2022-08-02 18:46:47 +0800 |
---|---|---|
committer | Chocobo1 | 2022-08-02 18:46:47 +0800 |
commit | 5417f26697d1435866a49388b4c6601fab60b7eb (patch) | |
tree | 92d2bbd41ad21c34cb6b07b4656de522611815ca /PKGBUILD | |
download | aur-glow-git.tar.gz |
newpkg: glow-git 1.4.1.r13.ge078953-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a400ae233e34 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net> + +pkgname=glow-git +pkgver=1.4.1.r13.ge078953 +pkgrel=1 +pkgdesc="Render markdown on the CLI, with pizzazz!" +arch=('i686' 'x86_64') +url="https://github.com/charmbracelet/glow" +license=('MIT') +depends=('glibc') +makedepends=('git' 'go') +provides=("glow=$pkgver") +conflicts=('glow') +source=("git+https://github.com/charmbracelet/glow.git") +sha256sums=('SKIP') + + +export CGO_CPPFLAGS="${CPPFLAGS}" +export CGO_CFLAGS="${CFLAGS}" +export CGO_CXXFLAGS="${CXXFLAGS}" +export CGO_LDFLAGS="${LDFLAGS}" +export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw" + +pkgver() { + cd "glow" + + _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d' | head -n1) + _rev=$(git rev-list --count $_tag..HEAD) + _hash=$(git rev-parse --short HEAD) + printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//' +} + +build() { + cd "glow" + + go build \ + ./ +} + +check() { + cd "glow" + + go test \ + ./... +} + +package() { + cd "glow" + + install -Dm755 "glow" -t "$pkgdir/usr/bin" + install -Dm644 "README.md" -t "$pkgdir/usr/share/doc/glow" + install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/glow" +} |