From 5db3a9df5e82a0af45bc20bb2eda15dc7fa290bb Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 23 May 2018 09:36:16 +0200 Subject: Revert "ghc, haskell infra: #40642 direct to master" --- pkgs/development/compilers/ghc/head.nix | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'pkgs/development/compilers/ghc/head.nix') diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index ede25c7679a6..7e1c73d166a2 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -3,7 +3,7 @@ # build-tools , bootPkgs, alex, happy -, autoconf, automake, coreutils, fetchgit, perl, python3, m4 +, autoconf, automake, coreutils, fetchgit, perl, python3 , libffi, libiconv ? null, ncurses @@ -22,15 +22,9 @@ , # Whether to build dynamic libs for the standard library (on the target # platform). Static libs are always built. - enableShared ? !targetPlatform.isWindows && !targetPlatform.useAndroidPrebuilt - -, # Whetherto build terminfo. - enableTerminfo ? !targetPlatform.isWindows + enableShared ? !targetPlatform.useAndroidPrebuilt , version ? "8.5.20180118" -, # What flavour to build. An empty string indicates no - # specific flavour and falls back to ghc default values. - ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" }: assert !enableIntegerSimple -> gmp != null; @@ -44,14 +38,11 @@ let "${targetPlatform.config}-"; buildMK = '' - BuildFlavour = ${ghcFlavour} - ifneq \"\$(BuildFlavour)\" \"\" - include mk/flavours/\$(BuildFlavour).mk - endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} '' + stdenv.lib.optionalString enableIntegerSimple '' INTEGER_LIBRARY = integer-simple '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross Stage1Only = YES HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO @@ -64,9 +55,9 @@ let ''; # Splicer will pull out correct variations - libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] + libDeps = platform: [ ncurses ] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; toolsForTarget = if hostPlatform == buildPlatform then @@ -132,7 +123,7 @@ stdenv.mkDerivation rec { "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ "--enable-bootstrap-with-devel-snapshot" @@ -150,10 +141,7 @@ stdenv.mkDerivation rec { # masss-rebuild. crossConfig = true; - nativeBuildInputs = [ - perl autoconf automake m4 python3 - ghc alex happy - ]; + nativeBuildInputs = [ ghc perl autoconf automake happy alex python3 ]; # For building runtime libs depsBuildTarget = toolsForTarget; @@ -175,7 +163,7 @@ stdenv.mkDerivation rec { # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't # treat that as a unary `{x,y,z,..}` repetition. postInstall = '' - paxmark m $out/lib/${name}/bin/* + paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"} # Install the bash completion file. install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc -- cgit 1.4.1