APP=nasm
VERSION=2.14.02
BUILD=1sml
HOMEPAGE='https://www.nasm.us/'
DOWNLOAD='https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.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
"
