unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
To: 73437@debbugs.gnu.org
Subject: [bug#73437] patchset
Date: Mon, 23 Sep 2024 13:14:18 +0200	[thread overview]
Message-ID: <CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com> (raw)
In-Reply-To: <CAAGQtHydvtMFDGRp_6f37FmM_c2UzD3UapVjz8EYVHhr=03+Bw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3 bytes --]

K.

[-- Attachment #1.2: Type: text/html, Size: 39 bytes --]

[-- Attachment #2: 0002-gnu-sqlite-add-variable-sqlite-doc.patch --]
[-- Type: text/x-patch, Size: 2016 bytes --]

From bb9e92a92158bc8c55ed7cf609ca1ba2b5e206c9 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Mon, 23 Sep 2024 12:58:37 +0200
Subject: [PATCH 2/2] gnu: sqlite: add variable sqlite-doc

* gnu/packages/sqlite.scm: new variable sqlite-doc

Change-Id: Iafb018e79e7305c267998b41f90b4327acb61765
---
 gnu/packages/sqlite.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8a49c8f9e8..65ddfa595b 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -117,6 +117,38 @@ (define-public 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")
-- 
2.46.0


[-- Attachment #3: 0001-gnu-sqlite-refactor-sqlite-uri-into-sqlite-numeric-v.patch --]
[-- Type: text/x-patch, Size: 8076 bytes --]

From 57a818db7a3b9323967d444380bc9a97fb9afb2d Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Mon, 23 Sep 2024 12:55:35 +0200
Subject: [PATCH 1/2] gnu: sqlite: refactor sqlite-uri into
 sqlite-numeric-version

* gnu/packages/sqlite.scm: sqlite-uri is too specific to be reusable

As I intend to introduce sqlite-doc, a few issues arise. First, the sqlite url
suffix changes from `tar.gz` til `zip`. Second, the hardcodec `autoconf` part
is turned into `doc`. Calculating the numeric version of sqlite urls is still
useful, and thus still exposed as a function.

Change-Id: I26eb746fb3918889a15f5b7d6949e5bc01a76c22
---
 gnu/packages/sqlite.scm | 121 +++++++++++++++++++++-------------------
 1 file changed, 64 insertions(+), 57 deletions(-)

diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index dd21db0921..8a49c8f9e8 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -32,12 +32,15 @@
 
 (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)
@@ -48,7 +51,7 @@ (define-module (gnu packages sqlite)
 ;;; This module has been separated from (gnu packages databases) to reduce the
 ;;; number of module references for core packages.
 
-(define (sqlite-uri version year)
+(define (sqlite-numeric-version version)
   (let ((numeric-version
          (match (string-split version #\.)
            ((first-digit other-digits ...)
@@ -58,68 +61,72 @@ (define (sqlite-uri version year)
                              (map (cut string-pad <> 2 #\0)
                                   other-digits))
                             6 #\0))))))
-    (string-append "https://sqlite.org/" (number->string year)
-                   "/sqlite-autoconf-" numeric-version ".tar.gz")))
+    numeric-version))
+
 
 (define-public sqlite
-  (package
-   (name "sqlite")
-   (version "3.39.3")
-   (source (origin
-            (method url-fetch)
-            (uri (sqlite-uri version 2022))
-            (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)
+  (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,
+                          ;; 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)))
+      (license license:public-domain))))
 
 ;; Newer version required for e.g. fossil.
 (define-public sqlite-next
-  (package
-    (inherit sqlite)
-    (version "3.46.0")
-    (source (origin
-              (method url-fetch)
-              (uri (sqlite-uri version 2024))
-              (sha256
-               (base32
-                "0zbs853s8ly693qdg0l7vs4shwn3plmvdczr2s478wsj6dxnm3kg"))))))
+  (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")))))))
-- 
2.46.0


      reply	other threads:[~2024-09-23 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 11:07 [bug#73437] Add new package: sqlite-doc Kristian Lein-Mathisen
2024-09-23 11:14 ` Kristian Lein-Mathisen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAGQtHyENoifz5etaYPyzwVhjYMh6bowg6_RM_Kwo=0SC4qq8w@mail.gmail.com' \
    --to=kristianlein@gmail.com \
    --cc=73437@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).