upg sqlite

This commit is contained in:
joborun linux 2023-09-11 23:26:04 +03:00
parent bdfa1847d2
commit cd01578ae4
2 changed files with 165 additions and 9 deletions

View file

@ -7,9 +7,9 @@
pkgbase="sqlite"
pkgname=('sqlite' 'sqlite-tcl' 'sqlite-analyzer' 'lemon' 'sqlite-doc')
_srcver=3430000
_srcver=3430100
_docver=${_srcver}
pkgver=3.43.0
pkgver=3.43.1
pkgrel=01
pkgdesc="A C library that implements an SQL database engine"
url="https://www.sqlite.org/"
@ -34,6 +34,9 @@ prepare() {
}
build() {
# this uses malloc_usable_size, which is incompatible with fortification level 3
export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CPPFLAGS="$CPPFLAGS \
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
@ -159,14 +162,15 @@ license=('custom:Public Domain')
# sqlite-doc-3430000.zip
# (10.17 MiB) Documentation as a bundle of static HTML files.
sha256sums=(976c31a5a49957a7a8b11ab0407af06b1923d01b76413c9cf1c9f7fc61a3501c # sqlite-src-3430000.zip
e88f98c5651f996e989ef3b7122ed29b01bd2a0100b0aa72dd96013248442291 # sqlite-doc-3430000.zip
sha256sums=(22e9c2ef49fe6f8a2dbc93c4d3dce09c6d6a4f563de52b0a8171ad49a8c72917 # sqlite-src-3430100.zip
de4e2b6489f3ef4f7068c77d9df11a7c099851cd2431c457c88ee194eb56d41d # sqlite-doc-3430100.zip
55746d93b0df4b349c4aa4f09535746dac3530f9fd6de241c9f38e2c92e8ee97 # sqlite-lemon-system-template.patch
4e57d9ac979f1c9872e69799c2597eeef4c6ce7224f3ede0bf9dc8d217b1e65d) # license.txt
## 4bb3e1daa56c6bc944138331a4ef70a90c44cc54c6410ebbbd1ddff31baca365 lemon-3.43.0-01-x86_64.pkg.tar.lz
## 7a1b02d6c79095fee94f234c4af77bb8758c5b9627b632783cb11107cc253e36 sqlite-3.43.0-01-x86_64.pkg.tar.lz
## 218f15a6cad81cc69485614d14c64501e4f6e722d16634a8656f517d0bb467bb sqlite-analyzer-3.43.0-01-x86_64.pkg.tar.lz
## 93072f59f02fc585181f5c2b3b02499d9f405a14f46d247991a2bcfe9715849f sqlite-doc-3.43.0-01-x86_64.pkg.tar.lz
## d9487efe7d9a636aa6d91e58b28ef32419fc2b81d5efa2da22feded80e235191 sqlite-tcl-3.43.0-01-x86_64.pkg.tar.lz
## 5d45afc1b2ee699bf0e571c3ff7ba612ef97eadcafce9a4d508a3c74c7fe8770 lemon-3.43.1-01-x86_64.pkg.tar.lz
## 21e020689139b2cf309acb536f6c47afe02c3baeee296d7e0cc59f343d095975 sqlite-3.43.1-01-x86_64.pkg.tar.lz
## 10fcaca215c83531af95c9b5ccc96e166b3c9122a85540d575a571604980aee1 sqlite-analyzer-3.43.1-01-x86_64.pkg.tar.lz
## 940209ad82d5852d74383560fd476766554e77889aa92506d2e5170a107227ac sqlite-doc-3.43.1-01-x86_64.pkg.tar.lz
## 807b3bb3cb5a296ea3ed3ae84b5efb32ae62a26dc18ff6c93e429956c0dc0669 sqlite-tcl-3.43.1-01-x86_64.pkg.tar.lz

152
sqlite/PKGBUILD-arch.new Normal file
View file

@ -0,0 +1,152 @@
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
pkgbase="sqlite"
pkgname=('sqlite' 'sqlite-tcl' 'sqlite-analyzer' 'lemon' 'sqlite-doc')
_srcver=3430100
_docver=${_srcver}
#_docver=3330000
pkgver=3.43.1
pkgrel=1
pkgdesc="A C library that implements an SQL database engine"
arch=('x86_64')
license=('custom:Public Domain')
url="https://www.sqlite.org/"
makedepends=('tcl' 'readline' 'zlib')
options=('!emptydirs')
source=(https://www.sqlite.org/2023/sqlite-src-${_srcver}.zip
https://www.sqlite.org/2023/sqlite-doc-${_docver}.zip
sqlite-lemon-system-template.patch
license.txt)
# upstream now switched to sha3sums - currently not supported by makepkg
sha256sums=('22e9c2ef49fe6f8a2dbc93c4d3dce09c6d6a4f563de52b0a8171ad49a8c72917'
'de4e2b6489f3ef4f7068c77d9df11a7c099851cd2431c457c88ee194eb56d41d'
'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() {
# this uses malloc_usable_size, which is incompatible with fortification level 3
export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CPPFLAGS="$CPPFLAGS \
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
-DSQLITE_ENABLE_DBSTAT_VTAB=1 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-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
./configure --prefix=/usr \
--disable-static \
--enable-fts3 \
--enable-fts4 \
--enable-fts5 \
--enable-rtree \
TCLLIBDIR=/usr/lib/sqlite$pkgver
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
# build additional tools
make showdb showjournal showstat4 showwal sqldiff sqlite3_analyzer
}
package_sqlite() {
pkgdesc="A C library that implements an SQL database engine"
depends=('readline' 'zlib' 'glibc')
provides=("sqlite3=$pkgver" 'libsqlite3.so')
replaces=("sqlite3")
cd sqlite-src-$_srcver
make DESTDIR="${pkgdir}" install
install -m755 showdb showjournal showstat4 showwal sqldiff "${pkgdir}"/usr/bin/
# install manpage
install -m755 -d "${pkgdir}"/usr/share/man/man1
install -m644 sqlite3.1 "${pkgdir}"/usr/share/man/man1/
# license - no linking required because pkgbase=pkgname
install -D -m644 "${srcdir}"/license.txt "${pkgdir}"/usr/share/licenses/${pkgbase}/license.txt
# split out tcl extension
mkdir "$srcdir"/tcl
mv "$pkgdir"/usr/lib/sqlite* "$srcdir"/tcl
}
package_sqlite-tcl() {
pkgdesc="sqlite Tcl Extension Architecture (TEA)"
depends=('sqlite' 'glibc')
provides=("sqlite3-tcl=$pkgver")
replaces=("sqlite3-tcl")
install -m755 -d "${pkgdir}"/usr/lib
mv "$srcdir"/tcl/* "${pkgdir}"/usr/lib
# install manpage
install -m755 -d "${pkgdir}"/usr/share/man/mann
install -m644 "${srcdir}"/sqlite-src-$_srcver/autoconf/tea/doc/sqlite3.n "${pkgdir}"/usr/share/man/mann/
# link license
install -m755 -d "${pkgdir}"/usr/share/licenses
ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
}
package_sqlite-analyzer() {
pkgdesc="An analysis program for sqlite3 database files"
depends=('sqlite' 'tcl' 'glibc')
cd sqlite-src-$_srcver
install -m755 -d "${pkgdir}"/usr/bin
install -m755 sqlite3_analyzer "${pkgdir}"/usr/bin/
}
package_lemon() {
# https://www.sqlite.org/lemon.html
pkgdesc="A parser generator"
depends=('glibc')
cd sqlite-src-$_srcver
# ELF file ('usr/bin/lemon') lacks FULL RELRO, check LDFLAGS. - no fix found so far
install -Dm755 lemon ${pkgdir}/usr/bin/lemon
install -Dm644 lempar.c ${pkgdir}/usr/share/lemon/lempar.c
mkdir -p "${pkgdir}"/usr/share/doc/${pkgname}
cp ../sqlite-doc-${_docver}/lemon.html "${pkgdir}"/usr/share/doc/${pkgname}/
install -m755 -d "${pkgdir}"/usr/share/licenses
ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
}
package_sqlite-doc() {
pkgdesc="most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation"
#arch=('any') - not yet supported
provides=("sqlite3-doc=$pkgver")
replaces=("sqlite3-doc")
cd sqlite-doc-${_docver}
mkdir -p "${pkgdir}"/usr/share/doc/${pkgbase}
cp -R * "${pkgdir}"/usr/share/doc/${pkgbase}/
rm "${pkgdir}"/usr/share/doc/${pkgbase}/lemon.html
}