recutils package does not install emacs rec-mode

  • Done
  • quality assurance status badge
Details
3 participants
  • Oleg Pykhalov
  • Jack Hill
  • Ludovic Courtès
Owner
unassigned
Submitted by
Jack Hill
Severity
normal
J
J
Jack Hill wrote on 26 May 2019 20:55
(address . bug-guix@gnu.org)
alpine.DEB.2.20.1905261453360.5164@marsh.hcoop.net
Hello Guix,

Emacs is listed as a native imput of the recutils package, but the emacs
rec-mode is not install (it is found in the etc directory of the source).

Best,
Jack

jackhill@alperton ~$ guix describe
Generation 33 May 23 2019 21:23:03 (current)
guix e26d628
branch: master
commit: e26d628b0fabf5a0aa7c4164a9558c66c61e02ab
jackhill@alperton ~$ cd $(guix build recutils)
jackhill@alperton /gnu/store/163pczynvjfq4l6p7nam5sx9wbz07bgz-recutils-1.8$ find .
.
./lib
./lib/librec.so.1.0.0
./lib/testrec.so.0
./lib/readrec.so.0
./lib/readrec.so.0.0.0
./lib/testrec.la
./lib/readrec.la
./lib/readrec.so
./lib/librec.so.1
./lib/testrec.so
./lib/librec.la
./lib/testrec.a
./lib/readrec.a
./lib/librec.so
./lib/testrec.so.0.0.0
./lib/librec.a
./share
./share/doc
./share/doc/recutils-1.8
./share/doc/recutils-1.8/COPYING
./share/locale
./share/locale/vi
./share/locale/vi/LC_MESSAGES
./share/locale/vi/LC_MESSAGES/recutils.mo
./share/locale/sr
./share/locale/sr/LC_MESSAGES
./share/locale/sr/LC_MESSAGES/recutils.mo
./share/locale/fi
./share/locale/fi/LC_MESSAGES
./share/locale/fi/LC_MESSAGES/recutils.mo
./share/locale/pt_BR
./share/locale/pt_BR/LC_MESSAGES
./share/locale/pt_BR/LC_MESSAGES/recutils.mo
./share/locale/de
./share/locale/de/LC_MESSAGES
./share/locale/de/LC_MESSAGES/recutils.mo
./share/locale/uk
./share/locale/uk/LC_MESSAGES
./share/locale/uk/LC_MESSAGES/recutils.mo
./share/locale/fr
./share/locale/fr/LC_MESSAGES
./share/locale/fr/LC_MESSAGES/recutils.mo
./share/locale/es
./share/locale/es/LC_MESSAGES
./share/locale/es/LC_MESSAGES/recutils.mo
./share/locale/sv
./share/locale/sv/LC_MESSAGES
./share/locale/sv/LC_MESSAGES/recutils.mo
./share/locale/nl
./share/locale/nl/LC_MESSAGES
./share/locale/nl/LC_MESSAGES/recutils.mo
./share/man
./share/man/man1
./share/man/man1/recdel.1.gz
./share/man/man1/rec2csv.1.gz
./share/man/man1/recfmt.1.gz
./share/man/man1/recinf.1.gz
./share/man/man1/recfix.1.gz
./share/man/man1/recins.1.gz
./share/man/man1/recsel.1.gz
./share/man/man1/recset.1.gz
./share/man/man1/csv2rec.1.gz
./share/info
./share/info/recutils.info.gz
./share/info/rec-mode.info.gz
./share/recutils
./share/recutils/etc
./share/recutils/etc/FSD.rec
./include
./include/rec.h
./bin
./bin/recfmt
./bin/recins
./bin/recfix
./bin/recdel
./bin/rec2csv
./bin/recset
./bin/recinf
./bin/recsel
./bin/csv2rec
L
L
Ludovic Courtès wrote on 28 May 2019 17:16
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 35919@debbugs.gnu.org)
87d0k2wqwr.fsf@gnu.org
Hi Jack,

Jack Hill <jackhill@jackhill.us> skribis:

Toggle quote (4 lines)
> Emacs is listed as a native imput of the recutils package, but the
> emacs rec-mode is not install (it is found in the etc directory of the
> source).

That must be a regression. Could you check how this can be fixed?

Thanks,
Ludo’.
J
J
Jack Hill wrote on 28 May 2019 23:00
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1905281655010.5164@marsh.hcoop.net
On Tue, 28 May 2019, Ludovic Courtès wrote:

Toggle quote (2 lines)
> That must be a regression. Could you check how this can be fixed?

Sure, I can take a look and see if I can spot the problem.

Best,
Jack
J
J
Jack Hill wrote on 8 Jun 2019 21:08
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906081455350.5164@marsh.hcoop.net
I've looked at this some, and it looks to me like it is a change in the
upstream build system. I can confirm that the problem arrived in Guix when
the package version was updated from 1.7 to 1.8. In particular, it looks
like lispdir is no longer being set by configure. The configure from 1.7
has

```
if test "x$lispdir" = x; then
lispdir='${datarootdir}/emacs/site-lisp'

fi
```

while the configure from 1.8 does not mention lispdir at all.

I'll ask the recutils upstream if this was intentional.

In the meantime, what do we want to do in Guix? I see two options: one is
patching the build system, and the other is adding a phase to install the
elisp files. The latter seems to me like the clearest and easiest
approach here.

Thoughts?

Best,
Jack
J
J
Jack Hill wrote on 8 Jun 2019 23:07
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906081703490.5164@marsh.hcoop.net
On Sat, 8 Jun 2019, Jack Hill wrote:

Toggle quote (2 lines)
> I'll ask the recutils upstream if this was intentional.

Toggle quote (5 lines)
> In the meantime, what do we want to do in Guix? I see two options: one is
> patching the build system, and the other is adding a phase to install the
> elisp files. The latter seems to me like the clearest and easiest approach
> here.

The attached patch does the latter, copying the two elisp files to the
site-elisp directory. It does not byte-compile the files or generate
autoloads (we do we need to generate autoloads?). However, I don't think
recutils 1.7 did either of those either, so at least we're no worse off
then we were then.

What do you think?

Best,
Jack
From 76f35e000fd58918c28a0b21c4a3911d494a2a08 Mon Sep 17 00:00:00 2001
From: Jack Hill <jackhill@jackhill.us>
Date: Sat, 8 Jun 2019 16:53:02 -0400
Subject: [PATCH] gnu: recutils: Install elisp files
* gnu/packages/databases.scm: (recutils) Add install-elisp phase
---
gnu/packages/databases.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
Toggle diff (33 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index ad4698f24c..9c06a4eb51 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -943,10 +943,22 @@ organized in a hash table or B+ tree.")
(arguments '(#:configure-flags
(list (string-append "--with-bash-headers="
(assoc-ref %build-inputs "bash:include")
- "/include/bash"))))
-
- (native-inputs `(("emacs" ,emacs-minimal)
- ("bc" ,bc)
+ "/include/bash"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-elisp
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (emacs-sitedir (string-append
+ out "/share/emacs/site-lisp"))
+ (elisp-files (list "etc/rec-mode.el" "etc/ob-rec.el")))
+ ;; TODO: compile files
+ (for-each (lambda (file)
+ (install-file file emacs-sitedir))
+ elisp-files)
+ #t))))))
+
+ (native-inputs `(("bc" ,bc)
("bash:include" ,bash "include")
("check" ,check)
("libuuid" ,util-linux)
--
2.21.0
O
O
Oleg Pykhalov wrote on 9 Jun 2019 20:06
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 35919@debbugs.gnu.org)
875zped46f.fsf@gmail.com
Hi Jack,

Jack Hill <jackhill@jackhill.us> writes:

[…]

Toggle quote (6 lines)
> The attached patch does the latter, copying the two elisp files to the
> site-elisp directory. It does not byte-compile the files or generate
> autoloads (we do we need to generate autoloads?). However, I don't
> think recutils 1.7 did either of those either, so at least we're no
> worse off then we were then.

WDYT about creating a new package recipe in
‘gnu/packages/emacs-xyz.scm’, which inherits ‘recutils’ and sets build
system to ‘emacs-build-system’? We will probably need to change
directory after unpack phase in this case, but we will not need to
maintain Emacs lisp files compilation manually.

Regards,
Oleg.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlz9SpgACgkQFn+OpQAa
+pw8mA//T6OMM/JSg+7FWPAcrOv/WRZaoFoMaHelxJ58dW/ng4BJgjjAIL2YcL5m
T47OMn0lGz4jQSuz9R5QByAUvOI/on3xhuwjdOG+vNR9/NTy6u8gGLcWG9KDT7Vs
iZ8SqC2kFBhf+QiPRfTeTdgG4HukROUoBNAToHuyiyau9t2sPyeRBZOYxaAsRTTl
0uC3+tm0fzHlRwRl3auoaSBMyY11zi5DP8cLRpHGNrRHUCpFjYRfVOL1NsJhUYSU
uVt7UD9bSLS3JmzpOENmjcd8Jaq9tzBHqgI6oYvvNee5fv8WdAf9iQMT704LI3oB
ML2l8D6pTaX0vtnJ3+sy4Gy9DiLtT9MdzKgLqnIYssKfEpJM6LF2DaQ6MJT3scVl
wvGuJDKAZFq3wZ3Bun7M2SWH8F8B2n4+gd3r66w65qwZpD0cw00TQ5m1zlDIu2B4
Yzfb/Wt/CGmqDIt5hVEN266JQPkEQw1YrZxJC2e19/uL0d2xFLFDuVuQr0Eux9kB
uQ80wSibEUtE/3z3xM7tvQowRJDH7Hra895WPD8WZFgNVaUOTw4O3c4tD7Vj15G9
Dv0AZoYwcOsKNZfhCQROHwiKckjQTPrZf1eP9Flx0TDJIH4evBfkqXWg+EAgF30M
147waoDZBnnWE/XzOUI9HZZXAkB79pDjNyQTpRQDJJjYh5+tOYw=
=+QAt
-----END PGP SIGNATURE-----

J
J
Jack Hill wrote on 9 Jun 2019 20:55
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906091454280.5164@marsh.hcoop.net
On Sun, 9 Jun 2019, Oleg Pykhalov wrote:

Toggle quote (6 lines)
> WDYT about creating a new package recipe in
> ‘gnu/packages/emacs-xyz.scm’, which inherits ‘recutils’ and sets build
> system to ‘emacs-build-system’? We will probably need to change
> directory after unpack phase in this case, but we will not need to
> maintain Emacs lisp files compilation manually.

Oleg,

I like that idea. I'll give it a go, thanks for the suggestion.

Best,
Jack
J
J
Jack Hill wrote on 10 Jun 2019 04:01
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906092149020.5164@marsh.hcoop.net
On Sun, 9 Jun 2019, Oleg Pykhalov wrote:

Toggle quote (6 lines)
> WDYT about creating a new package recipe in
> ‘gnu/packages/emacs-xyz.scm’, which inherits ‘recutils’ and sets build
> system to ‘emacs-build-system’? We will probably need to change
> directory after unpack phase in this case, but we will not need to
> maintain Emacs lisp files compilation manually.

I have prepared the following patch implementing this suggestion (thanks
again, I'm much happier with this). I ended up putting it in databases.scm
rather than emacs-xyz.scm so that it can live with the recutls definition,
and not run afoul of the advice by Ludo’ in [0], "The lesson is: when
inheriting from a package, do it in the module where it’s defined."


I have also set the inputs and native inputs to the empty lists, because
as far as I can tell, the emacs mode does not depend on anything outside
of the emacs-build-system.

Best,
Jack
J
J
Jack Hill wrote on 10 Jun 2019 04:02
[PATCH] gnu: Add emacs-recutils
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906092201270.5164@marsh.hcoop.net
From 9ef1261d8223eeb4b88da4b9ac8659ca60331ffd Mon Sep 17 00:00:00 2001

* gnu/packages/databases.scm (emacs-recutils) new variable.
---
gnu/packages/databases.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index ad4698f24c..30821e330b 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -33,6 +33,7 @@
;;; Copyright ᅵ 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright ᅵ 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
;;; Copyright ᅵ 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright ᅵ 2019 Jack Hill <jackhill@jackhill.us>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -108,6 +109,7 @@
#:use-module (guix download)
#:use-module (guix bzr-download)
#:use-module (guix git-download)
+ #:use-module (guix build-system emacs)
#:use-module (guix build-system gnu)
#:use-module (guix build-system go)
#:use-module (guix build-system perl)
@@ -965,6 +967,26 @@ types are supported, as is encryption.")
(license license:gpl3+)
(home-page "https://www.gnu.org/software/recutils/")))

+(define-public emacs-recutils
+ (package
+ (inherit recutils)
+ (name "emacs-recutils")
+ (build-system emacs-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'change-directory
+ (lambda _
+ (chdir "etc")
+ #t)))))
+ (native-inputs '())
+ (inputs '())
+ (synopsis "Emacs more for working with recutils database files")
+ (description "This package provides rec-mode for Emacs for working with
+GNU Recutils text-based, human-editable databases. It supports editing,
+navigation, and querying of recutils database files including field and record
+folding.")))
+
(define-public rocksdb
(package
(name "rocksdb")
--
2.21.0
J
J
Jack Hill wrote on 10 Jun 2019 05:24
recutils package does not install emacs rec-mode
(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906092323010.5164@marsh.hcoop.net
I realized that emacs-minimal should also be removed from the
native-inputs of recutils since it is not being using during the build.
J
J
Jack Hill wrote on 10 Jun 2019 05:25
[PATCH] gnu: recutils: remove emacs-minimal native input
(address . 35919@debbugs.gnu.org)
alpine.DEB.2.20.1906092324540.5164@marsh.hcoop.net
From 6cb65ab8ae2a0cb239cc476a6859ab407cec30e2 Mon Sep 17 00:00:00 2001

* gnu/packages/databases.scm (recutils)
[native-inputs]: Remove emacs-minimal
---
gnu/packages/databases.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index ad4698f24c..0edb3d445c 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -945,8 +945,7 @@ organized in a hash table or B+ tree.")
(assoc-ref %build-inputs "bash:include")
"/include/bash"))))

- (native-inputs `(("emacs" ,emacs-minimal)
- ("bc" ,bc)
+ (native-inputs `(("bc" ,bc)
("bash:include" ,bash "include")
("check" ,check)
("libuuid" ,util-linux)
--
2.21.0
O
O
Oleg Pykhalov wrote on 10 Jun 2019 06:09
Re: bug#35919: recutils package does not install emacs rec-mode
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 35919-done@debbugs.gnu.org)
87zhmqaxnx.fsf@gmail.com
Jack Hill <jackhill@jackhill.us> writes:

Toggle quote (16 lines)
> On Sun, 9 Jun 2019, Oleg Pykhalov wrote:
>
>> WDYT about creating a new package recipe in
>> ‘gnu/packages/emacs-xyz.scm’, which inherits ‘recutils’ and sets build
>> system to ‘emacs-build-system’? We will probably need to change
>> directory after unpack phase in this case, but we will not need to
>> maintain Emacs lisp files compilation manually.
>
> I have prepared the following patch implementing this suggestion
> (thanks again, I'm much happier with this). I ended up putting it in
> databases.scm rather than emacs-xyz.scm so that it can live with the
> recutls definition, and not run afoul of the advice by Ludo’ in [0],
> "The lesson is: when inheriting from a package, do it in the module
> where it’s defined."
> [0] https://issues.guix.gnu.org/issue/35154#5

Ah, sorry about that - I forgot this.

Toggle quote (4 lines)
> I have also set the inputs and native inputs to the empty lists,
> because as far as I can tell, the emacs mode does not depend on
> anything outside of the emacs-build-system.

OK, I fixed a typo in emacs-recutils synopsis and formatted Git
messages. You could look for messages examples with a handy command
‘vc-print-log’ in Emacs which is binded to ‘C-x v l’ by default. Also I
modified a description a little bit for better searching if you don't
mind. Pushed as 535a69e9e5aae2f59470caf900ece56f83ee6e36 to master.

Thanks,
Oleg.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlz92BIACgkQFn+OpQAa
+pxo6Q/9GuwF3wXtvQADBCylybMKWIDDw3dUixI3Ix+mgY3uRtkyz1w/bXqhd4+P
vUvU4hhqsNT3qj9ppH+Zxv2Kambuo8HSQvnJaKJl5DnApuxOowteDrRelc1DWrII
h2S1y3fUcL7J9Ln7oveu9n6CZYHG1gr5LBH1PS0pvaut0UUwhqz9RjWGqKYhjvzL
Gq8O28NYZzY0yGLzIrRGQlJ7BOeveStD5qTzrG0NBbyaaF/c2ymGpgmTEl9DRIIf
r+4ARLXRDtNmganjBm3IeyK8VXg/fiFV/mzgtfh9W7NUP+/xP3ScG/cSYdbYb/wJ
IFwpEe0l686fiIA34AbnugSh1vFBvPQPL00bbgIssI/QkqfMQfIkYL8MTZzTyn/E
RT2UAEJQOHYZWtqJxNmboDz6YokVOnAjxJkS8twvsjSJ+k55syF0mEd9W0cJ53Fv
0GnrrepFfjlPDd9BIATmOA8HSUT9cVK3i9O0o2sqZpUUkqkzGMrkoIk8dlJITTZL
KHsCdNdKr8uwwCWEOb9ur3Vi8jdarSETp7bdCQrRyTtHaWz1wHGyExzItize2HzO
ndrSpdGK6vWZcqqC79fBTaTo7afdTsLsg0IsUwrLeCbtBjqBhkNJIMhvtzOL4nch
VMPCsjaSvL5LirZ76KPiLNbOM/GAr6aB5OB+IHLIJnuI1mToFC8=
=DYFb
-----END PGP SIGNATURE-----

Closed
J
J
Jack Hill wrote on 10 Jun 2019 19:30
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 35919-done@debbugs.gnu.org)
alpine.DEB.2.20.1906101326060.5164@marsh.hcoop.net
On Mon, 10 Jun 2019, Oleg Pykhalov wrote:

Toggle quote (10 lines)
>> I have prepared the following patch implementing this suggestion
>> (thanks again, I'm much happier with this). I ended up putting it in
>> databases.scm rather than emacs-xyz.scm so that it can live with the
>> recutls definition, and not run afoul of the advice by Ludo’ in [0],
>> "The lesson is: when inheriting from a package, do it in the module
>> where it’s defined."
>> [0] https://issues.guix.gnu.org/issue/35154#5
>
> Ah, sorry about that - I forgot this.

No worries, I probably remember it more strongly since I was affected by
the other bug.

Toggle quote (6 lines)
> OK, I fixed a typo in emacs-recutils synopsis and formatted Git
> messages. You could look for messages examples with a handy command
> ‘vc-print-log’ in Emacs which is binded to ‘C-x v l’ by default. Also I
> modified a description a little bit for better searching if you don't
> mind. Pushed as 535a69e9e5aae2f59470caf900ece56f83ee6e36 to master.

Thanks for the tip and for improving the description. I'm still learning
the art of writing a good description.

Best,
Jack
Closed
?