distributable:
  url: https://github.com/lima-vm/lima/archive/v{{version}}.tar.gz
  strip-components: 1

versions:
  github: lima-vm/lima

dependencies:
  qemu.org: '*'

build:
  dependencies:
    go.dev: '*'
  script:
    - run: |
        sed -i.bak -e's/ldflags="/ldflags="-buildmode=pie /' Makefile
        rm Makefile.bak
      if: linux
    - make VERSION={{version}} minimal
    - mkdir -p {{prefix}}
    - mv ./_output/* {{prefix}}/
  env:
    CC: clang
    CXX: clang++
    LD: clang

provides:
  - bin/limactl

test:
  limactl --version | grep {{version}}
