gnu: emacs-emacsql: Improve package style.

* gnu/packages/emacs-xyz.scm (emacs-emacsql)[arguments]: Use G-expressions.
<#:phases>: Use EMACS-SUBSTITUTE-VARIABLES instead of EMACS-SUBSTITUTE-SEXPS.
This commit is contained in:
Nicolas Goaziou 2022-10-13 11:53:39 +02:00
parent 00fa377710
commit 21b698c503
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D

View File

@ -19158,41 +19158,38 @@ object has been freed.")
(base32 "1iibfb5l94i8p5kqb54wxpbsflh3v7d36kfn34pg16839hs54410"))))
(build-system emacs-build-system)
(arguments
`(#:modules ((guix build emacs-build-system)
(list
#: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 'setenv-shell 'build-emacsql-sqlite
(lambda _
(invoke "make" "binary" (string-append "CC=" ,(cc-for-target)))))
(add-after 'build-emacsql-sqlite 'install-emacsql-sqlite
;; This build phase installs emacs-emacsql binary.
(lambda* (#:key outputs #:allow-other-keys)
(install-file "sqlite/emacsql-sqlite"
(string-append (assoc-ref outputs "out") "/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* (#:key outputs #:allow-other-keys)
(let ((file "emacsql-sqlite.el"))
(chmod file #o644)
(emacs-substitute-sexps file
;; Make sure Emacs looks for GCC binary in the right place.
("(executable-find" (which "gcc"))
;; Make sure Emacs looks for emacsql-sqlite binary
;; in the right place.
("(defvar emacsql-sqlite-executable"
(string-append (assoc-ref outputs "out")
"/bin/emacsql-sqlite")))))))))
#: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 'setenv-shell 'build-emacsql-sqlite
(lambda _
(invoke "make" "binary" (string-append "CC=" #$(cc-for-target)))))
(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