From unknown Sun Jun 22 08:12:11 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#29616] [PATCH core-updates] gnu: guile: Move Readline support to a separate 'guile-readline' package. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Dec 2017 16:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 29616@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151275098912793 (code B ref -1); Fri, 08 Dec 2017 16:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Dec 2017 16:36:29 +0000 Received: from localhost ([127.0.0.1]:52749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNLdV-0003KH-IG for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNLdU-0003K4-C4 for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNLdO-00026I-4K for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNLdO-000267-0E for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLdM-0000xo-Jl for guix-patches@gnu.org; Fri, 08 Dec 2017 11:36:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNLdL-00025Q-Ls for guix-patches@gnu.org; Fri, 08 Dec 2017 11:36:20 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLdG-00020S-F7; Fri, 08 Dec 2017 11:36:14 -0500 Received: from [193.50.110.104] (port=54556 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNLdG-0005ip-0E; Fri, 08 Dec 2017 11:36:14 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 8 Dec 2017 17:35:53 +0100 Message-Id: <20171208163553.9406-1-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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@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 From unknown Sun Jun 22 08:12:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#29616: closed (Re: [bug#29616] [PATCH core-updates] gnu: guile: Move Readline support to a separate 'guile-readline' package.) Message-ID: References: <874lp1w2pt.fsf@gnu.org> <20171208163553.9406-1-ludo@gnu.org> X-Gnu-PR-Message: they-closed 29616 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 29616@debbugs.gnu.org Date: Fri, 08 Dec 2017 17:27:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1512754022-17053-1" This is a multi-part message in MIME format... ------------=_1512754022-17053-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #29616: [PATCH core-updates] gnu: guile: Move Readline support to a separat= e 'guile-readline' package. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 29616@debbugs.gnu.org. --=20 29616: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29616 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1512754022-17053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 29616-done) by debbugs.gnu.org; 8 Dec 2017 17:26:26 +0000 Received: from localhost ([127.0.0.1]:52766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNMPq-0004QG-Fq for submit@debbugs.gnu.org; Fri, 08 Dec 2017 12:26:26 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:57528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNMPo-0004Q8-Md for 29616-done@debbugs.gnu.org; Fri, 08 Dec 2017 12:26:25 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id DF9F4F85A for <29616-done@debbugs.gnu.org>; Fri, 8 Dec 2017 18:26:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zdnxteiP-GU8 for <29616-done@debbugs.gnu.org>; Fri, 8 Dec 2017 18:26:26 +0100 (CET) Received: from ribbon (unknown [193.50.110.104]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1103DF850 for <29616-done@debbugs.gnu.org>; Fri, 8 Dec 2017 18:26:26 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 29616-done@debbugs.gnu.org Subject: Re: [bug#29616] [PATCH core-updates] gnu: guile: Move Readline support to a separate 'guile-readline' package. References: <20171208163553.9406-1-ludo@gnu.org> Date: Fri, 08 Dec 2017 18:26:22 +0100 In-Reply-To: <20171208163553.9406-1-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cour\?\= \=\?utf-8\?Q\?t\=C3\=A8s\=22's\?\= message of "Fri, 8 Dec 2017 17:35:53 +0100") Message-ID: <874lp1w2pt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29616-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Ludovic Court=C3=A8s 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=E2=80=99ve also started an evaluation of =E2=80=98core-updates=E2=80=99 o= n Hydra. Ludo=E2=80=99. ------------=_1512754022-17053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Dec 2017 16:36:29 +0000 Received: from localhost ([127.0.0.1]:52749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNLdV-0003KH-IG for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNLdU-0003K4-C4 for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNLdO-00026I-4K for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNLdO-000267-0E for submit@debbugs.gnu.org; Fri, 08 Dec 2017 11:36:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLdM-0000xo-Jl for guix-patches@gnu.org; Fri, 08 Dec 2017 11:36:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNLdL-00025Q-Ls for guix-patches@gnu.org; Fri, 08 Dec 2017 11:36:20 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLdG-00020S-F7; Fri, 08 Dec 2017 11:36:14 -0500 Received: from [193.50.110.104] (port=54556 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNLdG-0005ip-0E; Fri, 08 Dec 2017 11:36:14 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@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 Message-Id: <20171208163553.9406-1-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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@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 ------------=_1512754022-17053-1--