summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a4e3aca12c9d5994dfc350c845c0a9dc57affa98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Maintainer: Duncan Mac-Vicar P. <duncan@mac-vicar.eu>
pkgname=lstk
pkgver=0.18.0
pkgrel=1
pkgdesc='LocalStack CLI v2'
arch=('x86_64' 'aarch64')
url='https://github.com/localstack/lstk'
license=('Apache-2.0')
makedepends=('git' 'go')
optdepends=(
  'docker: required to run LocalStack containers with lstk start/stop/logs'
  'xdg-utils: use xdg-open to launch browser-based login flow'
)
options=(!debug)
source=("git+https://github.com/localstack/lstk.git#tag=v${pkgver}")
sha256sums=('SKIP')

build() {
  cd "$srcdir/$pkgname"

  local _commit _build_date
  _commit="$(git rev-parse --short HEAD)"
  _build_date="$(date -u +%Y-%m-%dT%H:%M:%SZ)"

  CGO_ENABLED=0 go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -ldflags="
      -X github.com/localstack/lstk/internal/version.version=${pkgver}
      -X github.com/localstack/lstk/internal/version.commit=${_commit}
      -X github.com/localstack/lstk/internal/version.buildDate=${_build_date}
    " \
    -o lstk \
    .
}

package() {
  cd "$srcdir/$pkgname"

  install -Dm755 lstk "$pkgdir/usr/bin/lstk"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}