summary refs log tree commit diff
path: root/distro
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-20 18:02:07 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-20 18:02:07 +0100
commit530c169561b366d60457e499f7eb198929ffa917 (patch)
tree8eddadfa1708a7a49c6265d6d8253d86f2609a08 /distro
parentc20313637f1676a50c009db6da60d97a93467f2f (diff)
downloadguix-530c169561b366d60457e499f7eb198929ffa917.tar.gz
distro: bash, readline: Patch so that `make' uses the right shell.
* distro/packages/readline.scm (readline): Add `pre-configure-phase' to
  patch `MAKE_SHELL' in `configure.  Move `post-install-phase' body to
  a variable.
* distro/packages/bash.scm (bash): Likewise.
Diffstat (limited to 'distro')
-rw-r--r--distro/packages/bash.scm30
-rw-r--r--distro/packages/readline.scm90
2 files changed, 71 insertions, 49 deletions
diff --git a/distro/packages/bash.scm b/distro/packages/bash.scm
index 944bd077a3..c2022fcf95 100644
--- a/distro/packages/bash.scm
+++ b/distro/packages/bash.scm
@@ -32,7 +32,20 @@
                                  "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
                                  "-DNON_INTERACTIVE_LOGIN_SHELLS"
                                  "-DSSH_SOURCE_BASHRC")
-                               " ")))
+                               " "))
+        (pre-configure-phase
+         '(lambda* (#:key inputs #:allow-other-keys)
+            ;; Use the right shell for makefiles.
+            (let ((bash (assoc-ref inputs "bash")))
+              (substitute* "configure"
+                (("MAKE_SHELL=[^ ]+")
+                 (format #f "MAKE_SHELL=~a/bin/bash" bash))))))
+        (post-install-phase
+         '(lambda* (#:key outputs #:allow-other-keys)
+            ;; Add a `bash' -> `sh' link.
+            (let ((out (assoc-ref outputs "out")))
+              (with-directory-excursion (string-append out "/bin")
+                (symlink "bash" "sh"))))))
     (package
      (name "bash")
      (version "4.2")
@@ -67,15 +80,12 @@
         ;; for now.
         #:tests? #f
 
-        #:phases
-        (alist-cons-after 'install 'post-install
-                          (lambda* (#:key outputs #:allow-other-keys)
-                            ;; Add a `bash' -> `sh' link.
-                            (let ((out (assoc-ref outputs "out")))
-                              (with-directory-excursion
-                                  (string-append out "/bin")
-                                (symlink "bash" "sh"))))
-                          %standard-phases)))
+        #:phases (alist-cons-before
+                  'configure 'pre-configure
+                  ,pre-configure-phase
+                  (alist-cons-after 'install 'post-install
+                                    ,post-install-phase
+                                    %standard-phases))))
      (synopsis "GNU Bourne-Again Shell")
      (description
       "Bash is the shell, or command language interpreter, that will appear in
diff --git a/distro/packages/readline.scm b/distro/packages/readline.scm
index d474198c17..bf542e90b5 100644
--- a/distro/packages/readline.scm
+++ b/distro/packages/readline.scm
@@ -26,44 +26,56 @@
   #:use-module (guix build-system gnu))
 
 (define-public readline
-  (package
-   (name "readline")
-   (version "6.2")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append "mirror://gnu/readline/readline-"
-                                version ".tar.gz"))
-            (sha256
-             (base32
-              "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
-   (build-system gnu-build-system)
-   (propagated-inputs `(("ncurses" ,ncurses)))
-   (inputs `(("patch/link-ncurses"
-              ,(search-patch "readline-link-ncurses.patch"))))
-   (arguments `(#:patches (list (assoc-ref %build-inputs
-                                           "patch/link-ncurses"))
-                #:patch-flags '("-p0")
-                #:configure-flags
-                (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
-                                     (assoc-ref %build-inputs "ncurses")
-                                     "/lib"))
+  (let ((post-install-phase
+         '(lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (lib (string-append out "/lib")))
+              ;; Make libraries writable so that `strip' can work.
+              ;; Failing to do that, it bails out with "Permission
+              ;; denied".
+              (for-each (lambda (f) (chmod f #o755))
+                        (find-files lib "\\.so"))
+              (for-each (lambda (f) (chmod f #o644))
+                        (find-files lib "\\.a")))))
+        (pre-configure-phase
+         '(lambda* (#:key inputs #:allow-other-keys)
+            ;; Use the right shell for makefiles.
+            (let ((bash (assoc-ref inputs "bash")))
+              (substitute* "configure"
+                (("^MAKE_SHELL=.*")
+                 (format #f "MAKE_SHELL=~a/bin/bash" bash)))))))
+    (package
+      (name "readline")
+      (version "6.2")
+      (source (origin
+               (method url-fetch)
+               (uri (string-append "mirror://gnu/readline/readline-"
+                                   version ".tar.gz"))
+               (sha256
+                (base32
+                 "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
+      (build-system gnu-build-system)
+      (propagated-inputs `(("ncurses" ,ncurses)))
+      (inputs `(("patch/link-ncurses"
+                 ,(search-patch "readline-link-ncurses.patch"))))
+      (arguments `(#:patches (list (assoc-ref %build-inputs
+                                              "patch/link-ncurses"))
+                   #:patch-flags '("-p0")
+                   #:configure-flags
+                   (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
+                                        (assoc-ref %build-inputs "ncurses")
+                                        "/lib"))
 
-                #:phases (alist-cons-after
-                          'install 'post-install
-                          (lambda* (#:key outputs #:allow-other-keys)
-                            (let* ((out (assoc-ref outputs "out"))
-                                   (lib (string-append out "/lib")))
-                              ;; Make libraries writable so that `strip' can
-                              ;; work.  Failing to do that, it bails out with
-                              ;; "Permission denied".
-                              (for-each (lambda (f) (chmod f #o755))
-                                        (find-files lib "\\.so"))
-                              (for-each (lambda (f) (chmod f #o644))
-                                        (find-files lib "\\.a"))))
-                          %standard-phases)))
-   (synopsis "GNU Readline, a library for interactive line editing")
-   (description
-    "The GNU Readline library provides a set of functions for use by
+                   #:phases (alist-cons-after
+                             'install 'post-install
+                             ,post-install-phase
+                             (alist-cons-before
+                              'configure 'pre-configure
+                              ,pre-configure-phase
+                              %standard-phases))))
+      (synopsis "GNU Readline, a library for interactive line editing")
+      (description
+       "The GNU Readline library provides a set of functions for use by
 applications that allow users to edit command lines as they are typed in.
 Both Emacs and vi editing modes are available.  The Readline library includes
 additional functions to maintain a list of previously-entered command lines,
@@ -73,5 +85,5 @@ expansion on previous commands.
 The history facilites are also placed into a separate library, the History
 library, as part of the build process.  The History library may be used
 without Readline in applications which desire its capabilities.")
-   (license gpl3+)
-   (home-page "http://savannah.gnu.org/projects/readline/")))
+      (license gpl3+)
+      (home-page "http://savannah.gnu.org/projects/readline/"))))