summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d695cac760a8c8516b384b0c6ac9c8b2d86964a6 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=sqlite-fossil
pkgver=r30876.f47a5f4
pkgrel=1
pkgdesc="Self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine"
arch=('i686' 'x86_64')
url="https://www.sqlite.org/"
license=('custom:Public Domain')
depends=('glibc' 'readline' 'zlib')
makedepends=('fossil' 'tcl')
provides=("sqlite=$pkgver" 'libsqlite3.so')
conflicts=('sqlite')
options=('staticlibs')
source=("sqlite.fossil::fossil+https://www.sqlite.org/src")
sha256sums=('SKIP')


pkgver() {
  cd "sqlite"

  _info=$(fossil info)
  _hash=$(echo "$_info" | sed -n 's|checkout: *\([0-9a-z]*\).*|\1|p' | cut -c 1-7)
  _revision=$(echo "$_info" | sed -n 's|check-ins: *\(.*\)|\1|p')
  printf "r%s.%s" "$_revision" "$_hash"
}

build() {
  cd "sqlite"

  export CPPFLAGS="$CPPFLAGS \
    -DSQLITE_ENABLE_COLUMN_METADATA=1 \
    -DSQLITE_ENABLE_UNLOCK_NOTIFY \
    -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
    -DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
    -DSQLITE_SECURE_DELETE \
    -DSQLITE_MAX_VARIABLE_NUMBER=250000 \
    -DSQLITE_MAX_EXPR_DEPTH=10000"

  ./configure \
    --prefix="/usr" \
    --disable-amalgamation \
    --enable-fts3 \
    --enable-fts4 \
    --enable-fts5 \
    --enable-rtree \
    --enable-json1
  make
  make \
    showdb \
    showjournal \
    showstat4 \
    showwal \
    sqldiff \
    sqlite3_analyzer
}

check() {
  cd "sqlite"

  #make test
}

package() {
  cd "sqlite"

  make DESTDIR="$pkgdir" install

  install -Dm755 {showdb,showjournal,showstat4,showwal,sqldiff} -t "$pkgdir/usr/bin"
  install -Dm644 "LICENSE.md" -t "$pkgdir/usr/share/licenses/sqlite"
  install -Dm644 sqlite*.1 -t "$pkgdir/usr/share/man/man1"

  # remove tcl extension
  rm -r "$pkgdir/usr/lib"/tcl*
}