git.iko.soy/typeable/nixpkgs
on master help sign in
ghc: Clean up, and add `passthru.prefix`, in preparation for cross

No hashes should be changed.

commit63bf7d002c90169a6b2494a4f41b2f4f772b6aef authorJohn Ericson <John.Ericson@Obsidian.Systems> dateSun 10 Sep 2017, 15:36 (9 years ago) parentbf7b521
16 files changed+231−102
pkgs/development/compilers/ghc/6.10.2-binary.nix+19−14 pkgs/development/compilers/ghc/6.10.4.nix+5 pkgs/development/compilers/ghc/6.12.3.nix+5 pkgs/development/compilers/ghc/7.0.4-binary.nix+18−15 pkgs/development/compilers/ghc/7.0.4.nix+5 pkgs/development/compilers/ghc/7.10.2.nix+21−7 pkgs/development/compilers/ghc/7.10.3.nix+21−7 pkgs/development/compilers/ghc/7.2.2.nix+6−1 pkgs/development/compilers/ghc/7.4.2-binary.nix+18−15 pkgs/development/compilers/ghc/7.4.2.nix+8−2 pkgs/development/compilers/ghc/7.6.3.nix+8−2 pkgs/development/compilers/ghc/7.8.3.nix+8−2 pkgs/development/compilers/ghc/7.8.4.nix+8−2 pkgs/development/compilers/ghc/8.0.2.nix+24−11 pkgs/development/compilers/ghc/8.2.1.nix+29−12 pkgs/development/compilers/ghc/head.nix+28−12
pkgs/development/compilers/ghc/6.10.2-binary.nix+19−14
@@ -1,24 +1,29 @@
1−{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:
1+{ stdenv
2+, fetchurl, perl
3+, libedit, ncurses5, gmp
4+}:
5+
6+# Prebuilt only does native
7+assert stdenv.targetPlatform == stdenv.hostPlatform;
28
39stdenv.mkDerivation rec {
410 version = "6.10.2";
511
612 name = "ghc-${version}-binary";
713
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
14+ src = {
15+ "i686-linux" = fetchurl {
1116 # This binary requires libedit.so.0 (rather than libedit.so.2).
1217 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1318 sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
14− }
15− else if stdenv.system == "x86_64-linux" then
16− fetchurl {
19+ };
20+ "x86_64-linux" = fetchurl {
1721 # Idem.
1822 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1923 sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
20− }
21− else throw "cannot bootstrap GHC on this platform";
24+ };
25+ }.${stdenv.hostPlatform.system}
26+ or (throw "cannot bootstrap GHC on this platform");
2227
2328 buildInputs = [perl];
2429
@@ -37,17 +42,17 @@ stdenv.mkDerivation rec {
3742 '' +
3843 # On Linux, use patchelf to modify the executables so that they can
3944 # find editline/gmp.
40− (if stdenv.isLinux then ''
45+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
4146 find . -type f -perm -0100 \
4247 -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
4348 --set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
4449 for prog in ld ar gcc strip ranlib; do
4550 find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
4651 done
47− '' else "");
52+ '';
4853
4954 configurePhase = ''
50− ./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
55+ ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
5156 '';
5257
5358 # Stripping combined with patchelf breaks the executables (they die
@@ -62,7 +67,7 @@ stdenv.mkDerivation rec {
6267 # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
6368 # that the executables work with no special setup.
6469 postInstall =
65− (if stdenv.isDarwin then
70+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
6671 ''
6772 mkdir -p $out/frameworks/GMP.framework/Versions/A
6873 ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
@@ -79,7 +84,7 @@ stdenv.mkDerivation rec {
7984 echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
8085 chmod +x $out/bin/$i
8186 done
82− '' else "")
87+ ''
8388 +
8489 ''
8590 # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
pkgs/development/compilers/ghc/6.10.4.nix+5
@@ -1,5 +1,8 @@
11{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
22
3+# TODO(@Ericson2314): Cross compilation support
4+assert stdenv.targetPlatform == stdenv.hostPlatform;
5+
36stdenv.mkDerivation rec {
47 version = "6.10.4";
58
@@ -22,6 +25,8 @@ stdenv.mkDerivation rec {
2225
2326 NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
2427
28+ passthru = { prefix = ""; };
29+
2530 meta = {
2631 homepage = http://haskell.org/ghc;
2732 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/6.12.3.nix+5
@@ -1,5 +1,8 @@
11{stdenv, fetchurl, ghc, perl, gmp, ncurses}:
22
3+# TODO(@Ericson2314): Cross compilation support
4+assert stdenv.targetPlatform == stdenv.hostPlatform;
5+
36stdenv.mkDerivation rec {
47 version = "6.12.3";
58
@@ -33,6 +36,8 @@ stdenv.mkDerivation rec {
3336 # that in turn causes GHCi to abort
3437 stripDebugFlags=["-S" "--keep-file-symbols"];
3538
39+ passthru = { prefix = ""; };
40+
3641 meta = {
3742 homepage = http://haskell.org/ghc;
3843 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.0.4-binary.nix+18−15
@@ -1,32 +1,35 @@
1−{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:
1+{ stdenv
2+, fetchurl, perl
3+, ncurses5, gmp, libiconv
4+}:
5+
6+# Prebuilt only does native
7+assert stdenv.targetPlatform == stdenv.hostPlatform;
28
39stdenv.mkDerivation rec {
410 version = "7.0.4";
511
612 name = "ghc-${version}-binary";
713
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
14+ src = {
15+ "i686-linux" = fetchurl {
1116 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1217 sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
18+ };
19+ "x86_64-linux" = fetchurl {
1620 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1721 sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
22+ };
23+ "i686-darwin" = fetchurl {
2124 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2225 sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
26+ };
27+ "x86_64-darwin" = fetchurl {
2628 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2729 sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
28− }
29− else throw "cannot bootstrap GHC on this platform";
30+ };
31+ }.${stdenv.hostPlatform.system}
32+ or (throw "cannot bootstrap GHC on this platform");
3033
3134 buildInputs = [perl];
3235
pkgs/development/compilers/ghc/7.0.4.nix+5
@@ -1,5 +1,8 @@
11{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
22
3+# TODO(@Ericson2314): Cross compilation support
4+assert stdenv.targetPlatform == stdenv.hostPlatform;
5+
36stdenv.mkDerivation rec {
47 version = "7.0.4";
58 name = "ghc-${version}";
@@ -42,6 +45,8 @@ stdenv.mkDerivation rec {
4245 # that in turn causes GHCi to abort
4346 stripDebugFlags=["-S" "--keep-file-symbols"];
4447
48+ passthru = { prefix = ""; };
49+
4550 meta = {
4651 homepage = http://haskell.org/ghc;
4752 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.10.2.nix+21−7
@@ -1,14 +1,28 @@
1−{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2−, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
1+{ stdenv, __targetPackages
2+, buildPlatform, hostPlatform, targetPlatform
33
4− # If enabled GHC will be build with the GPL-free but slower integer-simple
4+# build-tools
5+, bootPkgs, hscolour
6+, binutils, coreutils, fetchurl, fetchpatch, perl
7+, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
8+
9+, ncurses, libiconv
10+
11+, # If enabled GHC will be build with the GPL-free but slower integer-simple
512 # library instead of the faster but GPLed integer-gmp library.
6−, enableIntegerSimple ? false, gmp
13+ enableIntegerSimple ? false, gmp ? null
714}:
815
16+assert !enableIntegerSimple -> gmp != null;
17+
918let
1019 inherit (bootPkgs) ghc;
1120
21+ # TODO(@Ericson2314) Make unconditional
22+ prefix = stdenv.lib.optionalString
23+ (targetPlatform != hostPlatform)
24+ "${targetPlatform.config}-";
25+
1226 buildMK = ''
1327 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
1428 libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
@@ -27,7 +41,7 @@ in
2741
2842stdenv.mkDerivation rec {
2943 version = "7.10.2";
30− name = "ghc-${version}";
44+ name = "${prefix}ghc-${version}";
3145
3246 src = fetchurl {
3347 url = "https://downloads.haskell.org/~ghc/7.10.2/${name}-src.tar.xz";
@@ -64,7 +78,7 @@ stdenv.mkDerivation rec {
6478
6579 postInstall = ''
6680 # Install the bash completion file.
67− install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
81+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
6882
6983 # Patch scripts to include "readelf" and "cat" in $PATH.
7084 for i in "$out/bin/"*; do
@@ -75,7 +89,7 @@ stdenv.mkDerivation rec {
7589 '';
7690
7791 passthru = {
78− inherit bootPkgs;
92+ inherit bootPkgs prefix;
7993 };
8094
8195 meta = {
pkgs/development/compilers/ghc/7.10.3.nix+21−7
@@ -1,14 +1,28 @@
1−{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2−, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
1+{ stdenv, __targetPackages
2+, buildPlatform, hostPlatform, targetPlatform
33
4− # If enabled GHC will be build with the GPL-free but slower integer-simple
4+# build-tools
5+, bootPkgs, hscolour
6+, binutils, coreutils, fetchurl, fetchpatch, perl
7+, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
8+
9+, ncurses, libiconv
10+
11+, # If enabled GHC will be build with the GPL-free but slower integer-simple
512 # library instead of the faster but GPLed integer-gmp library.
6−, enableIntegerSimple ? false, gmp
13+ enableIntegerSimple ? false, gmp ? null
714}:
815
16+assert !enableIntegerSimple -> gmp != null;
17+
918let
1019 inherit (bootPkgs) ghc;
1120
21+ # TODO(@Ericson2314) Make unconditional
22+ prefix = stdenv.lib.optionalString
23+ (targetPlatform != hostPlatform)
24+ "${targetPlatform.config}-";
25+
1226 docFixes = fetchurl {
1327 url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
1428 sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
@@ -18,7 +32,7 @@ in
1832
1933stdenv.mkDerivation rec {
2034 version = "7.10.3";
21− name = "ghc-${version}";
35+ name = "${prefix}ghc-${version}";
2236
2337 src = fetchurl {
2438 url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
@@ -62,7 +76,7 @@ stdenv.mkDerivation rec {
6276
6377 postInstall = ''
6478 # Install the bash completion file.
65− install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
79+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
6680
6781 # Patch scripts to include "readelf" and "cat" in $PATH.
6882 for i in "$out/bin/"*; do
@@ -73,7 +87,7 @@ stdenv.mkDerivation rec {
7387 '';
7488
7589 passthru = {
76− inherit bootPkgs;
90+ inherit bootPkgs prefix;
7791 };
7892
7993 meta = {
pkgs/development/compilers/ghc/7.2.2.nix+6−1
@@ -2,9 +2,12 @@
22
33 # If enabled GHC will be build with the GPL-free but slower integer-simple
44 # library instead of the faster but GPLed integer-gmp library.
5−, enableIntegerSimple ? false, gmp
5+, enableIntegerSimple ? false, gmp ? null
66}:
77
8+# TODO(@Ericson2314): Cross compilation support
9+assert stdenv.targetPlatform == stdenv.hostPlatform;
10+
811stdenv.mkDerivation rec {
912 version = "7.2.2";
1013 name = "ghc-${version}";
@@ -51,6 +54,8 @@ stdenv.mkDerivation rec {
5154 # that in turn causes GHCi to abort
5255 stripDebugFlags=["-S" "--keep-file-symbols"];
5356
57+ passthru = { prefix = ""; };
58+
5459 meta = {
5560 homepage = http://haskell.org/ghc;
5661 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.4.2-binary.nix+18−15
@@ -1,32 +1,35 @@
1−{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
1+{ stdenv
2+, fetchurl, perl, makeWrapper
3+, ncurses5, gmp, libiconv
4+}:
5+
6+# Prebuilt only does native
7+assert stdenv.targetPlatform == stdenv.hostPlatform;
28
39stdenv.mkDerivation rec {
410 version = "7.4.2";
511
612 name = "ghc-${version}-binary";
713
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
14+ src = {
15+ "i686-linux" = fetchurl {
1116 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1217 sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
18+ };
19+ "x86_64-linux" = fetchurl {
1620 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1721 sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
22+ };
23+ "i686-darwin" = fetchurl {
2124 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2225 sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
26+ };
27+ "x86_64-darwin" = fetchurl {
2628 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2729 sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
28− }
29− else throw "cannot bootstrap GHC on this platform";
30+ };
31+ }.${stdenv.hostPlatform.system}
32+ or (throw "cannot bootstrap GHC on this platform");
3033
3134 buildInputs = [perl];
3235
pkgs/development/compilers/ghc/7.4.2.nix+8−2
@@ -1,10 +1,14 @@
11{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
22
3− # If enabled GHC will be build with the GPL-free but slower integer-simple
3+, # If enabled GHC will be build with the GPL-free but slower integer-simple
44 # library instead of the faster but GPLed integer-gmp library.
5−, enableIntegerSimple ? false, gmp
5+ enableIntegerSimple ? false, gmp ? null
66}:
77
8+# TODO(@Ericson2314): Cross compilation support
9+assert stdenv.targetPlatform == stdenv.hostPlatform;
10+assert !enableIntegerSimple -> gmp != null;
11+
812stdenv.mkDerivation rec {
913 version = "7.4.2";
1014
@@ -52,6 +56,8 @@ stdenv.mkDerivation rec {
5256 # that in turn causes GHCi to abort
5357 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5458
59+ passthru = { prefix = ""; };
60+
5561 meta = {
5662 homepage = http://haskell.org/ghc;
5763 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.6.3.nix+8−2
@@ -1,10 +1,14 @@
11{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv
22
3− # If enabled GHC will be build with the GPL-free but slower integer-simple
3+, # If enabled GHC will be build with the GPL-free but slower integer-simple
44 # library instead of the faster but GPLed integer-gmp library.
5−, enableIntegerSimple ? false, gmp
5+ enableIntegerSimple ? false, gmp ? null
66}:
77
8+# TODO(@Ericson2314): Cross compilation support
9+assert stdenv.targetPlatform == stdenv.hostPlatform;
10+assert !enableIntegerSimple -> gmp != null;
11+
812let
913 # The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
1014 # to the gold linker). It prevents binaries' stacks from being marked as
@@ -78,6 +82,8 @@ in stdenv.mkDerivation rec {
7882 # that in turn causes GHCi to abort
7983 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
8084
85+ passthru = { prefix = ""; };
86+
8187 meta = {
8288 homepage = http://haskell.org/ghc;
8389 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.8.3.nix+8−2
@@ -1,10 +1,14 @@
11{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
22
3− # If enabled GHC will be build with the GPL-free but slower integer-simple
3+, # If enabled GHC will be build with the GPL-free but slower integer-simple
44 # library instead of the faster but GPLed integer-gmp library.
5−, enableIntegerSimple ? false, gmp
5+ enableIntegerSimple ? false, gmp ? null
66}:
77
8+# TODO(@Ericson2314): Cross compilation support
9+assert stdenv.targetPlatform == stdenv.hostPlatform;
10+assert !enableIntegerSimple -> gmp != null;
11+
812stdenv.mkDerivation rec {
913 version = "7.8.3";
1014 name = "ghc-${version}";
@@ -49,6 +53,8 @@ stdenv.mkDerivation rec {
4953 # that in turn causes GHCi to abort
5054 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5155
56+ passthru = { prefix = ""; };
57+
5258 meta = {
5359 homepage = http://haskell.org/ghc;
5460 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/7.8.4.nix+8−2
@@ -1,10 +1,14 @@
11{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
22
3− # If enabled GHC will be build with the GPL-free but slower integer-simple
3+, # If enabled GHC will be build with the GPL-free but slower integer-simple
44 # library instead of the faster but GPLed integer-gmp library.
5−, enableIntegerSimple ? false, gmp
5+ enableIntegerSimple ? false, gmp ? null
66}:
77
8+# TODO(@Ericson2314): Cross compilation support
9+assert stdenv.targetPlatform == stdenv.hostPlatform;
10+assert !enableIntegerSimple -> gmp != null;
11+
812stdenv.mkDerivation (rec {
913 version = "7.8.4";
1014 name = "ghc-${version}";
@@ -49,6 +53,8 @@ stdenv.mkDerivation (rec {
4953 # that in turn causes GHCi to abort
5054 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5155
56+ passthru = { prefix = ""; };
57+
5258 meta = {
5359 homepage = http://haskell.org/ghc;
5460 description = "The Glasgow Haskell Compiler";
pkgs/development/compilers/ghc/8.0.2.nix+24−11
@@ -1,18 +1,30 @@
1−{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2−, hscolour, patchutils, sphinx
1+{ stdenv, __targetPackages
2+, buildPlatform, hostPlatform, targetPlatform
33
4− # If enabled GHC will be build with the GPL-free but slower integer-simple
4+# build-tools
5+, bootPkgs, hscolour
6+, binutils, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx
7+
8+, libiconv, ncurses
9+
10+, # If enabled GHC will be build with the GPL-free but slower integer-simple
511 # library instead of the faster but GPLed integer-gmp library.
6−, enableIntegerSimple ? false, gmp
7−, cross ? null
12+ enableIntegerSimple ? false, gmp ? null
813}:
914
15+assert !enableIntegerSimple -> gmp != null;
16+
1017let
1118 inherit (bootPkgs) ghc;
19+
20+ # TODO(@Ericson2314) Make unconditional
21+ prefix = stdenv.lib.optionalString
22+ (targetPlatform != hostPlatform)
23+ "${targetPlatform.config}-";
1224in
1325stdenv.mkDerivation rec {
1426 version = "8.0.2";
15− name = "ghc-${version}";
27+ name = "${prefix}ghc-${version}";
1628
1729 src = fetchurl {
1830 url = "https://downloads.haskell.org/~ghc/8.0.2/${name}-src.tar.xz";
@@ -47,19 +59,20 @@ stdenv.mkDerivation rec {
4759 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
4860 ] ++ stdenv.lib.optional stdenv.isDarwin [
4961 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
50− ] ++
62+ ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
5163 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
52− lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
64+ "--disable-large-address-space"
65+ ];
5366
5467 # required, because otherwise all symbols from HSffi.o are stripped, and
5568 # that in turn causes GHCi to abort
5669 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5770
5871 postInstall = ''
59− paxmark m $out/lib/${name}/bin/{ghc,haddock}
72+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
6073
6174 # Install the bash completion file.
62− install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
75+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
6376
6477 # Patch scripts to include "readelf" and "cat" in $PATH.
6578 for i in "$out/bin/"*; do
@@ -70,7 +83,7 @@ stdenv.mkDerivation rec {
7083 '';
7184
7285 passthru = {
73− inherit bootPkgs;
86+ inherit bootPkgs prefix;
7487 };
7588
7689 meta = {
pkgs/development/compilers/ghc/8.2.1.nix+29−12
@@ -1,16 +1,30 @@
1−{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2−, autoconf, automake, happy, alex, python3, sphinx, hscolour
3−, buildPlatform, targetPlatform , selfPkgs, cross ? null
1+{ stdenv, __targetPackages
2+, buildPlatform, hostPlatform, targetPlatform
3+, selfPkgs, cross ? null
44
5− # If enabled GHC will be build with the GPL-free but slower integer-simple
5+# build-tools
6+, bootPkgs, alex, happy, hscolour
7+, autoconf, automake, binutils, coreutils, fetchurl, perl, python3, sphinx
8+
9+, libiconv ? null, ncurses
10+
11+, # If enabled, GHC will be build with the GPL-free but slower integer-simple
612 # library instead of the faster but GPLed integer-gmp library.
7−, enableIntegerSimple ? false, gmp
13+ enableIntegerSimple ? false, gmp ? null
814}:
915
16+assert !enableIntegerSimple -> gmp != null;
17+
1018let
1119 inherit (bootPkgs) ghc;
20+
1221 version = "8.2.1";
1322
23+ # TODO(@Ericson2314) Make unconditional
24+ prefix = stdenv.lib.optionalString
25+ (targetPlatform != hostPlatform)
26+ "${targetPlatform.config}-";
27+
1428 commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
1529 commonPreConfigure = ''
1630 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
@@ -21,9 +35,10 @@ let
2135 '' + stdenv.lib.optionalString enableIntegerSimple ''
2236 echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
2337 '';
24−in stdenv.mkDerivation (rec {
38+in
39+stdenv.mkDerivation (rec {
2540 inherit version;
26− name = "ghc-${version}";
41+ name = "${prefix}ghc-${version}";
2742
2843 src = fetchurl {
2944 url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
@@ -52,15 +67,17 @@ in stdenv.mkDerivation (rec {
5267
5368 # required, because otherwise all symbols from HSffi.o are stripped, and
5469 # that in turn causes GHCi to abort
55− stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
70+ stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
5671
5772 checkTarget = "test";
5873
74+ # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
75+ # treat that as a unary `{x,y,z,..}` repetition.
5976 postInstall = ''
60− paxmark m $out/lib/${name}/bin/{ghc,haddock}
77+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
6178
6279 # Install the bash completion file.
63− install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
80+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
6481
6582 # Patch scripts to include "readelf" and "cat" in $PATH.
6683 for i in "$out/bin/"*; do
@@ -73,7 +90,7 @@ in stdenv.mkDerivation (rec {
7390 outputs = [ "out" "doc" ];
7491
7592 passthru = {
76− inherit bootPkgs;
93+ inherit bootPkgs prefix;
7794 } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
7895 crossCompiler = selfPkgs.ghc.override {
7996 cross = targetPlatform;
@@ -105,7 +122,7 @@ in stdenv.mkDerivation (rec {
105122 "--enable-bootstrap-with-devel-snapshot"
106123 ] ++
107124 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
108− lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
125+ stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
109126
110127 buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
111128
pkgs/development/compilers/ghc/head.nix+28−12
@@ -1,20 +1,33 @@
1−{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2−, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
1+{ stdenv, __targetPackages
2+, buildPlatform, hostPlatform, targetPlatform
33, selfPkgs, cross ? null
44
5− # If enabled GHC will be build with the GPL-free but slower integer-simple
5+# build-tools
6+, bootPkgs, alex, happy
7+, autoconf, automake, binutils, coreutils, fetchgit, perl, python3
8+
9+, libiconv ? null, ncurses
10+
11+, # If enabled, GHC will be build with the GPL-free but slower integer-simple
612 # library instead of the faster but GPLed integer-gmp library.
7−, enableIntegerSimple ? false, gmp
13+ enableIntegerSimple ? false, gmp ? null
14+
815, version ? "8.3.20170808"
916}:
1017
18+assert !enableIntegerSimple -> gmp != null;
19+
1120let
1221 inherit (bootPkgs) ghc;
1322
14− commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
15−
1623 rev = "14457cf6a50f708eecece8f286f08687791d51f7";
1724
25+ # TODO(@Ericson2314) Make unconditional
26+ prefix = stdenv.lib.optionalString
27+ (targetPlatform != hostPlatform)
28+ "${targetPlatform.config}-";
29+
30+ commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
1831 commonPreConfigure = ''
1932 echo ${version} >VERSION
2033 echo ${rev} >GIT_COMMIT_ID
@@ -27,7 +40,8 @@ let
2740 '' + stdenv.lib.optionalString enableIntegerSimple ''
2841 echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
2942 '';
30−in stdenv.mkDerivation (rec {
43+in
44+stdenv.mkDerivation (rec {
3145 inherit version rev;
3246 name = "ghc-${version}";
3347
@@ -57,15 +71,17 @@ in stdenv.mkDerivation (rec {
5771
5872 # required, because otherwise all symbols from HSffi.o are stripped, and
5973 # that in turn causes GHCi to abort
60− stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
74+ stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
6175
6276 checkTarget = "test";
6377
78+ # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
79+ # treat that as a unary `{x,y,z,..}` repetition.
6480 postInstall = ''
65− paxmark m $out/lib/${name}/bin/{ghc,haddock}
81+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
6682
6783 # Install the bash completion file.
68− install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
84+ install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
6985
7086 # Patch scripts to include "readelf" and "cat" in $PATH.
7187 for i in "$out/bin/"*; do
@@ -78,7 +94,7 @@ in stdenv.mkDerivation (rec {
7894 outputs = [ "out" "doc" ];
7995
8096 passthru = {
81− inherit bootPkgs;
97+ inherit bootPkgs prefix;
8298 } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
8399 crossCompiler = selfPkgs.ghc.override {
84100 cross = targetPlatform;
@@ -110,7 +126,7 @@ in stdenv.mkDerivation (rec {
110126 "--enable-bootstrap-with-devel-snapshot"
111127 ] ++
112128 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
113− lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
129+ stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
114130
115131 buildInputs = commonBuildInputs;
116132