void-packages/srcpkgs/sqlite-replication/template

68 lines
2.1 KiB
Bash

# Template file for 'sqlite-replication'
pkgname=sqlite-replication
version=3.32.3
revision=2
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
# explicitly set byte order to avoid bad autodetection macros
case "$XBPS_TARGET_ENDIAN" in
le) CFLAGS+=" -DSHA3_BYTEORDER=1234 -DSQLITE_BYTEORDER=1234";;
be) CFLAGS+=" -DSHA3_BYTEORDER=4321 -DSQLITE_BYTEORDER=4321";;
esac
pre_configure() {
sed -i -e 's/ -ltinfo//g' configure
}
do_configure() {
./configure ${configure_args} \
--libdir=/usr/lib${XBPS_TARGET_WORDSIZE}/sqlite-replication
}
post_install() {
local libdir="usr/lib${XBPS_TARGET_WORDSIZE}"
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
}
}