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

Anatol Pomozov anatolik at gemini.archlinux.org
Tue Sep 6 17:25:21 UTC 2022


    Date: Tuesday, September 6, 2022 @ 17:25:21
  Author: anatolik
Revision: 1294464

mage: move the package from AUR to [community]

Added:
  mage/
  mage/repos/
  mage/trunk/
  mage/trunk/PKGBUILD

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

Added: mage/trunk/PKGBUILD
===================================================================
--- mage/trunk/PKGBUILD	                        (rev 0)
+++ mage/trunk/PKGBUILD	2022-09-06 17:25:21 UTC (rev 1294464)
@@ -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