From d3ac5c534de18caa487ab3ee341f24a452027294 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sun, 9 Aug 2015 15:17:58 +0200 Subject: [PATCH] ghc: patch start scripts to add 'readelf' and 'cat' into $PATH Fixes https://github.com/NixOS/nixpkgs/issues/8192. --- pkgs/development/compilers/ghc/7.10.2.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ghc/7.10.2.nix b/pkgs/development/compilers/ghc/7.10.2.nix index f71cd922c10d..064610c3557b 100644 --- a/pkgs/development/compilers/ghc/7.10.2.nix +++ b/pkgs/development/compilers/ghc/7.10.2.nix @@ -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";