summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnmanuel2022-07-03 16:36:08 +0000
committerEnmanuel2022-07-03 16:36:08 +0000
commitba9fb08c124d3e4814c4beb766f5703d96a2eb19 (patch)
treea55a8a328b7fb4269d5d1bd453c19f8fd25ca12a
parent6cb49827361249a936343c4671bbf3aeba5bbfd2 (diff)
downloadaur-ba9fb08c124d3e4814c4beb766f5703d96a2eb19.tar.gz
global version variable
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD31
2 files changed, 30 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8d6e5ad26740..fb22fd780d27 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,9 +5,14 @@ pkgbase = colima
url = https://github.com/abiosoft/colima
arch = x86_64
license = MIT
- source = https://github.com/abiosoft/colima/releases/download/v0.4.4/colima-Linux-x86_64
- source = https://raw.githubusercontent.com/abiosoft/colima/v0.4.4/LICENSE
- sha256sums = 65e972d13337c6505e50f60bcfbe220b92a4a8769bbcd996f9bf0e1d3e4411c6
- sha256sums = e5ce0844732e29a77f349cc332fcb6ab75617393f9e565ac6509c7b681d95eea
+ makedepends = go>=1.18
+ makedepends = git
+ makedepends = gzip
+ makedepends = tar
+ makedepends = gcc
+ provides = colima
+ conflicts = colima-bin
+ source = https://github.com/abiosoft/colima/archive/v0.4.4.tar.gz
+ sha256sums = 95543e68a1ebf61ac6f9e60987d493a0682d8c0e5af410d37da7217ebfc69df5
pkgname = colima
diff --git a/PKGBUILD b/PKGBUILD
index 26a3b8b36e9b..9eb1e6e16a43 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,32 @@
# Maintainer: Enmanuel Moreira <enmanuelmoreira@gmail.com>
pkgname=colima
-pkgver=0.4.4
+pkgver=$PKGVER
pkgrel=1
pkgdesc="Container runtimes on macOS (and Linux) with minimal setup."
arch=('x86_64')
url="https://github.com/abiosoft/colima"
+conflicts=('colima-bin')
+provides=('colima')
license=('MIT')
-source=(
- "https://github.com/abiosoft/${pkgname}/releases/download/v${pkgver}/${pkgname}-Linux-x86_64"
- "https://raw.githubusercontent.com/abiosoft/colima/v${pkgver}/LICENSE"
-)
-sha256sums=('65e972d13337c6505e50f60bcfbe220b92a4a8769bbcd996f9bf0e1d3e4411c6'
- 'e5ce0844732e29a77f349cc332fcb6ab75617393f9e565ac6509c7b681d95eea')
+makedepends=('go>=1.18' 'git' 'gzip' 'tar' 'gcc')
+source=( "https://github.com/abiosoft/${pkgname}/archive/v${pkgver}.tar.gz")
+sha256sums=('95543e68a1ebf61ac6f9e60987d493a0682d8c0e5af410d37da7217ebfc69df5')
+
+build() {
+ cd "${pkgname}-${pkgver}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -buildvcs=false -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S')
+ go build -o build/${pkgname} -ldflags="-X 'main.buildVersion=${pkgver}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/colima/
+}
package() {
- cd "${srcdir}"
- install -Dm755 ${pkgname}-Linux-x86_64 ${pkgdir}/usr/bin/${pkgname}
- install -D -m 644 "${srcdir}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ cd "${srcdir}"/"${pkgname}-${pkgver}"
+ install -Dm755 build/"${pkgname}" "${pkgdir}"/usr/bin/"${pkgname}"
+ install -Dm644 README.md ${pkgdir}/usr/share/doc/${pkgname}/README.md
+ install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}