[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ghc-pkg: No such file or directory
From: |
Ludovic Courtès |
Subject: |
Re: ghc-pkg: No such file or directory |
Date: |
Mon, 24 Jun 2013 17:36:49 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
Nikita Karetnikov <address@hidden> skribis:
> 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
Most likely that’s because of the ELF interpreter, which needs to be
patched.
Try ‘strings .../ghc-pkg | grep ld-linux’, and notice how the file name
is wrong.
PatchELF allows you to fix that.
> 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" {} \;
This part is what I’m referring to.
> 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/address@hidden(type -p $prog)@g" {} \;
> done
> '' else "");
You may need to port these tricks as well. :-)
HTH,
Ludo’.