From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3hfz-0000Vr-AO for guix-patches@gnu.org; Wed, 04 Apr 2018 08:38:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3hfu-0004UR-M3 for guix-patches@gnu.org; Wed, 04 Apr 2018 08:38:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:58144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3hfu-0004UD-Hf for guix-patches@gnu.org; Wed, 04 Apr 2018 08:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f3hfu-0008Ic-4J for guix-patches@gnu.org; Wed, 04 Apr 2018 08:38:02 -0400 Subject: [bug#30884] [PATCH 4/6] gnu: Add emacs-emacsql. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180320163310.11955-1-go.wigust@gmail.com> <20180320163310.11955-4-go.wigust@gmail.com> Date: Wed, 04 Apr 2018 14:37:24 +0200 In-Reply-To: <20180320163310.11955-4-go.wigust@gmail.com> (Oleg Pykhalov's message of "Tue, 20 Mar 2018 19:33:08 +0300") Message-ID: <87woxnb117.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 30884@debbugs.gnu.org Oleg Pykhalov skribis: > * gnu/packages/emacs.scm (emacs-emacsql): New public variable. [...] > + (add-after 'patch-elisp-shell-shebangs 'setenv-emacsloadpath > + (lambda* (#:key inputs #:allow-other-keys) > + (define (el-dir store-dir) > + (match (find-files store-dir "\\.el$") > + ((f1 f2 ...) (dirname f1)) > + (_ ""))) > + (define emacs-prefix? (cut string-prefix? "emacs-" <>)) > + (let* ((emacs-load-paths > + (map (match-lambda > + (((? emacs-prefix? name) . dir) > + (string-append (el-dir dir) ":")) > + (_ "")) > + inputs)) > + (emacs-load-path-value > + (string-concatenate emacs-load-paths))) > + (format #t "environment variable `EMACSLOADPATH' set to ~= a\n" > + emacs-load-path-value) > + (setenv "EMACSLOADPATH" emacs-load-path-value)) Now that there=E2=80=99s a new =E2=80=98set-emacs-load-path=E2=80=99, I sus= pect this phase can be removed. Can you confirm, Maxim? > + (add-after 'build-emacsql-sqlite 'install-emacsql-sqlite > + (lambda* (#:key outputs #:allow-other-keys) > + (install-file "sqlite/emacsql-sqlite" > + (string-append (assoc-ref outputs "out") > + "/bin")) > + #t)) > + (add-after 'install-emacsql-sqlite 'patch-emacsql-sqlite.el > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((file "emacsql-sqlite.el")) > + (chmod file #o644) > + (emacs-substitute-sexps file > + ("(defvar emacsql-sqlite-user-prompted" 't) > + ("(executable-find" (which "gcc")) > + ("(defvar emacsql-sqlite-executable" > + (string-append (assoc-ref outputs "out") > + "/bin/emacsql-sqlite")))))) Please add short comments explaining what=E2=80=99s going on in these phase= s. > + (home-page "https://github.com/skeeto/emacsql") > + (synopsis "Emacs high-level SQL database front-end") > + (description "EmacSQL provides a high-level Emacs Lisp front-end for > +SQLite (primarily), PostgreSQL, MySQL, and potentially other SQL databas= es.") I would add this, taken from their README: 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. Otherwise LGTM, thanks! Ludo=E2=80=99.