I'm trying to package a binary version of GHC (attached), which fails
with the following error:

/nix/store/snrdydzbrw9aqnz569k73dmk67wn1akv-my-coreutils-8.20/bin/install -c -m 
755 -d 
"/nix/store/gy7g3k7bwpaf7pvm70d0rn8xh8b7rq6h-ghc-bin-7.0.1/lib/ghc-7.0.1/package.conf.d"
"/nix/store/gy7g3k7bwpaf7pvm70d0rn8xh8b7rq6h-ghc-bin-7.0.1/lib/ghc-7.0.1/ghc-pkg"
 --force --global-conf 
"/nix/store/gy7g3k7bwpaf7pvm70d0rn8xh8b7rq6h-ghc-bin-7.0.1/lib/ghc-7.0.1/package.conf.d"
 update libffi/package.conf.install
/nix/store/zkg7nnj03yp6pg9gx8wq3lpalr4ffw71-bash-4.2/bin/sh: 
/nix/store/gy7g3k7bwpaf7pvm70d0rn8xh8b7rq6h-ghc-bin-7.0.1/lib/ghc-7.0.1/ghc-pkg:
 No such file or directory
make[1]: *** [install_packages] Error 127
make: *** [install] Error 2
phase `install' failed after 2 seconds
note: keeping build directory `/tmp/nix-build-ghc-bin-7.0.1.drv-16'
builder for `/nix/store/8ifycdgaisy3n6xsxkm05cklcmra40yw-ghc-bin-7.0.1.drv' 
failed with exit code 1
@ build-failed /nix/store/8ifycdgaisy3n6xsxkm05cklcmra40yw-ghc-bin-7.0.1.drv - 
1 builder for `/nix/store/8ifycdgaisy3n6xsxkm05cklcmra40yw-ghc-bin-7.0.1.drv' 
failed with exit code 1
guix build: error: build failed: build of 
`/nix/store/8ifycdgaisy3n6xsxkm05cklcmra40yw-ghc-bin-7.0.1.drv' failed

I'm not sure what causes the problem.  I don't see anything strange in
makefiles.  Should I patch executables?  Here is a relevant snippet from
'6.12.1-binary.nix':

    (if stdenv.isLinux then ''
      find . -type f -perm +100 \
          -exec patchelf --interpreter "$(cat 
$NIX_GCC/nix-support/dynamic-linker)" \
          --set-rpath "${ncurses}/lib:${gmp}/lib" {} \;
      sed -i "s|/usr/bin/perl|perl\x00        |" 
ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
      sed -i "s|/usr/bin/gcc|gcc\x00        |" 
ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
      for prog in ld ar gcc strip ranlib; do
        find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p 
$prog)@g" {} \;
      done
     '' else "");

What do you think?

P.S. I'm using a previous version of 'coreutils' (i.e., 'my-coreutils'),
which should be removed from the recipe.

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages ghc)
  #:use-module ((guix licenses) #:select (bsd-style))
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages my-coreutils) ; XXX: use 'base.scm'
  #:use-module (gnu packages perl))

(define-public ghc-7.0.1-bin
  (package
    (name "ghc-bin")
    ;; This package can be used for the following versions: 7.0.2--7.6.3.
    (version "7.0.1")
    (source
     (origin
      (method url-fetch)
      ;; XXX: Support other platforms.
      (uri (string-append "http://www.haskell.org/ghc/dist/";
                          version "/ghc-" version
                          "-i386-unknown-linux.tar.bz2"))
      (sha256
       (base32
        "1cc9ih3h804gj53vf1xabg4155m6bz5r468mjsv54kckmabgsmav"))))
    (build-system gnu-build-system)
    (arguments
     `(#:modules ((guix build gnu-build-system)
                  (guix build utils)
                  (srfi srfi-1))
       #:phases (alist-cons-before
                 'configure 'pre-configure
                 (lambda _
                   (begin (substitute* '("configure"
                                         "mk/config.mk.in"
                                         "inplace/bin/mkdirhier"
                                         "utils/ghc-pkg/ghc.mk")
                            (("/bin/sh") (which "sh"))
                            (("/usr/local/bin/bash") (which "sh")))
                          (copy-file (which "pwd") "utils/ghc-pwd/ghc-pwd")))
                 (alist-delete 'build %standard-phases))
       #:tests? #f))
    (inputs
     `(("coreutils" ,my-coreutils)
       ("perl" ,perl)))
    (home-page "http://www.haskell.org/ghc/";)
    (synopsis "Haskell compiler and interactive environment")
    (description
     "This is a binary distribution of GHC, a compiler and interactive
environment for the Haskell functional programming language.")
    (license (bsd-style "file://LICENSE"
                        "See LICENSE in the distribution."))))

Attachment: pgpUCPDrIFCzK.pgp
Description: PGP signature

Reply via email to