From b1568732c8aa95aa8f6cd914a903be2f807c252d Mon Sep 17 00:00:00 2001 From: r0man Date: Sat, 26 Mar 2022 14:59:01 +0100 Subject: [PATCH] Add emacs-sqlite3-api package This patch adds the emacs-sqlite3-api package to Guix. The 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. --- gnu/packages/emacs-xyz.scm | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 42fc13f4c2..dad0fe62e8 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -5731,6 +5731,54 @@ (define-public emacs-sqlite It is not intended as a user interface.") (license license:gpl3+)))) +(define-public emacs-sqlite3-api + (let ((version "0.15") + (revision "0") + (commit "7cb4b660fe30deb8a4229f3abb18bd99ca9c971c")) + (package + (name "emacs-sqlite3-api") + (version (git-version version revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pekingduck/emacs-sqlite3-api") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1b7if1dp6i5kqwhq25gna89xbca66i4mmgx1a5yn12kncfdgs6d7")))) + (build-system emacs-build-system) + (arguments + `(#: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* (#:key outputs #:allow-other-keys) + (chmod "sqlite3.el" #o644) + (emacs-substitute-sexps "sqlite3.el" + ("(require 'sqlite3-api nil t)" + `(module-load ,(string-append (assoc-ref outputs "out") + "/lib/sqlite3-api.so")))))) + (add-before 'check 'build-emacs-module + (lambda* (#:key (make-flags '()) outputs #:allow-other-keys) + ;; 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 (assoc-ref outputs "out") + "/lib"))))) + #:tests? #t + #:test-command '("make" "test" "EMACS=emacs"))) + (inputs (list sqlite)) + (home-page "https://github.com/pekingduck/emacs-sqlite3-api") + (synopsis "SQLite dynamic module for Emacs Lisp") + (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")) -- 2.34.0