app=flex
version=2.6.4
build=1sml
homepage="https://github.com/westes/flex"
download="https://github.com/westes/flex/archive/refs/tags/v$version.tar.gz"
desc="fast lexical analyzer generator"
requires="m4"

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

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

  unset CPPFLAGS

  printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in

  CPPFLAGS="-D_GNU_SOURCE -DSTDC_HEADERS" \
  ./configure \
    --prefix="" \
    --disable-nls \
    --disable-static 

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
6564218510945b678bb61a1375ccaa4c254aa43fc52f0c4e3d8b784f551bca82bb8ab1889bde522c3da9b04da99904d17420ef8615862bae65b925770fae2517  flex-2.6.4.tar.lz
"
