APP=pcre2
VERSION=10.33
BUILD=1sml
HOMEPAGE='https://www.pcre.org/'
DOWNLOAD='https://ftp.pcre.org/pub/pcre/pcre2-10.33.tar.gz'
DESC="Perl-compatible regular expression library v2"
REQUIRES="gcc-libs zlib bzip2 readline"

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

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

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --enable-pcre2-16 \
    --enable-pcre2-32 \
    --enable-jit \
    --enable-pcre2grep-libz \
    --enable-pcre2grep-libbz2 \
    --enable-pcre2test-libreadline \
    --with-match-limit-recursion=8192 \
    --disable-static

  make
  make install DESTDIR=$PKG

  cp LICENCE $PKGDOCS/

  mkfinalpkg
}

SHA512SUMS="
b94e6df0a779c58fce66854b5d64eed1232cc0027362e369a2465b893d9f59c9f01126db6336a5a77714148bf70d4b11c28fd866ee26d061f3f36426495e43bf  pcre2-10.33.tar.lz
"
