recipes: compressors/xz: Upgraded to version 5.6.2
[dragora.git] / recipes / db / sqlite / recipe
blobad39114a6b88c24ea59058924936b86981f2f29e
1 # Build recipe for sqlite.
3 # Copyright (c) 2019-2023 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
18 set -e
20 program=sqlite
21 version=3400100
22 pkgversion=3.40.1
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=db
28 tarname=${program}-autoconf-${version}.tar.gz
30 # Remote source(s)
31 fetch=https://sqlite.org/2022/$tarname
33 description="
34 SQlite is a C-language library that implements a SQL database engine.
36 The sqlite package is a software library that implements a self-contained,
37 serverless, zero-configuration, transactional SQL database engine.
40 homepage=https://www.sqlite.org
41 license="Public Domain"
43 # Source documentation
44 docs="README.txt"
45 docsdir="${docdir}/${program}-${pkgversion}"
47 # The source has a custom source directory
48 srcdir=${program}-autoconf-${version}
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     ./configure CFLAGS="$QICFLAGS" \
60     LDFLAGS="$QILDFLAGS" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --build="$(gcc -dumpmachine)" \
66      --enable-fts5 \
67      --enable-session \
68      CPPFLAGS="-DSQLITE_ENABLE_FTS3=1 \
69                -DSQLITE_ENABLE_FTS4=1 \
70                -DSQLITE_ENABLE_COLUMN_METADATA=1 \
71                -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
72                -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
73                -DSQLITE_SECURE_DELETE=1 \
74                -DSQLITE_ENABLE_FTS3_TOKENIZER=1"
76     make -j${jobs} V=1 && make -j${jobs} check
77     make -j${jobs} DESTDIR="$destdir" install-strip
79     # Build TCL extension (TEA)
81     cd tea
83     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
84      $configure_args --libdir=/usr/lib${libSuffix}
86     make -j${jobs} && make -j${jobs} DESTDIR="$destdir" install
88     cd ..
90     # Compress and link man pages (if needed)
91     if test -d "${destdir}/$mandir"
92     then
93         (
94             cd "${destdir}/$mandir"
95             find . -type f -exec lzip -9 {} +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi
104     # Copy documentation
105     mkdir -p "${destdir}/$docsdir"
106     cp -p $docs "${destdir}/$docsdir"