name=pcre2
version=10.43
revision=1
tarball_url="https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${version}/pcre2-${version}.tar.gz"
tarball_blake2b="7bf9ad4aba00f7f6e11ebbab3a45ab1e801cfcf365fc1ece544e3c0b775415f5790ebe202a8dd5cabbc21606f915c12417fe914c65d34cd2d74cb60581ae1118"
source_hostdeps="automake autoconf libtool pkg-config"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs bzip2 ncurses readline zlib"

regenerate() {
    autotools_recursive_regen
}

build() {
    autotools_configure \
        --enable-unicode \
        --enable-jit \
        --enable-pcre2-16 \
        --enable-pcre2-32 \
        --enable-pcre2grep-libz \
        --enable-pcre2grep-libbz2 \
        --enable-pcre2test-libreadline

    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
