Skip to content

Commit a31365d

Browse files
committedSep 15, 2017
Revert "Merge commit on master into staging"
This was reverted on master in 3510197, and so needs to be reverted here too. This reverts commit 3befba5, reversing changes made to 3655e7e.
1 parent fd988f8 commit a31365d

20 files changed

+132
-272
lines changed
 

‎pkgs/development/compilers/ghc/6.10.2-binary.nix

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
{ stdenv
2-
, fetchurl, perl
3-
, libedit, ncurses5, gmp
4-
}:
5-
6-
# Prebuilt only does native
7-
assert stdenv.targetPlatform == stdenv.hostPlatform;
1+
{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:
82

93
stdenv.mkDerivation rec {
104
version = "6.10.2";
115

126
name = "ghc-${version}-binary";
137

14-
src = {
15-
"i686-linux" = fetchurl {
8+
src =
9+
if stdenv.system == "i686-linux" then
10+
fetchurl {
1611
# This binary requires libedit.so.0 (rather than libedit.so.2).
1712
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1813
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
19-
};
20-
"x86_64-linux" = fetchurl {
14+
}
15+
else if stdenv.system == "x86_64-linux" then
16+
fetchurl {
2117
# Idem.
2218
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
2319
sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
24-
};
25-
}.${stdenv.hostPlatform.system}
26-
or (throw "cannot bootstrap GHC on this platform");
20+
}
21+
else throw "cannot bootstrap GHC on this platform";
2722

2823
buildInputs = [perl];
2924

@@ -42,17 +37,17 @@ stdenv.mkDerivation rec {
4237
'' +
4338
# On Linux, use patchelf to modify the executables so that they can
4439
# find editline/gmp.
45-
stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
40+
(if stdenv.isLinux then ''
4641
find . -type f -perm -0100 \
4742
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
4843
--set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
4944
for prog in ld ar gcc strip ranlib; do
5045
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
5146
done
52-
'';
47+
'' else "");
5348

5449
configurePhase = ''
55-
./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
50+
./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
5651
'';
5752

5853
# Stripping combined with patchelf breaks the executables (they die
@@ -67,7 +62,7 @@ stdenv.mkDerivation rec {
6762
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
6863
# that the executables work with no special setup.
6964
postInstall =
70-
stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
65+
(if stdenv.isDarwin then
7166
''
7267
mkdir -p $out/frameworks/GMP.framework/Versions/A
7368
ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
@@ -84,7 +79,7 @@ stdenv.mkDerivation rec {
8479
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
8580
chmod +x $out/bin/$i
8681
done
87-
''
82+
'' else "")
8883
+
8984
''
9085
# 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
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
22

3-
# TODO(@Ericson2314): Cross compilation support
4-
assert stdenv.targetPlatform == stdenv.hostPlatform;
5-
63
stdenv.mkDerivation rec {
74
version = "6.10.4";
85

@@ -25,8 +22,6 @@ stdenv.mkDerivation rec {
2522

2623
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
2724

28-
passthru = { prefix = ""; };
29-
3025
meta = {
3126
homepage = http://haskell.org/ghc;
3227
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/6.12.3.nix

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{stdenv, fetchurl, ghc, perl, gmp, ncurses}:
22

3-
# TODO(@Ericson2314): Cross compilation support
4-
assert stdenv.targetPlatform == stdenv.hostPlatform;
5-
63
stdenv.mkDerivation rec {
74
version = "6.12.3";
85

@@ -36,8 +33,6 @@ stdenv.mkDerivation rec {
3633
# that in turn causes GHCi to abort
3734
stripDebugFlags=["-S" "--keep-file-symbols"];
3835

39-
passthru = { prefix = ""; };
40-
4136
meta = {
4237
homepage = http://haskell.org/ghc;
4338
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.0.4-binary.nix

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
{ stdenv
2-
, fetchurl, perl
3-
, ncurses5, gmp, libiconv
4-
}:
5-
6-
# Prebuilt only does native
7-
assert stdenv.targetPlatform == stdenv.hostPlatform;
1+
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:
82

93
stdenv.mkDerivation rec {
104
version = "7.0.4";
115

126
name = "ghc-${version}-binary";
137

14-
src = {
15-
"i686-linux" = fetchurl {
8+
src =
9+
if stdenv.system == "i686-linux" then
10+
fetchurl {
1611
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1712
sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
18-
};
19-
"x86_64-linux" = fetchurl {
13+
}
14+
else if stdenv.system == "x86_64-linux" then
15+
fetchurl {
2016
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
2117
sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
22-
};
23-
"i686-darwin" = fetchurl {
18+
}
19+
else if stdenv.system == "i686-darwin" then
20+
fetchurl {
2421
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2522
sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
26-
};
27-
"x86_64-darwin" = fetchurl {
23+
}
24+
else if stdenv.system == "x86_64-darwin" then
25+
fetchurl {
2826
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2927
sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
30-
};
31-
}.${stdenv.hostPlatform.system}
32-
or (throw "cannot bootstrap GHC on this platform");
28+
}
29+
else throw "cannot bootstrap GHC on this platform";
3330

3431
buildInputs = [perl];
3532

‎pkgs/development/compilers/ghc/7.0.4.nix

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
22

3-
# TODO(@Ericson2314): Cross compilation support
4-
assert stdenv.targetPlatform == stdenv.hostPlatform;
5-
63
stdenv.mkDerivation rec {
74
version = "7.0.4";
85
name = "ghc-${version}";
@@ -45,8 +42,6 @@ stdenv.mkDerivation rec {
4542
# that in turn causes GHCi to abort
4643
stripDebugFlags=["-S" "--keep-file-symbols"];
4744

48-
passthru = { prefix = ""; };
49-
5045
meta = {
5146
homepage = http://haskell.org/ghc;
5247
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.10.2.nix

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
{ stdenv, __targetPackages
2-
, buildPlatform, hostPlatform, targetPlatform
1+
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
33

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
4+
# If enabled GHC will be build with the GPL-free but slower integer-simple
125
# library instead of the faster but GPLed integer-gmp library.
13-
enableIntegerSimple ? false, gmp ? null
6+
, enableIntegerSimple ? false, gmp
147
}:
158

16-
assert !enableIntegerSimple -> gmp != null;
17-
189
let
1910
inherit (bootPkgs) ghc;
2011

21-
# TODO(@Ericson2314) Make unconditional
22-
prefix = stdenv.lib.optionalString
23-
(targetPlatform != hostPlatform)
24-
"${targetPlatform.config}-";
25-
2612
buildMK = ''
2713
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
2814
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
@@ -41,7 +27,7 @@ in
4127

4228
stdenv.mkDerivation rec {
4329
version = "7.10.2";
44-
name = "${prefix}ghc-${version}";
30+
name = "ghc-${version}";
4531

4632
src = fetchurl {
4733
url = "https://downloads.haskell.org/~ghc/7.10.2/${name}-src.tar.xz";
@@ -78,7 +64,7 @@ stdenv.mkDerivation rec {
7864

7965
postInstall = ''
8066
# Install the bash completion file.
81-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
67+
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
8268
8369
# Patch scripts to include "readelf" and "cat" in $PATH.
8470
for i in "$out/bin/"*; do
@@ -89,7 +75,7 @@ stdenv.mkDerivation rec {
8975
'';
9076

9177
passthru = {
92-
inherit bootPkgs prefix;
78+
inherit bootPkgs;
9379
};
9480

9581
meta = {

‎pkgs/development/compilers/ghc/7.10.3.nix

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
{ stdenv, __targetPackages
2-
, buildPlatform, hostPlatform, targetPlatform
1+
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
33

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
4+
# If enabled GHC will be build with the GPL-free but slower integer-simple
125
# library instead of the faster but GPLed integer-gmp library.
13-
enableIntegerSimple ? false, gmp ? null
6+
, enableIntegerSimple ? false, gmp
147
}:
158

16-
assert !enableIntegerSimple -> gmp != null;
17-
189
let
1910
inherit (bootPkgs) ghc;
2011

21-
# TODO(@Ericson2314) Make unconditional
22-
prefix = stdenv.lib.optionalString
23-
(targetPlatform != hostPlatform)
24-
"${targetPlatform.config}-";
25-
2612
docFixes = fetchurl {
2713
url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
2814
sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
@@ -32,7 +18,7 @@ in
3218

3319
stdenv.mkDerivation rec {
3420
version = "7.10.3";
35-
name = "${prefix}ghc-${version}";
21+
name = "ghc-${version}";
3622

3723
src = fetchurl {
3824
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
@@ -76,7 +62,7 @@ stdenv.mkDerivation rec {
7662

7763
postInstall = ''
7864
# Install the bash completion file.
79-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
65+
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
8066
8167
# Patch scripts to include "readelf" and "cat" in $PATH.
8268
for i in "$out/bin/"*; do
@@ -87,7 +73,7 @@ stdenv.mkDerivation rec {
8773
'';
8874

8975
passthru = {
90-
inherit bootPkgs prefix;
76+
inherit bootPkgs;
9177
};
9278

9379
meta = {

‎pkgs/development/compilers/ghc/7.2.2.nix

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
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 ? null
5+
, enableIntegerSimple ? false, gmp
66
}:
77

8-
# TODO(@Ericson2314): Cross compilation support
9-
assert stdenv.targetPlatform == stdenv.hostPlatform;
10-
118
stdenv.mkDerivation rec {
129
version = "7.2.2";
1310
name = "ghc-${version}";
@@ -54,8 +51,6 @@ stdenv.mkDerivation rec {
5451
# that in turn causes GHCi to abort
5552
stripDebugFlags=["-S" "--keep-file-symbols"];
5653

57-
passthru = { prefix = ""; };
58-
5954
meta = {
6055
homepage = http://haskell.org/ghc;
6156
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.4.2-binary.nix

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
{ stdenv
2-
, fetchurl, perl, makeWrapper
3-
, ncurses5, gmp, libiconv
4-
}:
5-
6-
# Prebuilt only does native
7-
assert stdenv.targetPlatform == stdenv.hostPlatform;
1+
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
82

93
stdenv.mkDerivation rec {
104
version = "7.4.2";
115

126
name = "ghc-${version}-binary";
137

14-
src = {
15-
"i686-linux" = fetchurl {
8+
src =
9+
if stdenv.system == "i686-linux" then
10+
fetchurl {
1611
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1712
sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
18-
};
19-
"x86_64-linux" = fetchurl {
13+
}
14+
else if stdenv.system == "x86_64-linux" then
15+
fetchurl {
2016
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
2117
sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
22-
};
23-
"i686-darwin" = fetchurl {
18+
}
19+
else if stdenv.system == "i686-darwin" then
20+
fetchurl {
2421
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2522
sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
26-
};
27-
"x86_64-darwin" = fetchurl {
23+
}
24+
else if stdenv.system == "x86_64-darwin" then
25+
fetchurl {
2826
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2927
sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
30-
};
31-
}.${stdenv.hostPlatform.system}
32-
or (throw "cannot bootstrap GHC on this platform");
28+
}
29+
else throw "cannot bootstrap GHC on this platform";
3330

3431
buildInputs = [perl];
3532

‎pkgs/development/compilers/ghc/7.4.2.nix

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
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 ? null
5+
, enableIntegerSimple ? false, gmp
66
}:
77

8-
# TODO(@Ericson2314): Cross compilation support
9-
assert stdenv.targetPlatform == stdenv.hostPlatform;
10-
assert !enableIntegerSimple -> gmp != null;
11-
128
stdenv.mkDerivation rec {
139
version = "7.4.2";
1410

@@ -56,8 +52,6 @@ stdenv.mkDerivation rec {
5652
# that in turn causes GHCi to abort
5753
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5854

59-
passthru = { prefix = ""; };
60-
6155
meta = {
6256
homepage = http://haskell.org/ghc;
6357
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.6.3.nix

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
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 ? null
5+
, enableIntegerSimple ? false, gmp
66
}:
77

8-
# TODO(@Ericson2314): Cross compilation support
9-
assert stdenv.targetPlatform == stdenv.hostPlatform;
10-
assert !enableIntegerSimple -> gmp != null;
11-
128
let
139
# The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
1410
# to the gold linker). It prevents binaries' stacks from being marked as
@@ -82,8 +78,6 @@ in stdenv.mkDerivation rec {
8278
# that in turn causes GHCi to abort
8379
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
8480

85-
passthru = { prefix = ""; };
86-
8781
meta = {
8882
homepage = http://haskell.org/ghc;
8983
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.8.3.nix

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
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 ? null
5+
, enableIntegerSimple ? false, gmp
66
}:
77

8-
# TODO(@Ericson2314): Cross compilation support
9-
assert stdenv.targetPlatform == stdenv.hostPlatform;
10-
assert !enableIntegerSimple -> gmp != null;
11-
128
stdenv.mkDerivation rec {
139
version = "7.8.3";
1410
name = "ghc-${version}";
@@ -53,8 +49,6 @@ stdenv.mkDerivation rec {
5349
# that in turn causes GHCi to abort
5450
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5551

56-
passthru = { prefix = ""; };
57-
5852
meta = {
5953
homepage = http://haskell.org/ghc;
6054
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/7.8.4.nix

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
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 ? null
5+
, enableIntegerSimple ? false, gmp
66
}:
77

8-
# TODO(@Ericson2314): Cross compilation support
9-
assert stdenv.targetPlatform == stdenv.hostPlatform;
10-
assert !enableIntegerSimple -> gmp != null;
11-
128
stdenv.mkDerivation (rec {
139
version = "7.8.4";
1410
name = "ghc-${version}";
@@ -53,8 +49,6 @@ stdenv.mkDerivation (rec {
5349
# that in turn causes GHCi to abort
5450
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
5551

56-
passthru = { prefix = ""; };
57-
5852
meta = {
5953
homepage = http://haskell.org/ghc;
6054
description = "The Glasgow Haskell Compiler";

‎pkgs/development/compilers/ghc/8.0.2.nix

+11-24
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
{ stdenv, __targetPackages
2-
, buildPlatform, hostPlatform, targetPlatform
1+
{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+
, hscolour, patchutils, sphinx
33

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
4+
# If enabled GHC will be build with the GPL-free but slower integer-simple
115
# library instead of the faster but GPLed integer-gmp library.
12-
enableIntegerSimple ? false, gmp ? null
6+
, enableIntegerSimple ? false, gmp
7+
, cross ? null
138
}:
149

15-
assert !enableIntegerSimple -> gmp != null;
16-
1710
let
1811
inherit (bootPkgs) ghc;
19-
20-
# TODO(@Ericson2314) Make unconditional
21-
prefix = stdenv.lib.optionalString
22-
(targetPlatform != hostPlatform)
23-
"${targetPlatform.config}-";
2412
in
2513
stdenv.mkDerivation rec {
2614
version = "8.0.2";
27-
name = "${prefix}ghc-${version}";
15+
name = "ghc-${version}";
2816

2917
src = fetchurl {
3018
url = "https://downloads.haskell.org/~ghc/8.0.2/${name}-src.tar.xz";
@@ -59,20 +47,19 @@ stdenv.mkDerivation rec {
5947
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
6048
] ++ stdenv.lib.optional stdenv.isDarwin [
6149
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
62-
] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
50+
] ++
6351
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
64-
"--disable-large-address-space"
65-
];
52+
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
6653

6754
# required, because otherwise all symbols from HSffi.o are stripped, and
6855
# that in turn causes GHCi to abort
6956
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
7057

7158
postInstall = ''
72-
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
59+
paxmark m $out/lib/${name}/bin/{ghc,haddock}
7360
7461
# Install the bash completion file.
75-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
62+
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
7663
7764
# Patch scripts to include "readelf" and "cat" in $PATH.
7865
for i in "$out/bin/"*; do
@@ -83,7 +70,7 @@ stdenv.mkDerivation rec {
8370
'';
8471

8572
passthru = {
86-
inherit bootPkgs prefix;
73+
inherit bootPkgs;
8774
};
8875

8976
meta = {

‎pkgs/development/compilers/ghc/8.2.1.nix

+12-29
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
1-
{ stdenv, __targetPackages
2-
, buildPlatform, hostPlatform, targetPlatform
3-
, selfPkgs, cross ? null
1+
{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+
, autoconf, automake, happy, alex, python3, sphinx, hscolour
3+
, buildPlatform, targetPlatform , selfPkgs, cross ? null
44

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
5+
# If enabled GHC will be build with the GPL-free but slower integer-simple
126
# library instead of the faster but GPLed integer-gmp library.
13-
enableIntegerSimple ? false, gmp ? null
7+
, enableIntegerSimple ? false, gmp
148
}:
159

16-
assert !enableIntegerSimple -> gmp != null;
17-
1810
let
1911
inherit (bootPkgs) ghc;
20-
2112
version = "8.2.1";
2213

23-
# TODO(@Ericson2314) Make unconditional
24-
prefix = stdenv.lib.optionalString
25-
(targetPlatform != hostPlatform)
26-
"${targetPlatform.config}-";
27-
2814
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
2915
commonPreConfigure = ''
3016
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
@@ -35,10 +21,9 @@ let
3521
'' + stdenv.lib.optionalString enableIntegerSimple ''
3622
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
3723
'';
38-
in
39-
stdenv.mkDerivation (rec {
24+
in stdenv.mkDerivation (rec {
4025
inherit version;
41-
name = "${prefix}ghc-${version}";
26+
name = "ghc-${version}";
4227

4328
src = fetchurl {
4429
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
@@ -67,17 +52,15 @@ stdenv.mkDerivation (rec {
6752

6853
# required, because otherwise all symbols from HSffi.o are stripped, and
6954
# that in turn causes GHCi to abort
70-
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
55+
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
7156

7257
checkTarget = "test";
7358

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.
7659
postInstall = ''
77-
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
60+
paxmark m $out/lib/${name}/bin/{ghc,haddock}
7861
7962
# Install the bash completion file.
80-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
63+
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
8164
8265
# Patch scripts to include "readelf" and "cat" in $PATH.
8366
for i in "$out/bin/"*; do
@@ -90,7 +73,7 @@ stdenv.mkDerivation (rec {
9073
outputs = [ "out" "doc" ];
9174

9275
passthru = {
93-
inherit bootPkgs prefix;
76+
inherit bootPkgs;
9477
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
9578
crossCompiler = selfPkgs.ghc.override {
9679
cross = targetPlatform;
@@ -122,7 +105,7 @@ stdenv.mkDerivation (rec {
122105
"--enable-bootstrap-with-devel-snapshot"
123106
] ++
124107
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
125-
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
108+
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
126109

127110
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
128111

‎pkgs/development/compilers/ghc/head.nix

+12-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
1-
{ stdenv, __targetPackages
2-
, buildPlatform, hostPlatform, targetPlatform
1+
{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
2+
, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
33
, selfPkgs, cross ? null
44

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
5+
# If enabled GHC will be build with the GPL-free but slower integer-simple
126
# library instead of the faster but GPLed integer-gmp library.
13-
enableIntegerSimple ? false, gmp ? null
14-
7+
, enableIntegerSimple ? false, gmp
158
, version ? "8.3.20170808"
169
}:
1710

18-
assert !enableIntegerSimple -> gmp != null;
19-
2011
let
2112
inherit (bootPkgs) ghc;
2213

23-
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
14+
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
2415

25-
# TODO(@Ericson2314) Make unconditional
26-
prefix = stdenv.lib.optionalString
27-
(targetPlatform != hostPlatform)
28-
"${targetPlatform.config}-";
16+
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
2917

30-
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
3118
commonPreConfigure = ''
3219
echo ${version} >VERSION
3320
echo ${rev} >GIT_COMMIT_ID
@@ -40,8 +27,7 @@ let
4027
'' + stdenv.lib.optionalString enableIntegerSimple ''
4128
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
4229
'';
43-
in
44-
stdenv.mkDerivation (rec {
30+
in stdenv.mkDerivation (rec {
4531
inherit version rev;
4632
name = "ghc-${version}";
4733

@@ -71,17 +57,15 @@ stdenv.mkDerivation (rec {
7157

7258
# required, because otherwise all symbols from HSffi.o are stripped, and
7359
# that in turn causes GHCi to abort
74-
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
60+
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
7561

7662
checkTarget = "test";
7763

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.
8064
postInstall = ''
81-
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
65+
paxmark m $out/lib/${name}/bin/{ghc,haddock}
8266
8367
# Install the bash completion file.
84-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
68+
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
8569
8670
# Patch scripts to include "readelf" and "cat" in $PATH.
8771
for i in "$out/bin/"*; do
@@ -94,7 +78,7 @@ stdenv.mkDerivation (rec {
9478
outputs = [ "out" "doc" ];
9579

9680
passthru = {
97-
inherit bootPkgs prefix;
81+
inherit bootPkgs;
9882
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
9983
crossCompiler = selfPkgs.ghc.override {
10084
cross = targetPlatform;
@@ -126,7 +110,7 @@ stdenv.mkDerivation (rec {
126110
"--enable-bootstrap-with-devel-snapshot"
127111
] ++
128112
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
129-
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
113+
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
130114

131115
buildInputs = commonBuildInputs;
132116

‎pkgs/development/haskell-modules/generic-builder.nix

+15-23
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
{ stdenv, buildPackages, ghc
2-
, jailbreak-cabal, hscolour, cpphs, nodejs
3-
, buildPlatform, hostPlatform
1+
{ stdenv, fetchurl, ghc, pkgconfig, glibcLocales, coreutils, gnugrep, gnused
2+
, jailbreak-cabal, hscolour, cpphs, nodejs, lib, removeReferencesTo
43
}:
5-
6-
let
7-
isCross = buildPlatform != hostPlatform;
8-
inherit (buildPackages)
9-
fetchurl removeReferencesTo
10-
pkgconfig binutils coreutils gnugrep gnused glibcLocales;
11-
in
4+
let isCross = (ghc.cross or null) != null; in
125

136
{ pname
147
, dontStrip ? (ghc.isGhcjs or false)
@@ -27,8 +20,8 @@ in
2720
, enableLibraryProfiling ? false
2821
, enableExecutableProfiling ? false
2922
# TODO enable shared libs for cross-compiling
30-
, enableSharedExecutables ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
31-
, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
23+
, enableSharedExecutables ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
24+
, enableSharedLibraries ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
3225
, enableSplitObjs ? null # OBSOLETE, use enableDeadCodeElimination
3326
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
3427
, enableStaticLibraries ? true
@@ -60,7 +53,7 @@ in
6053
, shellHook ? ""
6154
, coreSetup ? false # Use only core packages to build Setup.hs.
6255
, useCpphs ? false
63-
, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
56+
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
6457
, enableSeparateDataOutput ? false
6558
, enableSeparateDocOutput ? doHaddock
6659
} @ args:
@@ -109,12 +102,11 @@ let
109102
enableParallelBuilding = (versionOlder "7.8" ghc.version && !hasActiveLibrary) || versionOlder "8.0.1" ghc.version;
110103

111104
crossCabalFlags = [
112-
"--with-ghc=${ghc.prefix}ghc"
113-
"--with-ghc-pkg=${ghc.prefix}ghc-pkg"
114-
"--with-gcc=${ghc.prefix}cc"
115-
"--with-ld=${ghc.prefix}ld"
105+
"--with-ghc=${ghc.cross.config}-ghc"
106+
"--with-ghc-pkg=${ghc.cross.config}-ghc-pkg"
107+
"--with-gcc=${ghc.cc}"
108+
"--with-ld=${ghc.ld}"
116109
"--with-hsc2hs=${nativeGhc}/bin/hsc2hs"
117-
"--with-strip=${binutils}/bin/${ghc.prefix}strip"
118110
] ++ (if isHaLVM then [] else ["--hsc2hs-options=--cross-compile"]);
119111

120112
crossCabalFlagsString =
@@ -143,7 +135,7 @@ let
143135
] ++ optionals isGhcjs [
144136
"--ghcjs"
145137
] ++ optionals isCross ([
146-
"--configure-option=--host=${hostPlatform.config}"
138+
"--configure-option=--host=${ghc.cross.config}"
147139
] ++ crossCabalFlags);
148140

149141
setupCompileFlags = [
@@ -178,7 +170,8 @@ let
178170
setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand;
179171
setupCommand = "./Setup";
180172
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
181-
ghcCommand = "${ghc.prefix}${ghcCommand'}";
173+
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
174+
ghcCommand = "${crossPrefix}${ghcCommand'}";
182175
ghcCommandCaps= toUpper ghcCommand';
183176

184177
in
@@ -275,8 +268,6 @@ stdenv.mkDerivation ({
275268
runHook postCompileBuildDriver
276269
'';
277270

278-
inherit configureFlags;
279-
280271
configurePhase = ''
281272
runHook preConfigure
282273
@@ -402,6 +393,7 @@ stdenv.mkDerivation ({
402393
// optionalAttrs (postCompileBuildDriver != "") { inherit postCompileBuildDriver; }
403394
// optionalAttrs (preUnpack != "") { inherit preUnpack; }
404395
// optionalAttrs (postUnpack != "") { inherit postUnpack; }
396+
// optionalAttrs (configureFlags != []) { inherit configureFlags; }
405397
// optionalAttrs (patches != []) { inherit patches; }
406398
// optionalAttrs (patchPhase != "") { inherit patchPhase; }
407399
// optionalAttrs (preConfigure != "") { inherit preConfigure; }
@@ -420,5 +412,5 @@ stdenv.mkDerivation ({
420412
// optionalAttrs (postFixup != "") { inherit postFixup; }
421413
// optionalAttrs (dontStrip) { inherit dontStrip; }
422414
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
423-
// optionalAttrs (buildPlatform.isLinux){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
415+
// optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
424416
)

‎pkgs/development/haskell-modules/make-package-set.nix

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# This expression takes a file like `hackage-packages.nix` and constructs
22
# a full package set out of that.
33

4-
{ # package-set used for build tools (all of nixpkgs)
5-
buildPackages
6-
7-
, # package-set used for non-haskell dependencies (all of nixpkgs)
4+
{ # package-set used for non-haskell dependencies (all of nixpkgs)
85
pkgs
96

107
, # stdenv to use for building haskell packages
@@ -31,21 +28,19 @@
3128
self:
3229

3330
let
34-
inherit (stdenv) buildPlatform hostPlatform;
3531

3632
inherit (stdenv.lib) fix' extends makeOverridable;
3733
inherit (haskellLib) overrideCabal;
3834

39-
buildHaskellPackages = if hostPlatform != buildPlatform
40-
then self.ghc.bootPkgs
41-
else self;
42-
4335
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
4436
inherit stdenv;
45-
nodejs = buildPackages.nodejs-slim;
46-
inherit (buildHaskellPackages) jailbreak-cabal;
37+
inherit (pkgs) fetchurl pkgconfig glibcLocales coreutils gnugrep gnused;
38+
nodejs = pkgs.nodejs-slim;
39+
jailbreak-cabal = if (self.ghc.cross or null) != null
40+
then self.ghc.bootPkgs.jailbreak-cabal
41+
else self.jailbreak-cabal;
4742
inherit (self) ghc;
48-
hscolour = overrideCabal buildHaskellPackages.hscolour (drv: {
43+
hscolour = overrideCabal self.hscolour (drv: {
4944
isLibrary = false;
5045
doHaddock = false;
5146
hyperlinkSource = false; # Avoid depending on hscolour for this build.
@@ -109,13 +104,13 @@ let
109104
haskellSrc2nix = { name, src, sha256 ? null }:
110105
let
111106
sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"'';
112-
in pkgs.buildPackages.stdenv.mkDerivation {
107+
in pkgs.stdenv.mkDerivation {
113108
name = "cabal2nix-${name}";
114-
nativeBuildInputs = [ pkgs.buildPackages.haskellPackages.cabal2nix ];
109+
buildInputs = [ pkgs.haskellPackages.cabal2nix ];
115110
preferLocalBuild = true;
116111
phases = ["installPhase"];
117112
LANG = "en_US.UTF-8";
118-
LOCALE_ARCHIVE = pkgs.lib.optionalString buildPlatform.isLinux "${buildPackages.glibcLocales}/lib/locale/locale-archive";
113+
LOCALE_ARCHIVE = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
119114
installPhase = ''
120115
export HOME="$TMP"
121116
mkdir -p "$out"

‎pkgs/development/haskell-modules/with-packages-wrapper.nix

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ let
3636
isHaLVM = ghc.isHaLVM or false;
3737
ghc761OrLater = isGhcjs || isHaLVM || lib.versionOlder "7.6.1" ghc.version;
3838
packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
39-
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
40-
ghcCommand = "${ghc.prefix}${ghcCommand'}";
39+
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
40+
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
41+
ghcCommand = "${crossPrefix}${ghcCommand'}";
4142
ghcCommandCaps= lib.toUpper ghcCommand';
4243
libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
4344
docDir = "$out/share/doc/ghc/html";

‎pkgs/os-specific/darwin/ghc-standalone-archive/default.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
{ haskellPackages, src, deps ? p : [], name }: let
33
inherit (haskellPackages) ghc ghcWithPackages;
44
with-env = ghcWithPackages deps;
5-
ghcName = "${ghc.prefix}ghc";
5+
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
6+
ghcName = "${crossPrefix}ghc";
67
in runCommand name { buildInputs = [ with-env cctools ]; } ''
78
mkdir -p $out/lib
89
mkdir -p $out/include

0 commit comments

Comments
 (0)
Please sign in to comment.