void-packages/srcpkgs/sqlite-replication/template

71 lines
2.1 KiB
Bash

# Template file for 'sqlite-replication'
pkgname=sqlite-replication
version=3.32.3
revision=1
wrksrc="sqlite-version-${version}-replication4"
build_style=gnu-configure
configure_args="--enable-replication --enable-threadsafe --enable-fts5
--enable-dynamic-extensions"
hostmakedepends="tcl"
makedepends="libedit-devel"
short_desc="Replication Enabled SQL Database Engine in a C Library"
maintainer="Cameron Nemo <cnemo@tutanota.com>"
license="Public Domain"
homepage="https://github.com/canonical/sqlite"
distfiles="${homepage}/archive/version-${version}+replication4.tar.gz"
checksum=8caab8703e8b7314e93dfcd6aa09ff306e416fb398bf421f194368ced821d4e6
shlib_provides="libsqlite3.so.0"
CFLAGS+="-DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_JSON1 \
-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 -DSQLITE_ENABLE_BATCH_ATOMIC_WRITE=1"
# explicitly enable fdatasync
CFLAGS+=" -DHAVE_FDATASYNC"
disable_parallel_build=yes
pre_configure() {
sed -i -e 's/ -ltinfo//g' configure
}
do_configure() {
if [ "$XBPS_TARGET_MACHINE" = "i686" ] ; then
./configure ${configure_args} \
--libdir=/usr/lib32/sqlite-replication
else
./configure ${configure_args} \
--libdir=/usr/lib/sqlite-replication
fi
}
post_install() {
if [ "$XBPS_TARGET_MACHINE" = "i686" ] ; then
_libdir="usr/lib32"
else
_libdir="usr/lib"
fi
vmkdir "${_libdir}/pkgconfig"
mv "${DESTDIR}/${_libdir}"{/sqlite-replication,}/pkgconfig/sqlite3.pc
# Alpine just deletes the binary, but someone may want it for debugging
mv "$DESTDIR"/usr/bin/sqlite3{,.sqlite-replication}
}
sqlite-replication-devel_package() {
depends="sqlite-replication>=${version}_${revision}"
conflicts="sqlite-devel>=0"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/sqlite-replication/*.a"
vmove "usr/lib/sqlite-replication/*.so"
}
}
sqlite-replication-bin_package() {
short_desc+=" - cli tool"
pkg_install() {
vmove usr/bin
}
}