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.
This commit is contained in:
		
							parent
							
								
									c20313637f
								
							
						
					
					
						commit
						530c169561
					
				
					 2 changed files with 71 additions and 49 deletions
				
			
		|  | @ -32,7 +32,20 @@ | ||||||
|                                  "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'" |                                  "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'" | ||||||
|                                  "-DNON_INTERACTIVE_LOGIN_SHELLS" |                                  "-DNON_INTERACTIVE_LOGIN_SHELLS" | ||||||
|                                  "-DSSH_SOURCE_BASHRC") |                                  "-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 |     (package | ||||||
|      (name "bash") |      (name "bash") | ||||||
|      (version "4.2") |      (version "4.2") | ||||||
|  | @ -67,15 +80,12 @@ | ||||||
|         ;; for now. |         ;; for now. | ||||||
|         #:tests? #f |         #:tests? #f | ||||||
| 
 | 
 | ||||||
|         #:phases |         #:phases (alist-cons-before | ||||||
|  |                   'configure 'pre-configure | ||||||
|  |                   ,pre-configure-phase | ||||||
|                   (alist-cons-after 'install 'post-install |                   (alist-cons-after 'install 'post-install | ||||||
|                           (lambda* (#:key outputs #:allow-other-keys) |                                     ,post-install-phase | ||||||
|                             ;; Add a `bash' -> `sh' link. |                                     %standard-phases)))) | ||||||
|                             (let ((out (assoc-ref outputs "out"))) |  | ||||||
|                               (with-directory-excursion |  | ||||||
|                                   (string-append out "/bin") |  | ||||||
|                                 (symlink "bash" "sh")))) |  | ||||||
|                           %standard-phases))) |  | ||||||
|      (synopsis "GNU Bourne-Again Shell") |      (synopsis "GNU Bourne-Again Shell") | ||||||
|      (description |      (description | ||||||
|       "Bash is the shell, or command language interpreter, that will appear in |       "Bash is the shell, or command language interpreter, that will appear in | ||||||
|  |  | ||||||
|  | @ -26,6 +26,24 @@ | ||||||
|   #:use-module (guix build-system gnu)) |   #:use-module (guix build-system gnu)) | ||||||
| 
 | 
 | ||||||
| (define-public readline | (define-public readline | ||||||
|  |   (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 |     (package | ||||||
|       (name "readline") |       (name "readline") | ||||||
|       (version "6.2") |       (version "6.2") | ||||||
|  | @ -50,17 +68,11 @@ | ||||||
| 
 | 
 | ||||||
|                    #:phases (alist-cons-after |                    #:phases (alist-cons-after | ||||||
|                              'install 'post-install |                              'install 'post-install | ||||||
|                           (lambda* (#:key outputs #:allow-other-keys) |                              ,post-install-phase | ||||||
|                             (let* ((out (assoc-ref outputs "out")) |                              (alist-cons-before | ||||||
|                                    (lib (string-append out "/lib"))) |                               'configure 'pre-configure | ||||||
|                               ;; Make libraries writable so that `strip' can |                               ,pre-configure-phase | ||||||
|                               ;; work.  Failing to do that, it bails out with |                               %standard-phases)))) | ||||||
|                               ;; "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") |       (synopsis "GNU Readline, a library for interactive line editing") | ||||||
|       (description |       (description | ||||||
|        "The GNU Readline library provides a set of functions for use by |        "The GNU Readline library provides a set of functions for use by | ||||||
|  | @ -74,4 +86,4 @@ 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 | library, as part of the build process.  The History library may be used | ||||||
| without Readline in applications which desire its capabilities.") | without Readline in applications which desire its capabilities.") | ||||||
|       (license gpl3+) |       (license gpl3+) | ||||||
|    (home-page "http://savannah.gnu.org/projects/readline/"))) |       (home-page "http://savannah.gnu.org/projects/readline/")))) | ||||||
|  |  | ||||||
		Reference in a new issue