unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 65ddfa595b673eb625d0d8cbb581c5db321457c2 7209 bytes (raw)
name: gnu/packages/sqlite.scm 	 # note: path name is non-authoritative(*)

  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
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2022 Matthew James Kraai <kraai@ftbfs.org>
;;; Copyright © 2024 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages sqlite)
  #:use-module (gnu packages)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages hurd)
  #:use-module (gnu packages readline)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module (guix utils)
  #:use-module (guix deprecation)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-26))

;;; Commentary:
;;;
;;; This module has been separated from (gnu packages databases) to reduce the
;;; number of module references for core packages.

(define (sqlite-numeric-version version)
  (let ((numeric-version
         (match (string-split version #\.)
           ((first-digit other-digits ...)
            (string-append first-digit
                           (string-pad-right
                            (string-concatenate
                             (map (cut string-pad <> 2 #\0)
                                  other-digits))
                            6 #\0))))))
    numeric-version))


(define-public sqlite
  (let* ((version "3.39.3")
         (numeric-version (sqlite-numeric-version version)))
    (package
      (name "sqlite")
      (version version)
      (source (origin
                (method url-fetch)
                (uri (string-append "https://sqlite.org/2022/sqlite-autoconf-" numeric-version ".tar.gz"))
                (patches (search-patches "sqlite-hurd.patch"))
                (sha256
                 (base32
                  "1f922kq16g7f4h3gpzim78lvrp5xw9nvlvqw97s2qgxyh8qgns3q"))))
      (build-system gnu-build-system)
      (inputs (list readline))
      (outputs '("out" "static"))
      (arguments
       `(#:configure-flags
         ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_FTS3,
         ;; -DSQLITE_ENABLE_UNLOCK_NOTIFY and -DSQLITE_ENABLE_DBSTAT_VTAB
         ;; to CFLAGS.  GNU Icecat will refuse to use the system SQLite
         ;; unless these options are enabled.
         (list (string-append "CFLAGS=-O2 -g -DSQLITE_SECURE_DELETE "
                              "-DSQLITE_ENABLE_FTS3 "
                              "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
                              "-DSQLITE_ENABLE_DBSTAT_VTAB "
                              ;; Column metadata is required by GNU Jami and Qt, et.al.
                              "-DSQLITE_ENABLE_COLUMN_METADATA"))
         #:phases (modify-phases %standard-phases
                    (add-after 'install 'move-static-library
                      (lambda* (#:key outputs #:allow-other-keys)
                        (let* ((out    (assoc-ref outputs "out"))
                               (static (assoc-ref outputs "static"))
                               (source (string-append out "/lib/libsqlite3.a")))
                          (mkdir-p (string-append static "/lib"))
                          (link source (string-append static "/lib/libsqlite3.a"))
                          (delete-file source)

                          ;; Remove reference to the static library from the .la file
                          ;; so that Libtool looks for it in the usual places.
                          (substitute* (string-append out "/lib/libsqlite3.la")
                            (("^old_library=.*")
                             "old_library=''\n"))
                          #t))))))
      (home-page "https://www.sqlite.org/")
      (synopsis "The SQLite database management system")
      (description
       "SQLite is a software library that implements a self-contained, serverless,
zero-configuration, transactional SQL database engine.  SQLite is the most
widely deployed SQL database engine in the world.  The source code for SQLite
is in the public domain.")
      (license license:public-domain))))

(define-public sqlite-doc
  (let* ((version (package-version sqlite))
         (numeric-version (sqlite-numeric-version version)))
    (package
      (name "sqlite-doc")
      (version version)
      (source
       (origin
         (method url-fetch)
         (uri (string-append "https://www.sqlite.org/2022/sqlite-doc-" numeric-version ".zip"))
         (sha256
          (base32 "032hgazrcmm9a7r0qrw81i906q2rfafbp9lfincskndgygyk4z2q"))))
      (build-system trivial-build-system)
      (native-inputs (list unzip))
      (arguments
       (list
        #:modules '((guix build utils))
        #:builder
        #~(let ((out #$output)
                (unzip (assoc-ref %build-inputs "unzip"))
                (dest (string-append #$output "/share/doc/sqlite")))
            (use-modules (guix build utils))
            (mkdir-p dest)
            (invoke (string-append unzip "/bin/unzip")
                    (assoc-ref %build-inputs "source"))
            (copy-recursively #$(package-source this-package)
                              (string-append dest "/dest")))))
      (home-page "")
      (synopsis "")
      (description "")
      (license license:ipa))))

;; Newer version required for e.g. fossil.
(define-public sqlite-next
  (let* ((version "3.46.0")
         (numeric-version (sqlite-numeric-version version)))
   (package
     (inherit sqlite)
     (version version)
     (source (origin
               (method url-fetch)
               (uri (string-append "https://sqlite.org/2024/sqlite-autoconf-" numeric-version ".tar.gz"))
               (sha256
                (base32
                 "0zbs853s8ly693qdg0l7vs4shwn3plmvdczr2s478wsj6dxnm3kg")))))))

debug log:

solving 65ddfa595b ...
found 65ddfa595b in https://yhetil.org/guix-patches/CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com/
found 8a49c8f9e8 in https://yhetil.org/guix-patches/CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com/
found dd21db0921 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 dd21db0921e547ce798647d5798d54439d393d67	gnu/packages/sqlite.scm

applying [1/2] https://yhetil.org/guix-patches/CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com/
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index dd21db0921..8a49c8f9e8 100644


applying [2/2] https://yhetil.org/guix-patches/CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com/
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8a49c8f9e8..65ddfa595b 100644

Checking patch gnu/packages/sqlite.scm...
Applied patch gnu/packages/sqlite.scm cleanly.
Checking patch gnu/packages/sqlite.scm...
Applied patch gnu/packages/sqlite.scm cleanly.

index at:
100644 65ddfa595b673eb625d0d8cbb581c5db321457c2	gnu/packages/sqlite.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).