# Contributor: Andreas Radke # Contributor: Tom Newsom _pkgname=sqlite pkgname=static-compat-$_pkgname _srcver=3380500 _docver=${_srcver} #_docver=3330000 pkgver=3.38.5 pkgrel=1 pkgdesc="A C library that implements an SQL database engine" arch=('x86_64') license=('custom:Public Domain') url="https://www.sqlite.org/" depends=(static-compat-zlib static-compat-readline) makedepends=(static-compat-configure static-compat-tcl patchelf) source=(https://www.sqlite.org/2022/sqlite-src-${_srcver}.zip sqlite-lemon-system-template.patch license.txt) options=('!emptydirs' '!makeflags' 'staticlibs') # json extensions breaks parallel build # upstream now switched to sha3sums - currently not suppoerted by makepkg sha256sums=('6503bb59e39ec8663083696940ec818cd5555196e6ca543d4029440cca7b00d9' '55746d93b0df4b349c4aa4f09535746dac3530f9fd6de241c9f38e2c92e8ee97' '4e57d9ac979f1c9872e69799c2597eeef4c6ce7224f3ede0bf9dc8d217b1e65d') prepare() { cd sqlite-src-$_srcver # patch taken from Fedora # https://src.fedoraproject.org/rpms/sqlite/blob/master/f/sqlite.spec patch -Np1 -i ../sqlite-lemon-system-template.patch #autoreconf -vfi } build() { source static-compat-environment export PATH=$PWD:$PATH printf '#!/usr/bin/bash\nexec /usr/bin/pkg-config --static "$@"\n' > pkg-config chmod +x pkg-config export CPPFLAGS="$CPPFLAGS \ -DSQLITE_ENABLE_COLUMN_METADATA=1 \ -DSQLITE_ENABLE_UNLOCK_NOTIFY \ -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ -DSQLITE_ENABLE_FTS3_TOKENIZER=1 \ -DSQLITE_SECURE_DELETE \ -DSQLITE_ENABLE_STMTVTAB \ -DSQLITE_MAX_VARIABLE_NUMBER=250000 \ -DSQLITE_MAX_EXPR_DEPTH=10000 \ -DSQLITE_ENABLE_MATH_FUNCTIONS" # build sqlite cd sqlite-src-$_srcver static-compat-configure \ --disable-amalgamation \ --disable-shared \ --enable-fts3 \ --enable-fts4 \ --enable-fts5 \ --enable-rtree \ --enable-json1 \ TCLLIBDIR="$static_compat_prefix"/lib/sqlite$pkgver sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } package() { source static-compat-environment cd sqlite-src-$_srcver make DESTDIR="${pkgdir}" install patchelf --remove-rpath "${pkgdir}/$static_compat_prefix"/bin/sqlite3 install -D -m644 "${srcdir}"/license.txt "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt }