pkgname=typst-flex-spacing-git
pkgver=0.0.0.r0.g0000000
pkgrel=1
pkgdesc="Typst with experimental automatic vertical justification"
arch=('x86_64')
url="https://github.com/johannes-titz/typst/tree/flex-spacing-prototype"
license=('Apache-2.0')
depends=('glibc' 'libgcc' 'openssl')
makedepends=('cargo' 'git')
provides=('typst')
conflicts=('typst')
source=('git+https://github.com/johannes-titz/typst.git#branch=flex-spacing-prototype')
sha256sums=('SKIP')

pkgver() {
  cd typst
  git describe --long --tags --always \
    | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd typst
  cargo build --release --locked --package typst-cli
}

package() {
  cd typst
  install -Dm755 target/release/typst "$pkgdir/usr/bin/typst"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
