[arch-commits] Commit in (5 files)

George Rawlinson grawlinson at gemini.archlinux.org
Tue Aug 17 01:55:04 UTC 2021


    Date: Tuesday, August 17, 2021 @ 01:55:04
  Author: grawlinson
Revision: 1001109

addpkg: elvish 0.15.0-3

Added:
  elvish/
  elvish/repos/
  elvish/trunk/
  elvish/trunk/PKGBUILD
  elvish/trunk/elvish.install

----------------+
 PKGBUILD       |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 elvish.install |   14 +++++++++++++
 2 files changed, 71 insertions(+)

Added: elvish/trunk/PKGBUILD
===================================================================
--- elvish/trunk/PKGBUILD	                        (rev 0)
+++ elvish/trunk/PKGBUILD	2021-08-17 01:55:04 UTC (rev 1001109)
@@ -0,0 +1,57 @@
+# Maintainer: George Rawlinson <grawlinson at archlinux.org>
+# Contributor: Haochen Tong <i at hexchain dot org>
+# Contributor: Qi Xiao <xiaqqaix at gmail dot com>
+
+pkgname=elvish
+pkgver=0.15.0
+pkgrel=3
+pkgdesc="A friendly and expressive Unix shell"
+arch=('x86_64')
+url="https://github.com/elves/elvish"
+license=('BSD')
+makedepends=('git' 'go')
+install="$pkgname.install"
+source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
+b2sums=('51ccf4bf51e1d750ee10b95b67c819f3d81b5bf494c0257bd7cc20d16a7de0a4e6ff61623d1fe358c3ce2d9cb360af4732a899c66a831bae66f967bb061b2c8a')
+
+prepare() {
+  cd "$pkgname-$pkgver"
+  mkdir build
+  go mod vendor
+}
+
+build() {
+  cd "$pkgname-$pkgver"
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+
+  go build -v \
+    -trimpath \
+    -buildmode=pie \
+    -mod=vendor \
+    -modcacherw \
+    -ldflags "-linkmode external -extldflags ${LDFLAGS} \
+    -X github.com/elves/elvish/pkg/buildinfo.Reproducible=true \
+    -X github.com/elves/elvish/pkg/buildinfo.Version=$pkgver" \
+    -o build \
+    ./cmd/...
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+  go test -v -race ./...
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+
+  # binary
+  install -vDm755 -t "$pkgdir/usr/bin" build/elvish
+
+  # documentation
+  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
+
+  # license
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}

Added: elvish/trunk/elvish.install
===================================================================
--- elvish/trunk/elvish.install	                        (rev 0)
+++ elvish/trunk/elvish.install	2021-08-17 01:55:04 UTC (rev 1001109)
@@ -0,0 +1,14 @@
+post_install() {
+  grep -qe '^/bin/elvish$' etc/shells || echo '/bin/elvish' >> etc/shells
+  grep -qe '^/usr/bin/elvish$' etc/shells || echo '/usr/bin/elvish' >> etc/shells
+}
+
+post_upgrade() {
+  post_install
+}
+
+pre_remove() {
+  sed -i -r '/^(\/usr)?\/bin\/elvish$/d' etc/shells
+}
+
+# vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list