APP=ninja
VERSION=1.9.0
BUILD=1sml
HOMEPAGE='https://github.com/ninja-build/ninja'
DOWNLOAD='https://github.com/ninja-build/ninja/archive/refs/tags/v1.9.0.tar.gz'
DESC="small build system with a focus on speed"
REQUIRES="gcc-libs python3"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  patch -p1 < $SRCDIR/posix-fix.patch

  python ./configure.py --bootstrap

  install -Dm 755 ninja $PKG/bin/ninja
  install -Dm 644 misc/bash-completion $PKG/share/bash-completion/completions/ninja

  cp COPYING $PKGDOCS/

  mkfinalpkg
}

SHA512SUMS="
0c8e877efc4cf7fd474f90fc31454f8bb1dcf483b0f1a6132678eeaa413a9e1c5c53b37705aada999efacc83a31afb75df0b509d87a41c4fe736c2ac6ed87251  ninja-1.9.0.tar.lz
78b29a57ec3c4feedf2bcfe9370b30cecd5302f29e8e14c6a3bc01becb555be6330aafba12f9225625af0644ea1f534feba8396d32bb944253a9daa5dd0e98d8  posix-fix.patch
"
