all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#73437] Add new package: sqlite-doc
@ 2024-09-23 11:07 Kristian Lein-Mathisen
  2024-09-23 11:14 ` [bug#73437] patchset Kristian Lein-Mathisen
  0 siblings, 1 reply; 2+ messages in thread
From: Kristian Lein-Mathisen @ 2024-09-23 11:07 UTC (permalink / raw)
  To: 73437


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

Hi!

I'd like to package sqlite-doc so that I can browse this wonderful
documentation suite offline.
In order to do that, however, I had to refactor sqlite.scm slightly.
Therefor, this consists of two patches:

- Refactoring of sqlite.scm (sqlite-uri specifically)
- The new sqlite-doc package

Please consider applying these modifications.
Thank you!

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

[-- Attachment #2: 0000-cover-letter.patch --]
[-- Type: text/x-patch, Size: 548 bytes --]

From bb9e92a92158bc8c55ed7cf609ca1ba2b5e206c9 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Mon, 23 Sep 2024 13:06:34 +0200
Subject: [PATCH 0/2] *** SUBJECT HERE ***

*** BLURB HERE ***

Kristian Lein-Mathisen (2):
  gnu: sqlite: refactor sqlite-uri into sqlite-numeric-version
  gnu: sqlite: add variable sqlite-doc

 gnu/packages/sqlite.scm | 153 +++++++++++++++++++++++++---------------
 1 file changed, 96 insertions(+), 57 deletions(-)


base-commit: 41e408eb1f93d96b549d345e2de74143220b7b76
-- 
2.46.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [bug#73437] patchset
  2024-09-23 11:07 [bug#73437] Add new package: sqlite-doc Kristian Lein-Mathisen
@ 2024-09-23 11:14 ` Kristian Lein-Mathisen
  0 siblings, 0 replies; 2+ messages in thread
From: Kristian Lein-Mathisen @ 2024-09-23 11:14 UTC (permalink / raw)
  To: 73437


[-- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-23 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23 11:07 [bug#73437] Add new package: sqlite-doc Kristian Lein-Mathisen
2024-09-23 11:14 ` [bug#73437] patchset Kristian Lein-Mathisen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.