From feddc16c70d8271425563ceea9ca59c274279d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 2 Jan 2013 23:12:27 +0100 Subject: [PATCH] distro: ncurses: Don't retain a reference to the bootstrap Bash. * distro/packages/ncurses.scm (ncurses): Remove #:patch-shebangs? argument since it now has no effect. Simplify PATCH-MAKEFILE-PHASE. Add `configure-phase', and use it. --- distro/packages/ncurses.scm | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/distro/packages/ncurses.scm b/distro/packages/ncurses.scm index 8bde3c1989..62f957ef13 100644 --- a/distro/packages/ncurses.scm +++ b/distro/packages/ncurses.scm @@ -1,5 +1,5 @@ ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*- -;;; Copyright (C) 2012 Ludovic Courtès +;;; Copyright (C) 2012, 2013 Ludovic Courtès ;;; ;;; This file is part of Guix. ;;; @@ -26,8 +26,23 @@ (define-module (distro packages ncurses) (define-public ncurses (let ((patch-makefile-phase '(lambda _ - (substitute* (find-files "." "Makefile.in") - (("^SHELL[[:blank:]]*=.*$") "")))) + (for-each patch-makefile-SHELL + (find-files "." "Makefile.in")))) + (configure-phase + '(lambda* (#:key inputs outputs configure-flags + #:allow-other-keys) + ;; The `ncursesw5-config' has a #!/bin/sh. We want to patch + ;; it to point to libc's embedded Bash, to avoid retaining a + ;; reference to the bootstrap Bash. + (let* ((libc (assoc-ref inputs "libc")) + (bash (string-append libc "/bin/bash")) + (out (assoc-ref outputs "out"))) + (format #t "configure flags: ~s~%" configure-flags) + (zero? (apply system* bash "./configure" + (string-append "SHELL=" bash) + (string-append "CONFIG_SHELL=" bash) + (string-append "--prefix=" out) + configure-flags))))) (post-install-phase '(lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -90,11 +105,10 @@ (define lib.so (alist-cons-before 'configure 'patch-makefile-SHELL ,patch-makefile-phase - %standard-phases)) - - ;; The `ncursesw5-config' has a #!/bin/sh that we don't want to - ;; patch, to avoid retaining a reference to the build-time Bash. - #:patch-shebangs? #f)) + (alist-replace + 'configure + ,configure-phase + %standard-phases))))) ((system cross-system) (arguments cross-system)))) (self-native-input? #t)