blob: 4fb6df64d324119413623ae2d1c0a0c30d5e3903 [file] [log] [blame] [edit]
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Renato Silva <br.renatosilva@gmail.com>
# Contributor: Brisingr Aerowing <ztgreve@live.com>
_realname=sqlite3
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_sqlite_year=2021
_amalgamationver=3350500
_docver=${_amalgamationver}
pkgver=3.35.5
pkgrel=1
pkgdesc="A C library that implements an SQL database engine (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
license=(PublicDomain)
url="https://www.sqlite.org"
provides=(${MINGW_PACKAGE_PREFIX}-sqlite=${pkgver}
${MINGW_PACKAGE_PREFIX}-sqlite-analyzer=${pkgver}
${MINGW_PACKAGE_PREFIX}-sqlite-docs=${pkgver})
conflicts=(${MINGW_PACKAGE_PREFIX}-sqlite-analyzer)
replaces=(${MINGW_PACKAGE_PREFIX}-sqlite-analyzer)
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-readline"
"${MINGW_PACKAGE_PREFIX}-tcl")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
source=(https://www.sqlite.org/${_sqlite_year}/sqlite-src-${_amalgamationver}.zip
https://www.sqlite.org/${_sqlite_year}/sqlite-doc-${_docver}.zip
Makefile.ext.in
README.md.in
LICENSE)
sha256sums=('f4beeca5595c33ab5031a920d9c9fd65fe693bad2b16320c3a6a6950e66d3b11'
'098257e33eb50254cccd31333b09eeafd5843fdd446e1c856c4b48b758573cb9'
'047d1b173657dd19ad00c4bc398a8dd617836b1c2fa08864f5aaee9f781d4366'
'5ca42f1f92abfb61bacc9ff60f5836cc56e2ce2af52264f918cb06c3d566d562'
'0b76663a90e034f3d7f2af5bfada4cedec5ebc275361899eccc5c18e6f01ff1f')
options=('!strip' 'staticlibs' '!buildflags')
sqlite_tools="sqlite3_analyzer.exe dbhash.exe sqldiff.exe"
prepare() {
cd "${srcdir}/sqlite-src-${_amalgamationver}"
}
build() {
test -d ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} && \
rm -rf ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST}
mkdir -p ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST} && \
cd ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST}
export lt_cv_deplibs_check_method='pass_all'
SQLITE_OPTIONS="\
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_USE_MALLOC_H=1 \
-DSQLITE_USE_MSIZE=1 \
-DSQLITE_DISABLE_DIRSYNC=1 \
-DSQLITE_ENABLE_DBSTAT_VTAB=1 \
-DSQLITE_SOUNDEX=1 \
-DSQLITE_ENABLE_MATH_FUNCTIONS=1 \
"
CFLAGS+=" -fexceptions -fno-strict-aliasing ${SQLITE_OPTIONS}"
../sqlite-src-${_amalgamationver}/configure -C \
--prefix=${MINGW_PREFIX} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--build=${MINGW_CHOST} \
--enable-threadsafe \
--disable-editline \
--enable-readline \
--enable-all \
--enable-session \
--with-readline-inc=-I${MINGW_PREFIX}/include \
--with-tcl=${MINGW_PREFIX}/lib \
TCLLIBDIR=${MINGW_PREFIX}/lib/sqlite${pkgver}
make
# build additional tools
make $sqlite_tools
# build extensions
./config.status --file=ext/misc/Makefile:../Makefile.ext.in
make -C ext/misc
}
check() {
cd "${srcdir}/build-${_amalgamationver}-${MINGW_CHOST}"
# This test run lasts very loooong ... despite the target name
make quicktest || true
}
package() {
cd ${srcdir}/build-${_amalgamationver}-${MINGW_CHOST}
make DESTDIR="${pkgdir}" install
for t in $sqlite_tools; do
install -Dm755 .libs/$t "${pkgdir}${MINGW_PREFIX}/bin/$t"
done
mv ${pkgdir}${MINGW_PREFIX}/lib/bin/*.* ${pkgdir}${MINGW_PREFIX}/lib/sqlite${pkgver}/
rm -rf ${pkgdir}${MINGW_PREFIX}/lib/bin
# Install extensions
make -C ext/misc DESTDIR="${pkgdir}" install
cat "${srcdir}/README.md.in" | sed \
-e "s|@MINGW_PREFIX@|${MINGW_PREFIX}|g" \
-e "s|@MSYSTEM@|${MSYSTEM}|g;" \
-e "s|@VERSION@|${pkgver}|g;" \
> "${pkgdir}${MINGW_PREFIX}/share/sqlite/extensions/README.md"
# Install docs
cd ${srcdir}/sqlite-doc-${_docver}
mkdir -p ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}
cp -R * ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/
install -Dm644 "${srcdir}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}