Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / sqlite.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
5 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
8 ;;; Copyright © 2016 David Craven <david@craven.ch>
9 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
12 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages sqlite)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages readline)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix utils)
38 #:use-module (ice-9 match)
39 #:use-module (srfi srfi-26))
40
41 ;;; Commentary:
42 ;;;
43 ;;; This module has been separated from (gnu packages databases) to reduce the
44 ;;; number of module references for core packages.
45
46 (define-public sqlite
47 (package
48 (name "sqlite")
49 (version "3.28.0")
50 (source (origin
51 (method url-fetch)
52 (uri (let ((numeric-version
53 (match (string-split version #\.)
54 ((first-digit other-digits ...)
55 (string-append first-digit
56 (string-pad-right
57 (string-concatenate
58 (map (cut string-pad <> 2 #\0)
59 other-digits))
60 6 #\0))))))
61 (string-append "https://sqlite.org/2019/sqlite-autoconf-"
62 numeric-version ".tar.gz")))
63 (sha256
64 (base32
65 "1hxpi45crbqp6lacl7z611lna02k956m9bsy2bjzrbb2y23546yn"))))
66 (build-system gnu-build-system)
67 (inputs `(("readline" ,readline)))
68 (arguments
69 `(#:configure-flags
70 ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_FTS3,
71 ;; -DSQLITE_ENABLE_UNLOCK_NOTIFY and -DSQLITE_ENABLE_DBSTAT_VTAB
72 ;; to CFLAGS. GNU Icecat will refuse to use the system SQLite
73 ;; unless these options are enabled.
74 (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
75 "-DSQLITE_ENABLE_FTS3 "
76 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
77 "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
78 (home-page "https://www.sqlite.org/")
79 (synopsis "The SQLite database management system")
80 (description
81 "SQLite is a software library that implements a self-contained, serverless,
82 zero-configuration, transactional SQL database engine. SQLite is the most
83 widely deployed SQL database engine in the world. The source code for SQLite
84 is in the public domain.")
85 (license license:public-domain)))
86
87 ;; This is used by Qt.
88 (define-public sqlite-with-column-metadata
89 (package/inherit sqlite
90 (name "sqlite-with-column-metadata")
91 (arguments
92 (substitute-keyword-arguments (package-arguments sqlite)
93 ((#:configure-flags flags)
94 `(list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
95 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
96 "-DSQLITE_ENABLE_DBSTAT_VTAB "
97 "-DSQLITE_ENABLE_COLUMN_METADATA")))))))