unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35919: recutils package does not install emacs rec-mode
@ 2019-05-26 18:55 Jack Hill
  2019-05-28 15:16 ` Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jack Hill @ 2019-05-26 18:55 UTC (permalink / raw)
  To: 35919

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
     repository URL: https://git.savannah.gnu.org/git/guix.git
     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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-05-26 18:55 bug#35919: recutils package does not install emacs rec-mode Jack Hill
@ 2019-05-28 15:16 ` Ludovic Courtès
  2019-05-28 21:00   ` Jack Hill
  2019-06-10  2:02 ` bug#35919: [PATCH] gnu: Add emacs-recutils Jack Hill
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2019-05-28 15:16 UTC (permalink / raw)
  To: Jack Hill; +Cc: 35919

Hi Jack,

Jack Hill <jackhill@jackhill.us> skribis:

> 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’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-05-28 15:16 ` Ludovic Courtès
@ 2019-05-28 21:00   ` Jack Hill
  2019-06-08 19:08     ` Jack Hill
  0 siblings, 1 reply; 13+ messages in thread
From: Jack Hill @ 2019-05-28 21:00 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

On Tue, 28 May 2019, Ludovic Courtès wrote:

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-05-28 21:00   ` Jack Hill
@ 2019-06-08 19:08     ` Jack Hill
  2019-06-08 21:07       ` Jack Hill
  0 siblings, 1 reply; 13+ messages in thread
From: Jack Hill @ 2019-06-08 19:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35919

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-08 19:08     ` Jack Hill
@ 2019-06-08 21:07       ` Jack Hill
  2019-06-09 18:06         ` Oleg Pykhalov
  0 siblings, 1 reply; 13+ messages in thread
From: Jack Hill @ 2019-06-08 21:07 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Sat, 8 Jun 2019, Jack Hill wrote:

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

I have done so at: 
<https://lists.gnu.org/archive/html/help-recutils/2019-06/msg00000.html>

> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-gnu-recutils-Install-elisp-files.patch, Size: 2008 bytes --]

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

Fixes <https://bugs.gnu.org/35919>

* gnu/packages/databases.scm: (recutils) Add install-elisp phase
---
 gnu/packages/databases.scm | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-08 21:07       ` Jack Hill
@ 2019-06-09 18:06         ` Oleg Pykhalov
  2019-06-09 18:55           ` Jack Hill
  2019-06-10  2:01           ` Jack Hill
  0 siblings, 2 replies; 13+ messages in thread
From: Oleg Pykhalov @ 2019-06-09 18:06 UTC (permalink / raw)
  To: Jack Hill; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

Hi Jack,

Jack Hill <jackhill@jackhill.us> writes:

[…]

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-09 18:06         ` Oleg Pykhalov
@ 2019-06-09 18:55           ` Jack Hill
  2019-06-10  2:01           ` Jack Hill
  1 sibling, 0 replies; 13+ messages in thread
From: Jack Hill @ 2019-06-09 18:55 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

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.

Oleg,

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

Best,
Jack

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-09 18:06         ` Oleg Pykhalov
  2019-06-09 18:55           ` Jack Hill
@ 2019-06-10  2:01           ` Jack Hill
  2019-06-10  4:09             ` Oleg Pykhalov
  1 sibling, 1 reply; 13+ messages in thread
From: Jack Hill @ 2019-06-10  2:01 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

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

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: [PATCH] gnu: Add emacs-recutils
  2019-05-26 18:55 bug#35919: recutils package does not install emacs rec-mode Jack Hill
  2019-05-28 15:16 ` Ludovic Courtès
@ 2019-06-10  2:02 ` Jack Hill
  2019-06-10  3:24 ` bug#35919: recutils package does not install emacs rec-mode Jack Hill
  2019-06-10  3:25 ` bug#35919: [PATCH] gnu: recutils: remove emacs-minimal native input Jack Hill
  3 siblings, 0 replies; 13+ messages in thread
From: Jack Hill @ 2019-06-10  2:02 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 35919

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

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(+)

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-05-26 18:55 bug#35919: recutils package does not install emacs rec-mode Jack Hill
  2019-05-28 15:16 ` Ludovic Courtès
  2019-06-10  2:02 ` bug#35919: [PATCH] gnu: Add emacs-recutils Jack Hill
@ 2019-06-10  3:24 ` Jack Hill
  2019-06-10  3:25 ` bug#35919: [PATCH] gnu: recutils: remove emacs-minimal native input Jack Hill
  3 siblings, 0 replies; 13+ messages in thread
From: Jack Hill @ 2019-06-10  3:24 UTC (permalink / raw)
  To: 35919

I realized that emacs-minimal should also be removed from the 
native-inputs of recutils since it is not being using during the build.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: [PATCH] gnu: recutils: remove emacs-minimal native input
  2019-05-26 18:55 bug#35919: recutils package does not install emacs rec-mode Jack Hill
                   ` (2 preceding siblings ...)
  2019-06-10  3:24 ` bug#35919: recutils package does not install emacs rec-mode Jack Hill
@ 2019-06-10  3:25 ` Jack Hill
  3 siblings, 0 replies; 13+ messages in thread
From: Jack Hill @ 2019-06-10  3:25 UTC (permalink / raw)
  To: 35919

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(-)

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-10  2:01           ` Jack Hill
@ 2019-06-10  4:09             ` Oleg Pykhalov
  2019-06-10 17:30               ` Jack Hill
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Pykhalov @ 2019-06-10  4:09 UTC (permalink / raw)
  To: Jack Hill; +Cc: 35919-done

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

Jack Hill <jackhill@jackhill.us> writes:

> 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.

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#35919: recutils package does not install emacs rec-mode
  2019-06-10  4:09             ` Oleg Pykhalov
@ 2019-06-10 17:30               ` Jack Hill
  0 siblings, 0 replies; 13+ messages in thread
From: Jack Hill @ 2019-06-10 17:30 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 35919-done

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

On Mon, 10 Jun 2019, Oleg Pykhalov wrote:

>> 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.

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-06-10 17:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-26 18:55 bug#35919: recutils package does not install emacs rec-mode Jack Hill
2019-05-28 15:16 ` Ludovic Courtès
2019-05-28 21:00   ` Jack Hill
2019-06-08 19:08     ` Jack Hill
2019-06-08 21:07       ` Jack Hill
2019-06-09 18:06         ` Oleg Pykhalov
2019-06-09 18:55           ` Jack Hill
2019-06-10  2:01           ` Jack Hill
2019-06-10  4:09             ` Oleg Pykhalov
2019-06-10 17:30               ` Jack Hill
2019-06-10  2:02 ` bug#35919: [PATCH] gnu: Add emacs-recutils Jack Hill
2019-06-10  3:24 ` bug#35919: recutils package does not install emacs rec-mode Jack Hill
2019-06-10  3:25 ` bug#35919: [PATCH] gnu: recutils: remove emacs-minimal native input Jack Hill

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).