From eae27e77980bcbe4f7bcec1b2aec517d29f9630c Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 16 Dec 2015 18:32:54 +0100 Subject: ghc: update version 7.10.3 to 7.10.3a Apply upstream patches that fix minor cosmetic issues in the documentation. --- pkgs/development/compilers/ghc/7.10.3.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index 32d6b72970cb..ce6db9127d68 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -15,6 +15,11 @@ let ''} ''; + docFixes = fetchurl { + url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch"; + sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0"; + }; + in stdenv.mkDerivation rec { @@ -26,6 +31,10 @@ stdenv.mkDerivation rec { sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g"; }; + patches = [ + docFixes + ]; + buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ]; enableParallelBuilding = true; -- cgit 1.4.1 From a421e7bd4a28c69bded8b17888325e31554f61a1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 15 Dec 2015 22:09:37 +0100 Subject: ghc-7.10.3: don't pass compiler or linker flags through a response file The new GHC version contains a patch [1] that passes linker and compiler flags to GCC via response files rather than directly on the command-line. This is supposed to be beneficial on Windows and other platforms that have trouble dealing with long argument lists. On NixOS, however, this feature breaks the flag handling provided by gcc-wrapper [2] and therefore causes the entire GHC build to fail. This issue has been reported upstream at [3]. It's not clear yet how to remedy this problem, but until we've figured that out we just don't pass compiler flags in response files on NixOS to fix https://github.com/NixOS/nixpkgs/issues/10752. [1] https://github.com/ghc/ghc/commit/296bc70b5ff6c853f2782e9ec5aa47a52110345e [2] https://github.com/NixOS/nixpkgs/issues/11762 [3] https://ghc.haskell.org/trac/ghc/ticket/11147 --- pkgs/development/compilers/ghc/7.10.3.nix | 1 + ...dont-pass-linker-flags-via-response-files.patch | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index ce6db9127d68..f9f863ca78cf 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -33,6 +33,7 @@ stdenv.mkDerivation rec { patches = [ docFixes + ./dont-pass-linker-flags-via-response-files.patch # https://github.com/NixOS/nixpkgs/issues/10752 ]; buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ]; diff --git a/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch b/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch new file mode 100644 index 000000000000..129a34ecd86e --- /dev/null +++ b/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch @@ -0,0 +1,22 @@ +diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs +index 8c3ab1a..47a2da7 100644 +--- a/compiler/main/SysTools.hs ++++ b/compiler/main/SysTools.hs +@@ -414,7 +414,7 @@ runCc dflags args = do + args1 = map Option (getOpts dflags opt_c) + args2 = args0 ++ args1 ++ args + mb_env <- getGccEnv args2 +- runSomethingResponseFile dflags cc_filter "C Compiler" p args2 mb_env ++ runSomethingFiltered dflags cc_filter "C Compiler" p args2 mb_env + where + -- discard some harmless warnings from gcc that we can't turn off + cc_filter = unlines . doFilter . lines +@@ -928,7 +928,7 @@ runLink dflags args = do + args1 = map Option (getOpts dflags opt_l) + args2 = args0 ++ linkargs ++ args1 ++ args + mb_env <- getGccEnv args2 +- runSomethingResponseFile dflags ld_filter "Linker" p args2 mb_env ++ runSomethingFiltered dflags ld_filter "Linker" p args2 mb_env + where + ld_filter = case (platformOS (targetPlatform dflags)) of + OSSolaris2 -> sunos_ld_filter -- cgit 1.4.1 From 878692e645d6c7ecc1e26b785b413797b6931b1a Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 16 Dec 2015 16:54:14 +0100 Subject: ghc-7.10.3: remove the obsolete build.mk file New versions of GHC allow us to specify those things on the command-line, so the build.mk file is no longer necessary. --- pkgs/development/compilers/ghc/7.10.3.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index f9f863ca78cf..88d1bec4d42b 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -4,17 +4,6 @@ let - buildMK = '' - libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib" - libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses}/lib" - ${stdenv.lib.optionalString stdenv.isDarwin '' - libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include" - libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" - ''} - ''; - docFixes = fetchurl { url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch"; sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0"; @@ -41,7 +30,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; preConfigure = '' - echo >mk/build.mk "${buildMK}" sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" @@ -52,6 +40,9 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-gcc=${stdenv.cc}/bin/cc" "--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib" + "--with-curses-includes=${ncurses}/include" "--with-curses-libraries=${ncurses}/lib" + ] ++ stdenv.lib.optional stdenv.isDarwin [ + "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ]; # required, because otherwise all symbols from HSffi.o are stripped, and -- cgit 1.4.1 From 1f108490f13020b114f5872b74282ed3ac44eac0 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 16 Dec 2015 19:18:29 +0100 Subject: ghc-HEAD: update build instructions and bump version to current Git master Closes https://github.com/NixOS/nixpkgs/issues/10752. --- pkgs/development/compilers/ghc/head.nix | 52 ++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index fe0d0b37371e..9b360b609e43 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -1,32 +1,22 @@ -{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }: - -let - - buildMK = '' - libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib" - libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses}/lib" - DYNAMIC_BY_DEFAULT = NO - ${stdenv.lib.optionalString stdenv.isDarwin '' - libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include" - libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" - ''} - ''; - -in +{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, binutils, coreutils +, autoconf, automake, happy, alex +}: stdenv.mkDerivation rec { - version = "7.11.20150828"; + version = "7.11.20151216"; name = "ghc-${version}"; - rev = "38c98e4f61a48084995a5347d76ddd024ce1a09c"; + rev = "28638dfe79e915f33d75a1b22c5adce9e2b62b97"; src = fetchgit { url = "git://git.haskell.org/ghc.git"; inherit rev; - sha256 = "0wnxrfzjpjcmsmd2i0zg30jg7zpw1rrfwz8r56g314l7xcns6yp1"; + sha256 = "0rjzkzn0hz1vdnjikcbwfs5ggs8r3y4gqxfdn4jzfp45gx94wiwv"; }; + patches = [ + ./dont-pass-linker-flags-via-response-files.patch # https://github.com/NixOS/nixpkgs/issues/10752 + ]; + postUnpack = '' pushd ghc-${builtins.substring 0 7 rev} echo ${version} >VERSION @@ -38,24 +28,40 @@ stdenv.mkDerivation rec { buildInputs = [ ghc perl autoconf automake happy alex ]; + enableParallelBuilding = true; + preConfigure = '' - echo >mk/build.mk "${buildMK}" sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + '' + stdenv.lib.optionalString stdenv.isDarwin '' + export NIX_LDFLAGS+=" -no_dtrace_dof" ''; configureFlags = [ "--with-gcc=${stdenv.cc}/bin/cc" "--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib" + "--with-curses-includes=${ncurses}/include" "--with-curses-libraries=${ncurses}/lib" + ] ++ stdenv.lib.optional stdenv.isDarwin [ + "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ]; - enableParallelBuilding = true; - # required, because otherwise all symbols from HSffi.o are stripped, and # that in turn causes GHCi to abort stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; + postInstall = '' + # Install the bash completion file. + install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc + + # 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"; -- cgit 1.4.1