[arch-commits] Commit in (glow glow/repos glow/trunk glow/trunk/PKGBUILD)

George Rawlinson grawlinson at gemini.archlinux.org
Sun Jan 23 23:13:53 UTC 2022


    Date: Sunday, January 23, 2022 @ 23:13:52
  Author: grawlinson
Revision: 1113979

addpkg: glow 1.4.1-2

Added:
  glow/
  glow/repos/
  glow/trunk/
  glow/trunk/PKGBUILD

----------+
 PKGBUILD |   68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

Added: glow/trunk/PKGBUILD
===================================================================
--- glow/trunk/PKGBUILD	                        (rev 0)
+++ glow/trunk/PKGBUILD	2022-01-23 23:13:52 UTC (rev 1113979)
@@ -0,0 +1,68 @@
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
+# Contributor: Christian Muehlhaeuser <muesli at gmail dot com>
+# Contributor: Stephen Gregoratto <dev at sgregoratto.me>
+
+pkgname=glow
+pkgver=1.4.1
+pkgrel=2
+pkgdesc="Command-line markdown renderer"
+arch=('x86_64')
+url="https://github.com/charmbracelet/glow"
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='4863f57cea794c62b6667b9d6aec478e9a49080c'
+source=("$pkgname::git+$url.git#commit=$_commit")
+b2sums=('SKIP')
+
+pkgver() {
+  cd "$pkgname"
+
+  git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+  cd "$pkgname"
+
+  # create directory for build output
+  mkdir build
+
+  # download dependencies
+  go mod download
+}
+
+build() {
+  cd "$pkgname"
+
+  # set Go flags
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+
+  go build -v \
+    -trimpath \
+    -buildmode=pie \
+    -mod=readonly \
+    -modcacherw \
+    -ldflags "-linkmode external -extldflags $LDFLAGS \
+    -X main.Version=$pkgver \
+    -X main.CommitSHA=$_commit" \
+    -o build \
+    .
+}
+
+package() {
+  cd "$pkgname"
+
+  # binary
+  install -vDm755 -t "$pkgdir/usr/bin" build/glow
+
+  # documentation
+  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
+
+  # license
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}
+
+# vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list