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

Anatol Pomozov anatolik at gemini.archlinux.org
Tue Sep 6 17:28:01 UTC 2022


    Date: Tuesday, September 6, 2022 @ 17:28:01
  Author: anatolik
Revision: 1294465

archrelease: copy trunk to community-x86_64

Added:
  mage/repos/community-x86_64/
  mage/repos/community-x86_64/PKGBUILD
    (from rev 1294464, mage/trunk/PKGBUILD)

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

Copied: mage/repos/community-x86_64/PKGBUILD (from rev 1294464, mage/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2022-09-06 17:28:01 UTC (rev 1294465)
@@ -0,0 +1,43 @@
+# Contributor: Sven Greb <development at svengreb.de>
+# Contributor: Arctic Ice Studio <development at arcticicestudio.com>
+
+pkgname=mage
+pkgver=1.13.0
+pkgrel=2
+pkgdesc="A Make/rake-like build tool using Go"
+arch=("x86_64")
+url="https://magefile.org"
+license=("Apache")
+makedepends=(go)
+source=($pkgname-$pkgver.tar.gz::https://github.com/magefile/mage/archive/refs/tags/v$pkgver.tar.gz)
+sha256sums=('afe6e764b605ce010cde732abc799ef19bb7f0b6b77bfa97091701a8b86a9af6')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  # mage is build with mage itself, therefore we simluate the execution of the provided `bootstrap.go` installation
+  # file that is recommended by the author.
+  # The file builds mage when mage itself is not installed on the target system yet and included metadata information
+  # for the binary.
+
+  # References:
+  #   1. https://github.com/magefile/mage/blob/fe9f9420/.goreleaser.yml#L27
+  #   2. https://github.com/magefile/mage/blob/fe9f9420/.goreleaser.yml#L10
+  export CGO_ENABLED=0
+  local BUILD_DATE="$(date --rfc-3339=date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}")"
+  go build \
+    -trimpath \
+    -buildmode=pie \
+    -mod=readonly \
+    -modcacherw \
+    -ldflags "-X \"github.com/magefile/mage/mage.timestamp=${BUILD_DATE}\" \
+              -X \"github.com/magefile/mage/mage.gitTag=v$pkgver\" \
+              -extldflags \"${LDFLAGS}\"" \
+    -o build/"$pkgname" .
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  install -Dm755 build/"$pkgname" -t "$pkgdir/usr/bin/"
+  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
+}



More information about the arch-commits mailing list