summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorr0man <roman@burningswell.com>2022-03-26 14:59:01 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2022-09-18 14:42:26 +0200
commit24278280caa7296897fe214eb3b8c5f22a7f9b5e (patch)
tree4e2ee6781ad3b1aa18265d80324137c86c202c4e /gnu/packages
parent52e55b38f446784209866dcf4bff23b7f604ba24 (diff)
gnu: Add emacs-sqlite3-api.
* gnu/packages/emacs-xyz.scm (emacs-sqlite3-api): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/emacs-xyz.scm58
1 files changed, 58 insertions, 0 deletions
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"))