summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD39
1 files changed, 33 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 846b309c8a83..d02ad923507a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,17 +2,44 @@
pkgname=herokuish
pkgver=0.7.2
-pkgrel=1
+pkgrel=2
pkgdesc='Utility for emulating Heroku build and runtime tasks in containers'
arch=('x86_64')
url='https://github.com/gliderlabs/herokuish'
license=('MIT')
-source=("${url}/releases/download/v${pkgver}/${pkgname}_${pkgver}_linux_x86_64.tgz"
- 'LICENSE')
-sha256sums=('19fef774c256e25c1d436996fd8146040c4332a1c85c0ca0a1dea8ca7e12a525'
- '10265a1dd53faef4513b728a16b1eff3e5d5fc0bacc79e692ede34529bb8d1d1')
+source=("${url}/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=('08e6a8f27f61f3768697de2088cd97af2ca8420fbf4581acca2d6df4f39cd2c6')
+makedepends=('go'
+ 'go-bindata')
+
+build() {
+ cd "${pkgname}-${pkgver}"
+
+ # Generate buildpacks info
+ export BUILDPACK_ORDER=$(grep "BUILDPACK_ORDER :=" Makefile | sed 's/BUILDPACK_ORDER := //g')
+ count=0
+ for buildpack in $BUILDPACK_ORDER; do
+ buildpack_count=$(printf '%02d' $count)
+ buildpack_info=$(cat buildpacks/*-${buildpack}/buildpack* | sed 'N;s/\n/ /')
+
+ echo "${buildpack_count}_buildpack-${buildpack} ${buildpack_info}"
+
+ count=$((count + 1))
+ done > include/buildpacks.txt
+ go-bindata include
+
+ # Build executable
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+ go build -ldflags "-X main.Version=${pkgver}" -o "${pkgname}-build" .
+}
package() {
- install -Dm755 herokuish "${pkgdir}/usr/bin/${pkgname}"
+ cd "${pkgname}-${pkgver}"
+
+ install -Dm755 herokuish-build "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}