git.iko.soy/typeable/nixpkgs
on master help sign in
ghc821: init at 8.2.1-rc2 (a.k.a., 8.2.0.20170507)

The approach taken to add this package was to port over the definitions currently existing for HEAD, and making the necessesary changes to get this building. The Haskell package set associated with this compiler doesn't yet guarantee that all or most of the packages successfully build with this new compiler, but that will improve over time after this GHC 8.2.1 is officially released and the ecosystem catches up.

commit5f94d85e5eb33136b1fe3081fe448351347b8d26 authorRenzo Carbonara <gnuk0001@gmail.com> dateThu 15 Jun 2017, 18:22 (9 years ago) parent19f8213
3 files changed+192
pkgs/development/compilers/ghc/8.2.1.nix+117 pkgs/development/haskell-modules/configuration-ghc-8.2.x.nix+60 pkgs/top-level/haskell-packages.nix+15
pkgs/development/compilers/ghc/8.2.1.nixnew file+117
@@ -0,0 +1,117 @@
1+{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+, autoconf, automake, happy, alex, python3, sphinx, hscolour
3+, buildPlatform, targetPlatform , selfPkgs, cross ? null
4+
5+ # If enabled GHC will be build with the GPL-free but slower integer-simple
6+ # library instead of the faster but GPLed integer-gmp library.
7+, enableIntegerSimple ? false, gmp
8+}:
9+
10+let
11+ inherit (bootPkgs) ghc;
12+ version = "8.2.1-rc2";
13+ preReleaseName = "ghc-8.2.0.20170507";
14+ commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
15+ commonPreConfigure = ''
16+ sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
17+ '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
18+ export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/${preReleaseName}"
19+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
20+ export NIX_LDFLAGS+=" -no_dtrace_dof"
21+ '' + stdenv.lib.optionalString enableIntegerSimple ''
22+ echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
23+ '';
24+in stdenv.mkDerivation (rec {
25+ inherit version;
26+ name = "ghc-${version}";
27+
28+ src = fetchurl {
29+ url = "https://downloads.haskell.org/~ghc/${version}/${preReleaseName}-src.tar.xz";
30+ sha256 = "1hy3l6nzkyhzwy9mii4zs51jv048zwvdqk1q3188jznz35392zrn";
31+ };
32+
33+ postPatch = "patchShebangs .";
34+
35+ preConfigure = commonPreConfigure;
36+
37+ buildInputs = commonBuildInputs;
38+
39+ enableParallelBuilding = true;
40+
41+ configureFlags = [
42+ "CC=${stdenv.cc}/bin/cc"
43+ "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
44+ "--datadir=$doc/share/doc/ghc"
45+ ] ++ stdenv.lib.optional (! enableIntegerSimple) [
46+ "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
47+ ] ++ stdenv.lib.optional stdenv.isDarwin [
48+ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
49+ ];
50+
51+ # required, because otherwise all symbols from HSffi.o are stripped, and
52+ # that in turn causes GHCi to abort
53+ stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
54+
55+ checkTarget = "test";
56+
57+ postInstall = ''
58+ paxmark m $out/lib/${preReleaseName}/bin/{ghc,haddock}
59+
60+ # Install the bash completion file.
61+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
62+
63+ # Patch scripts to include "readelf" and "cat" in $PATH.
64+ for i in "$out/bin/"*; do
65+ test ! -h $i || continue
66+ egrep --quiet '^#!' <(head -n 1 $i) || continue
67+ sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
68+ done
69+ '';
70+
71+ outputs = [ "out" "doc" ];
72+
73+ passthru = {
74+ inherit bootPkgs;
75+ } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
76+ crossCompiler = selfPkgs.ghc.override {
77+ cross = targetPlatform;
78+ bootPkgs = selfPkgs;
79+ };
80+ };
81+
82+ meta = {
83+ homepage = "http://haskell.org/ghc";
84+ description = "The Glasgow Haskell Compiler";
85+ maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
86+ inherit (ghc.meta) license platforms;
87+ };
88+
89+} // stdenv.lib.optionalAttrs (cross != null) {
90+ name = "${cross.config}-ghc-${version}";
91+
92+ preConfigure = commonPreConfigure + ''
93+ sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk
94+ '';
95+
96+ configureFlags = [
97+ "CC=${stdenv.ccCross}/bin/${cross.config}-cc"
98+ "LD=${stdenv.binutils}/bin/${cross.config}-ld"
99+ "AR=${stdenv.binutils}/bin/${cross.config}-ar"
100+ "NM=${stdenv.binutils}/bin/${cross.config}-nm"
101+ "RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib"
102+ "--target=${cross.config}"
103+ "--enable-bootstrap-with-devel-snapshot"
104+ ] ++
105+ # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
106+ lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
107+
108+ buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
109+
110+ dontSetConfigureCross = true;
111+
112+ passthru = {
113+ inherit bootPkgs cross;
114+ cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
115+ ld = "${stdenv.binutils}/bin/${cross.config}-ld";
116+ };
117+})
pkgs/development/haskell-modules/configuration-ghc-8.2.x.nixnew file+60
@@ -0,0 +1,60 @@
1+{ pkgs }:
2+
3+with import ./lib.nix { inherit pkgs; };
4+
5+self: super: {
6+
7+ # Suitable LLVM version.
8+ llvmPackages = pkgs.llvmPackages_39;
9+
10+ # Disable GHC 8.2.x core libraries.
11+ array = null;
12+ base = null;
13+ binary = null;
14+ bytestring = null;
15+ Cabal = null;
16+ containers = null;
17+ deepseq = null;
18+ directory = null;
19+ filepath = null;
20+ ghc-boot = null;
21+ ghc-boot-th = null;
22+ ghc-compact = null;
23+ ghc-prim = null;
24+ ghci = null;
25+ haskeline = null;
26+ hoopl = null;
27+ hpc = null;
28+ integer-gmp = null;
29+ pretty = null;
30+ process = null;
31+ rts = null;
32+ template-haskell = null;
33+ terminfo = null;
34+ time = null;
35+ transformers = null;
36+ unix = null;
37+ xhtml = null;
38+
39+ # cabal-install can use the native Cabal library.
40+ cabal-install = super.cabal-install.override { Cabal = null; };
41+
42+ # jailbreak-cabal can use the native Cabal library.
43+ jailbreak-cabal = super.jailbreak-cabal.override { Cabal = null; };
44+
45+ # https://github.com/bmillwood/applicative-quoters/issues/6
46+ applicative-quoters = appendPatch super.applicative-quoters (pkgs.fetchpatch {
47+ url = "https://patch-diff.githubusercontent.com/raw/bmillwood/applicative-quoters/pull/7.patch";
48+ sha256 = "026vv2k3ks73jngwifszv8l59clg88pcdr4mz0wr0gamivkfa1zy";
49+ });
50+
51+ ## GHC > 8.0.2
52+
53+ # http://hub.darcs.net/dolio/vector-algorithms/issue/9#comment-20170112T145715
54+ vector-algorithms = dontCheck super.vector-algorithms;
55+
56+ # https://github.com/thoughtbot/yesod-auth-oauth2/pull/77
57+ yesod-auth-oauth2 = doJailbreak super.yesod-auth-oauth2;
58+
59+
60+}
pkgs/top-level/haskell-packages.nix+15
@@ -68,6 +68,13 @@ in rec {
6868 inherit (bootPkgs) hscolour;
6969 sphinx = pkgs.python27Packages.sphinx;
7070 };
71+ ghc821 = callPackage ../development/compilers/ghc/8.2.1.nix rec {
72+ bootPkgs = packages.ghc802;
73+ inherit (bootPkgs) hscolour alex happy;
74+ inherit buildPlatform targetPlatform;
75+ sphinx = pkgs.python3Packages.sphinx;
76+ selfPkgs = packages.ghc821;
77+ };
7178 ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec {
7279 bootPkgs = packages.ghc7103;
7380 inherit (bootPkgs) alex happy;
@@ -156,6 +163,10 @@ in rec {
156163 ghc = compiler.ghc802;
157164 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { };
158165 };
166+ ghc821 = callPackage ../development/haskell-modules {
167+ ghc = compiler.ghc821;
168+ compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { };
169+ };
159170 ghcHEAD = callPackage ../development/haskell-modules {
160171 ghc = compiler.ghcHEAD;
161172 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
@@ -165,6 +176,10 @@ in rec {
165176 ghc = compiler.ghcHEAD.crossCompiler;
166177 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
167178 };
179+ ghcCross821 = callPackage ../development/haskell-modules {
180+ ghc = compiler.ghc821.crossCompiler;
181+ compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { };
182+ };
168183 ghcjs = callPackage ../development/haskell-modules {
169184 ghc = compiler.ghcjs;
170185 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };