diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2015-12-31 09:47:26 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2015-12-31 09:53:02 +0100 |
commit | f9f6f41bff2213e199bded515e9b66d1e5c4d7dd (patch) | |
tree | 29c5a75228e31f305f42c5b761709a186e406776 /pkgs/development/compilers/ghc | |
parent | bbcf127c7c9029cba43493d7d25a9d1c65d59152 (diff) | |
parent | 468f698f609e123bb0ffae67181d07ac99eb2204 (diff) | |
download | nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.gz nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.bz2 nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.lz nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.xz nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.zst nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.zip |
Merge branch 'master' into closure-size
TODO: there was more significant refactoring of qtbase and plasma 5.5 on master, and I'm deferring pointing to correct outputs to later.
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r-- | pkgs/development/compilers/ghc/7.10.3.nix | 23 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch | 22 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 52 |
3 files changed, 63 insertions, 34 deletions
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index 32d6b72970cb..88d1bec4d42b 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -4,16 +4,10 @@ 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"; + }; in @@ -26,12 +20,16 @@ stdenv.mkDerivation rec { sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g"; }; + 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 ]; 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}" @@ -42,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 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 diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 43c32538b1a6..8b6c371537bc 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.out}/lib" - libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include" - libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.lib}/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.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" + "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.lib}/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"; |