summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ca206d8d98a08fa8e04db94c47a0894017ee666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Maintainer: Thibault Boyeux <thibault.boyeux@gmail.com>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=('sqlite-fts3-parenthesis')
_srcver=3350500
_docver=${_srcver}
pkgver=3.35.5
pkgrel=1
pkgdesc="A C library that implements an SQL database engine. Compiled with 'SQLITE_ENABLE_FTS3_PARENTHESIS' option to allow operators AND and NOT and nested parenthesis in queries."
arch=('x86_64')
license=('custom:Public Domain')
url="https://www.sqlite.org/"
makedepends=('tcl')
depends=('readline' 'zlib')
conflicts=("sqlite")
provides=("sqlite=$pkgver")
replaces=("sqlite3")
source=(https://www.sqlite.org/2021/sqlite-src-${_srcver}.zip)
options=('!emptydirs' '!makeflags') # json extensions breaks parallel build
# upstream now switched to sha3sums - currently not supported by makepkg
sha256sums=('f4beeca5595c33ab5031a920d9c9fd65fe693bad2b16320c3a6a6950e66d3b11')

package() {
  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 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  
  # split out tcl extension
  mkdir "$srcdir"/tcl
  mv "$pkgdir"/usr/lib/sqlite* "$srcdir"/tcl
}

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() {
  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"

  # build sqlite
  cd sqlite-src-$_srcver
  ./configure --prefix=/usr \
	--disable-static \
	--disable-amalgamation \
	--enable-fts3 \
	--enable-fts4 \
	--enable-fts5 \
	--enable-rtree \
	--enable-json1 \
	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
}