name=sqlite
version=3.45.3
revision=1
tarball_url="https://sqlite.org/2024/sqlite-autoconf-3450300.tar.gz"
tarball_blake2b="24e47dcfb8fb1dbd0055d48cfc540884439e9443b1b79700e867326feb60b340a9b5d5bdb83eeca210b47251e61b706ec67eb1b84e59b11bae6c76271b1030bf"
source_hostdeps="automake autoconf libtool pkg-config"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs readline zlib"

regenerate() {
    autotools_recursive_regen
}

build() {
    autotools_configure \
        --enable-readline \
        --enable-fts5 \
        CFLAGS="$CFLAGS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_FTS3_TOKENIZER=1"

    make -j${parallelism}
}

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

    post_package_strip
}
