GNU bug report logs - #29616
[PATCH core-updates] gnu: guile: Move Readline support to a separate 'guile-readline' package.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 8 Dec 2017 16:37:02 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29616 in the body.
You can then email your comments to 29616 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#29616; Package guix-patches. (Fri, 08 Dec 2017 16:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Dec 2017 16:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH core-updates] gnu: guile: Move Readline support to a separate
 'guile-readline' package.
Date: Fri,  8 Dec 2017 17:35:53 +0100
This reduces the closure of Guile from 131 MiB to 116 MiB and removes
extra readline/ncurses builds from the bootstrap path.

* gnu/packages/guile.scm (guile-2.0)[inputs]: Remove READLINE.
(make-guile-readline): New procedure.
(guile-readline): New variable.
* gnu/system/shadow.scm (default-skeletons): Adjust '.guile' so that it
gracefully deals with missing (ice-9 readline).
---
 gnu/packages/guile.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-
 gnu/system/shadow.scm  | 12 ++++++----
 2 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 6e8b95395..352e7bd89 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -153,7 +153,6 @@ without requiring the source code to be rewritten.")
    (build-system gnu-build-system)
    (native-inputs `(("pkgconfig" ,pkg-config)))
    (inputs `(("libffi" ,libffi)
-             ("readline" ,readline)
              ,@(libiconv-if-needed)
 
              ;; We need Bash when cross-compiling because some of the scripts
@@ -265,6 +264,65 @@ without requiring the source code to be rewritten.")
 (define-public guile-next
   (deprecated-package "guile-next" guile-2.2))
 
+(define (make-guile-readline guile)
+  (package
+    (name "guile-readline")
+    (version (package-version guile))
+    (source (package-source guile))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags '("--disable-silent-rules")
+       #:phases (modify-phases %standard-phases
+                  (add-before 'build 'chdir
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (invoke "make" "-C" "libguile" "scmconfig.h")
+                      (invoke "make" "-C" "lib")
+                      (chdir "guile-readline")
+
+                      (substitute* "Makefile"
+                        (("../libguile/libguile-[[:graph:]]+\\.la")
+                         ;; Remove dependency on libguile-X.Y.la.
+                         "")
+                        (("^READLINE_LIBS = (.*)$" _ libs)
+                         ;; Link against the provided libguile.
+                         (string-append "READLINE_LIBS = "
+                                        "-lguile-$(GUILE_EFFECTIVE_VERSION) "
+                                        libs "\n"))
+                        (("\\$\\(top_builddir\\)/meta/build-env")
+                         ;; Use the provided Guile, not the one from
+                         ;; $(builddir).
+                         "")
+
+                        ;; Install modules to the 'site' directories.
+                        (("^moddir = .*$")
+                         "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
+                        (("^ccachedir = .*$")
+                         "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
+
+                      ;; Load 'guile-readline.so' from the right place.
+                      (substitute* "ice-9/readline.scm"
+                        (("load-extension \"guile-readline\"")
+                         (format #f "load-extension \
+ (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
+                                 (assoc-ref outputs "out"))))
+                      #t)))))
+    (home-page (package-home-page guile))
+    (native-inputs (package-native-inputs guile))
+    (inputs
+     `(,@(package-inputs guile)                   ;to placate 'configure'
+       ,@(package-propagated-inputs guile)
+       ("guile" ,guile)
+       ("readline" ,readline)))
+    (synopsis "Line editing support for GNU Guile")
+    (description
+     "This module provides line editing support via the Readline library for
+GNU <at> tie{}Guile.  Use the @code{(ice-9 readline)} module and call its
+@code{activate-readline} procedure to enable it.")
+    (license license:gpl3+)))
+
+(define-public guile-readline
+  (make-guile-readline guile-2.2))
+
 (define (guile-variant-package-name prefix)
   (lambda (name)
     "Return NAME with PREFIX instead of \"guile-\", when applicable."
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index b66239787..938de8dd4 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -193,10 +193,14 @@ set debug-file-directory ~/.guix-profile/lib/debug\n")))
       (".zlogin" ,zlogin)
       (".Xdefaults" ,xdefaults)
       (".guile" ,(plain-file "dot-guile"
-                             (string-append
-                              "(use-modules (ice-9 readline))\n\n"
-                              ";; Enable completion at the REPL.\n"
-                              "(activate-readline)\n")))
+                             "(cond ((false-if-exception (resolve-interface '(ice-9 readline)))
+       =>
+       (lambda (module)
+         ;; Enable completion and input history at the REPL.
+         ((module-ref module 'activate-readline))))
+      (else
+       (display \"Consider installing the 'guile-readline' package for
+convenient interactive line editing and input history.\\n\\n\")))\n"))
       (".guile-wm" ,guile-wm)
       (".gdbinit" ,gdbinit))))
 
-- 
2.15.0





Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Fri, 08 Dec 2017 17:27:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 08 Dec 2017 17:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 29616-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 29616-done <at> debbugs.gnu.org
Subject: Re: [bug#29616] [PATCH core-updates] gnu: guile: Move Readline
 support to a separate 'guile-readline' package.
Date: Fri, 08 Dec 2017 18:26:22 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> This reduces the closure of Guile from 131 MiB to 116 MiB and removes
> extra readline/ncurses builds from the bootstrap path.
>
> * gnu/packages/guile.scm (guile-2.0)[inputs]: Remove READLINE.
> (make-guile-readline): New procedure.
> (guile-readline): New variable.
> * gnu/system/shadow.scm (default-skeletons): Adjust '.guile' so that it
> gracefully deals with missing (ice-9 readline).

Pushed as 2ba2c98d8aa695cce608313833a36c61b0fb3428 as discussed on IRC.

I’ve also started an evaluation of ‘core-updates’ on Hydra.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Jan 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.