guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add emacs-sqlite3-api.


From: guix-commits
Subject: branch master updated: gnu: Add emacs-sqlite3-api.
Date: Sun, 18 Sep 2022 08:43:44 -0400

This is an automated email from the git hooks/post-receive script.

ngz pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 24278280ca gnu: Add emacs-sqlite3-api.
24278280ca is described below

commit 24278280caa7296897fe214eb3b8c5f22a7f9b5e
Author: r0man <roman@burningswell.com>
AuthorDate: Sat Mar 26 14:59:01 2022 +0100

    gnu: Add emacs-sqlite3-api.
    
    * gnu/packages/emacs-xyz.scm (emacs-sqlite3-api): New variable.
    
    Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
---
 gnu/packages/emacs-xyz.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index fd861d94f5..30bd0ca48b 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -6233,6 +6233,64 @@ and retrieving information using the SQLite program 
through Elisp programming.
 It is not intended as a user interface.")
       (license license:gpl3+))))
 
+(define-public emacs-sqlite3-api
+  (package
+    (name "emacs-sqlite3-api")
+    (version "0.16")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/pekingduck/emacs-sqlite3-api";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0yrfwb3yvhp1ib4izxh1ds68b3zw8gjkjhlk1kivarxnfjnjnly2"))))
+    (build-system emacs-build-system)
+    (arguments
+     (list
+      #:tests? (not (%current-target-system))
+      #:test-command #~(list "make" "test" "EMACS=emacs")
+      #:modules '((guix build emacs-build-system)
+                  (guix build emacs-utils)
+                  (guix build utils))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-module-load
+            (lambda _
+              (make-file-writable "sqlite3.el")
+              (emacs-substitute-sexps "sqlite3.el"
+                ("(require 'sqlite3-api nil t)"
+                 (string-append
+                  "(module-load \"" #$output "/lib/sqlite3-api.so\")")))))
+          (add-before 'check 'build-emacs-module
+            (lambda _
+              ;; Remove code that fetches constants from the SQLite website
+              ;; and the call to generate a timestamp.
+              (invoke "sed" "--in-place" "3,4d;24,28d;31d" 
"tools/gen-consts.sh")
+              ;; Remove filter logic from the script that generates the 
constants.
+              (invoke "sed" "--in-place" "7,11d;18,22d" "tools/gen-consts.py")
+              ;; Generate the consts.c file.
+              (invoke "make" "--directory=tools")
+              ;; Remove the SQLITE_STATIC and SQLITE_TRANSIENT
+              ;; constants. They cause a compilation warning and would have
+              ;; been removed by the original script.
+              (invoke "sed" "--in-place" "/ifdef SQLITE_STATIC/,+2d" 
"consts.c")
+              (invoke "sed" "--in-place" "/ifdef SQLITE_TRANSIENT/,+2d" 
"consts.c")
+              ;; Compile the shared object file.
+              (invoke "make" #$(string-append "CC=" (cc-for-target)))
+              ;; Move the shared object file into /lib.
+              (install-file "sqlite3-api.so"
+                            (string-append #$output "/lib")))))))
+    (native-inputs (list python sed))
+    (inputs (list sqlite))
+    (home-page "https://github.com/pekingduck/emacs-sqlite3-api";)
+    (synopsis "Dynamic module for Emacs to access the SQLite C interface")
+    (description "This package provides a dynamic module for Emacs that allows
+direct access to the SQLite C interface.  It only exposes a subset of the full
+SQLite C interface, but should satisfy most user's needs.")
+    (license license:gpl3+)))
+
 (define-public emacs-sr-speedbar
   (let ((commit "77a83fb50f763a465c021eca7343243f465b4a47")
         (revision "0"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]