[arch-commits] Commit in gum/repos/community-x86_64 (PKGBUILD PKGBUILD)

George Rawlinson grawlinson at gemini.archlinux.org
Mon Aug 1 08:36:50 UTC 2022


    Date: Monday, August 1, 2022 @ 08:36:50
  Author: grawlinson
Revision: 1259637

archrelease: copy trunk to community-x86_64

Added:
  gum/repos/community-x86_64/PKGBUILD
    (from rev 1259636, gum/trunk/PKGBUILD)
Deleted:
  gum/repos/community-x86_64/PKGBUILD

----------+
 PKGBUILD |  166 +++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 90 insertions(+), 76 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2022-08-01 08:36:14 UTC (rev 1259636)
+++ PKGBUILD	2022-08-01 08:36:50 UTC (rev 1259637)
@@ -1,76 +0,0 @@
-# Maintainer: George Rawlinson <grawlinson at archlinux.org>
-
-pkgname=gum
-pkgver=0.2.0
-pkgrel=3
-pkgdesc='A tool for glamorous shell scripts'
-arch=('x86_64')
-url='https://github.com/charmbracelet/gum'
-license=('MIT')
-depends=('glibc')
-makedepends=('git' 'go')
-options=('!lto')
-_commit='b7f04e04ef7c2eeae0d90b2303eb8cee2c6e599d'
-source=("$pkgname::git+$url#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}" \
-    -o build \
-    .
-
-  ./build/gum man > build/gum.1
-
-  for shell in bash fish zsh; do
-    ./build/gum completion "$shell" > "build/$shell-completion"
-  done
-}
-
-package() {
-  cd "$pkgname"
-
-  # binary
-  install -vDm755 -t "$pkgdir/usr/bin" build/gum
-
-  # documentation
-  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
-
-  # man pages
-  install -vDm644 -t "$pkgdir/usr/share/man/man1" build/gum.1
-
-  # completions
-  install -vDm644 build/bash-completion "$pkgdir/usr/share/bash-completion/completions/gum"
-  install -vDm644 build/fish-completion "$pkgdir/usr/share/fish/vendor_completions.d/gum.fish"
-  install -vDm644 build/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_gum"
-
-  # license
-  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
-}

Copied: gum/repos/community-x86_64/PKGBUILD (from rev 1259636, gum/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2022-08-01 08:36:50 UTC (rev 1259637)
@@ -0,0 +1,90 @@
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
+
+pkgname=gum
+pkgver=0.2.0
+pkgrel=4
+pkgdesc='A tool for glamorous shell scripts'
+arch=('x86_64')
+url='https://github.com/charmbracelet/gum'
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='b7f04e04ef7c2eeae0d90b2303eb8cee2c6e599d'
+source=("$pkgname::git+$url#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}"
+
+  # commit date for binary & man page
+  local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)
+
+  go build -v \
+    -trimpath \
+    -buildmode=pie \
+    -mod=readonly \
+    -modcacherw \
+    -ldflags "-linkmode external -extldflags ${LDFLAGS} \
+    -X main.Version=$pkgver \
+    -X main.CommitSHA=$_commit \
+    -X main.CommitDate=$_commit_date" \
+    -o build \
+    .
+
+  # man page
+  ./build/gum man > build/gum.1
+
+  # 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
+  sed \
+    -i build/gum.1 \
+    -e "s/\"[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\"/\"$_commit_date\"/"
+
+  # completions
+  for shell in bash fish zsh; do
+    ./build/gum completion "$shell" > "build/$shell-completion"
+  done
+}
+
+package() {
+  cd "$pkgname"
+
+  # binary
+  install -vDm755 -t "$pkgdir/usr/bin" build/gum
+
+  # documentation
+  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
+
+  # man pages
+  install -vDm644 -t "$pkgdir/usr/share/man/man1" build/gum.1
+
+  # completions
+  install -vDm644 build/bash-completion "$pkgdir/usr/share/bash-completion/completions/gum"
+  install -vDm644 build/fish-completion "$pkgdir/usr/share/fish/vendor_completions.d/gum.fish"
+  install -vDm644 build/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_gum"
+
+  # license
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}



More information about the arch-commits mailing list