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 @@ (define-public emacs-emacsql
(base32 "1iibfb5l94i8p5kqb54wxpbsflh3v7d36kfn34pg16839hs54410")))) (base32 "1iibfb5l94i8p5kqb54wxpbsflh3v7d36kfn34pg16839hs54410"))))
(build-system emacs-build-system) (build-system emacs-build-system)
(arguments (arguments
`(#:modules ((guix build emacs-build-system) (list
#:modules '((guix build emacs-build-system)
(guix build utils) (guix build utils)
(guix build emacs-utils) (guix build emacs-utils)
(srfi srfi-26)) (srfi srfi-26))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'install 'patch-elisp-shell-shebangs (add-before 'install 'patch-elisp-shell-shebangs
(lambda _ (lambda _
(substitute* (find-files "." "\\.el") (substitute* (find-files "." "\\.el")
(("/bin/sh") (which "sh"))))) (("/bin/sh") (which "sh")))))
(add-after 'patch-elisp-shell-shebangs 'setenv-shell (add-after 'patch-elisp-shell-shebangs 'setenv-shell
(lambda _ (lambda _
(setenv "SHELL" "sh"))) (setenv "SHELL" "sh")))
(add-after 'setenv-shell 'build-emacsql-sqlite (add-after 'setenv-shell 'build-emacsql-sqlite
(lambda _ (lambda _
(invoke "make" "binary" (string-append "CC=" ,(cc-for-target))))) (invoke "make" "binary" (string-append "CC=" #$(cc-for-target)))))
(add-after 'build-emacsql-sqlite 'install-emacsql-sqlite (add-after 'build-emacsql-sqlite 'install-emacsql-sqlite
;; This build phase installs emacs-emacsql binary. ;; This build phase installs emacs-emacsql binary.
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(install-file "sqlite/emacsql-sqlite" (install-file "sqlite/emacsql-sqlite"
(string-append (assoc-ref outputs "out") "/bin")))) (string-append #$output "/bin"))))
(add-after 'install-emacsql-sqlite 'patch-emacsql-sqlite.el (add-after 'install-emacsql-sqlite 'patch-emacsql-sqlite.el
;; This build phase removes interactive prompts ;; This build phase removes interactive prompts
;; and makes sure Emacs look for binaries in the right places. ;; and makes sure Emacs look for binaries in the right places.
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((file "emacsql-sqlite.el")) (emacs-substitute-variables "emacsql-sqlite.el"
(chmod file #o644) ("emacsql-sqlite-executable"
(emacs-substitute-sexps file (string-append #$output "/bin/emacsql-sqlite"))
;; Make sure Emacs looks for GCC binary in the right place. ;; Make sure Emacs looks for GCC binary in the right place.
("(executable-find" (which "gcc")) ("emacsql-sqlite-c-compilers"
;; Make sure Emacs looks for emacsql-sqlite binary `(list ,(which "gcc")))))))))
;; in the right place.
("(defvar emacsql-sqlite-executable"
(string-append (assoc-ref outputs "out")
"/bin/emacsql-sqlite")))))))))
(inputs (inputs
(list emacs-minimal `(,mariadb "dev") `(,mariadb "lib") postgresql)) (list emacs-minimal `(,mariadb "dev") `(,mariadb "lib") postgresql))
(propagated-inputs (propagated-inputs