app=nasm
version=2.14.02
build=1sml
homepage="https://www.nasm.us/"
download="https://www.nasm.us/pub/nasm/releasebuilds/$version/nasm-$version.tar.xz"
desc="Netwide assembler providing instruction mnemonics and syntax"
requires="musl"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  if [ "ARCH" == "aarch64" ]; then
    hostdist="--host=arm-musl-linux"
  fi

  CFLAGS="-D_GNU_SOURCE" \
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    $hostdist

  make
  make install DESTDIR=$pkg

  cp AUTHORS LICENSE README $pkgdocs/

  mkfinalpkg
}

sha512sums="
760e44e99737cf5609c13b365a0d9edcb31bd767e6906f53e9134c507edd4b722ef11f230450b0065820b5a9d5fa3e36dc13407dc2747b6e5afaa48a28b0ea41  nasm-2.14.02.tar.lz
"
