From da4fbbb0b8dbbee2ea88e2d07260764d04893397 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 19 Aug 2024 22:42:31 +0300 Subject: New variable: emacs: emacs-emacsql. --- hecate/packages/emacs.scm | 68 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/hecate/packages/emacs.scm b/hecate/packages/emacs.scm index 3bce854..15a321e 100644 --- a/hecate/packages/emacs.scm +++ b/hecate/packages/emacs.scm @@ -90,7 +90,7 @@ the current buffer, a file on your disk, or a string from the kill ring.") (license license:gpl3+)))) (define-public emacs-gnosis - (let ((commit "bc0d2a3ec6195d79903ad7badec10a26538763c2") + (let ((commit "fe019d58f26e99e59a5601d2e276ad06676b1b66") (revision "0")) (package (name "emacs-gnosis") @@ -103,10 +103,10 @@ the current buffer, a file on your disk, or a string from the kill ring.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "0m10nnghg9j7pc8zqm9jfc49q8jbrnq4nimdd5rwbjyijhywhclr")))) + (base32 "10940gmc7acvdxkmyhq9aa454f10bqz9npy3r5lpxgnp74km8bnm")))) (build-system emacs-build-system) (propagated-inputs (list emacs-compat emacs-emacsql)) - (home-page "https://github.com/emacsorphanage/ac-ispell") + (home-page "https://thanosapollo.org/projects/gnosis/") (synopsis "Spaced repetition system for GNU Emacs.") (description "Gnosis is a spaced repetition system for note-taking and self-testing @@ -157,3 +157,65 @@ displayed in a tabulated list format. The videos can be opened with a user-defi video player (by default @command{mpv}) or downloaded using @command{yt-dlp}. This package also includes a minimal @code{yt-dlp} wrapper.") (license license:gpl3+)))) + +(define-public emacs-emacsql + (package + (name "emacs-emacsql") + (version "4.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/magit/emacsql") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1d7628rmb5wwvafrn3m3f8z3mb696wklwlcds71j8l5x782wh8hf")))) + (build-system emacs-build-system) + (arguments + (list + #:tests? #true + #:test-command #~(list "emacs" "-Q" "--batch" + "-L" "tests" + "-L" "." + "-l" "tests/emacsql-tests.el" + "-f" "ert-run-tests-batch-and-exit") + #:modules '((guix build emacs-build-system) + (guix build utils) + (guix build emacs-utils) + (srfi srfi-26)) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-elisp-shell-shebangs + (lambda _ + (substitute* (find-files "." "\\.el") + (("/bin/sh") (which "sh"))))) + (add-after 'patch-elisp-shell-shebangs 'setenv-shell + (lambda _ + (setenv "SHELL" "sh"))) + (add-after 'build-emacsql-sqlite 'install-emacsql-sqlite + ;; This build phase installs emacs-emacsql binary. + (lambda _ + (install-file "sqlite/emacsql-sqlite" + (string-append #$output "/bin")))) + (add-after 'install-emacsql-sqlite 'patch-emacsql-sqlite.el + ;; This build phase removes interactive prompts + ;; and makes sure Emacs look for binaries in the right places. + (lambda _ + (emacs-substitute-variables "emacsql-sqlite.el" + ("emacsql-sqlite-executable" + (string-append #$output "/bin/emacsql-sqlite")) + ;; Make sure Emacs looks for ‘GCC’ binary in the right place. + ("emacsql-sqlite-c-compilers" + `(list ,(which "gcc"))))))))) + (inputs + (list emacs-minimal `(,mariadb "dev") `(,mariadb "lib") postgresql)) + (propagated-inputs + (list emacs-finalize emacs-pg emacs-sqlite3-api)) + (home-page "https://github.com/magit/emacsql") + (synopsis "Emacs high-level SQL database front-end") + (description "EmacSQL is a high-level Emacs Lisp front-end for SQLite. PostgreSQL and MySQL are also supported, but use of these connectors is not recommended. Any readable Lisp value can be stored as a value in EmacSQL, including numbers, strings, symbols, lists, vectors, and closures. EmacSQL +has no concept of @code{TEXT} values; it's all just Lisp objects. The Lisp +object @code{nil} corresponds 1:1 with @code{NULL} in the database.") + (license license:gpl3+))) + -- cgit v1.2.3