ghc: patch start scripts to add 'readelf' and 'cat' into $PATH

Fixes https://github.com/NixOS/nixpkgs/issues/8192.
This commit is contained in:
Peter Simons 2015-08-09 15:17:58 +02:00
parent 6aa5502129
commit d3ac5c534d

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, fetchpatch, ghc, perl, gmp, ncurses, libiconv, binutils, coreutils }:
let
@ -46,6 +46,15 @@ stdenv.mkDerivation rec {
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
postInstall = ''
# Patch scripts to include "readelf" and "cat" in $PATH.
for i in "$out/bin/"*; do
test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${binutils}/bin:${coreutils}/bin"' $i
done
'';
meta = {
homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler";