Revert "Merge commit on master into staging"
This was reverted on master in 3510197dccd999ac7189e70d819e0c6a61296817, and so needs to be reverted here too. This reverts commit 3befba542a4264c970de7fde63baa736900c8e53, reversing changes made to 3655e7e18bf7c2b7eeadf824d8c4230a487ca16e.
This commit is contained in:
parent
fd988f8481
commit
a31365d831
@ -1,29 +1,24 @@
|
|||||||
{ stdenv
|
{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:
|
||||||
, fetchurl, perl
|
|
||||||
, libedit, ncurses5, gmp
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Prebuilt only does native
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "6.10.2";
|
version = "6.10.2";
|
||||||
|
|
||||||
name = "ghc-${version}-binary";
|
name = "ghc-${version}-binary";
|
||||||
|
|
||||||
src = {
|
src =
|
||||||
"i686-linux" = fetchurl {
|
if stdenv.system == "i686-linux" then
|
||||||
|
fetchurl {
|
||||||
# This binary requires libedit.so.0 (rather than libedit.so.2).
|
# This binary requires libedit.so.0 (rather than libedit.so.2).
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
||||||
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
|
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
|
||||||
};
|
}
|
||||||
"x86_64-linux" = fetchurl {
|
else if stdenv.system == "x86_64-linux" then
|
||||||
|
fetchurl {
|
||||||
# Idem.
|
# Idem.
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
||||||
sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
|
sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
|
||||||
};
|
}
|
||||||
}.${stdenv.hostPlatform.system}
|
else throw "cannot bootstrap GHC on this platform";
|
||||||
or (throw "cannot bootstrap GHC on this platform");
|
|
||||||
|
|
||||||
buildInputs = [perl];
|
buildInputs = [perl];
|
||||||
|
|
||||||
@ -42,17 +37,17 @@ stdenv.mkDerivation rec {
|
|||||||
'' +
|
'' +
|
||||||
# On Linux, use patchelf to modify the executables so that they can
|
# On Linux, use patchelf to modify the executables so that they can
|
||||||
# find editline/gmp.
|
# find editline/gmp.
|
||||||
stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
|
(if stdenv.isLinux then ''
|
||||||
find . -type f -perm -0100 \
|
find . -type f -perm -0100 \
|
||||||
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
--set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
|
--set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
|
||||||
for prog in ld ar gcc strip ranlib; do
|
for prog in ld ar gcc strip ranlib; do
|
||||||
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
|
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
|
||||||
done
|
done
|
||||||
'';
|
'' else "");
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
|
./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Stripping combined with patchelf breaks the executables (they die
|
# Stripping combined with patchelf breaks the executables (they die
|
||||||
@ -67,7 +62,7 @@ stdenv.mkDerivation rec {
|
|||||||
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
|
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
|
||||||
# that the executables work with no special setup.
|
# that the executables work with no special setup.
|
||||||
postInstall =
|
postInstall =
|
||||||
stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
|
(if stdenv.isDarwin then
|
||||||
''
|
''
|
||||||
mkdir -p $out/frameworks/GMP.framework/Versions/A
|
mkdir -p $out/frameworks/GMP.framework/Versions/A
|
||||||
ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
|
ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
|
||||||
@ -84,7 +79,7 @@ stdenv.mkDerivation rec {
|
|||||||
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
|
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
|
||||||
chmod +x $out/bin/$i
|
chmod +x $out/bin/$i
|
||||||
done
|
done
|
||||||
''
|
'' else "")
|
||||||
+
|
+
|
||||||
''
|
''
|
||||||
# bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
|
# bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
|
{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "6.10.4";
|
version = "6.10.4";
|
||||||
|
|
||||||
@ -25,8 +22,6 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{stdenv, fetchurl, ghc, perl, gmp, ncurses}:
|
{stdenv, fetchurl, ghc, perl, gmp, ncurses}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "6.12.3";
|
version = "6.12.3";
|
||||||
|
|
||||||
@ -36,8 +33,6 @@ stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,35 +1,32 @@
|
|||||||
{ stdenv
|
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:
|
||||||
, fetchurl, perl
|
|
||||||
, ncurses5, gmp, libiconv
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Prebuilt only does native
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.0.4";
|
version = "7.0.4";
|
||||||
|
|
||||||
name = "ghc-${version}-binary";
|
name = "ghc-${version}-binary";
|
||||||
|
|
||||||
src = {
|
src =
|
||||||
"i686-linux" = fetchurl {
|
if stdenv.system == "i686-linux" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
||||||
sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
|
sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
|
||||||
};
|
}
|
||||||
"x86_64-linux" = fetchurl {
|
else if stdenv.system == "x86_64-linux" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
||||||
sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
|
sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
|
||||||
};
|
}
|
||||||
"i686-darwin" = fetchurl {
|
else if stdenv.system == "i686-darwin" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
|
||||||
sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
|
sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
|
||||||
};
|
}
|
||||||
"x86_64-darwin" = fetchurl {
|
else if stdenv.system == "x86_64-darwin" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
|
||||||
sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
|
sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
|
||||||
};
|
}
|
||||||
}.${stdenv.hostPlatform.system}
|
else throw "cannot bootstrap GHC on this platform";
|
||||||
or (throw "cannot bootstrap GHC on this platform");
|
|
||||||
|
|
||||||
buildInputs = [perl];
|
buildInputs = [perl];
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
|
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.0.4";
|
version = "7.0.4";
|
||||||
name = "ghc-${version}";
|
name = "ghc-${version}";
|
||||||
@ -45,8 +42,6 @@ stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,28 +1,14 @@
|
|||||||
{ stdenv, __targetPackages
|
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
|
||||||
, buildPlatform, hostPlatform, targetPlatform
|
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
|
||||||
|
|
||||||
# build-tools
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
, bootPkgs, hscolour
|
|
||||||
, binutils, coreutils, fetchurl, fetchpatch, perl
|
|
||||||
, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
|
|
||||||
|
|
||||||
, ncurses, libiconv
|
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
# TODO(@Ericson2314) Make unconditional
|
|
||||||
prefix = stdenv.lib.optionalString
|
|
||||||
(targetPlatform != hostPlatform)
|
|
||||||
"${targetPlatform.config}-";
|
|
||||||
|
|
||||||
buildMK = ''
|
buildMK = ''
|
||||||
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
|
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
|
||||||
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
|
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
|
||||||
@ -41,7 +27,7 @@ in
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.10.2";
|
version = "7.10.2";
|
||||||
name = "${prefix}ghc-${version}";
|
name = "ghc-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://downloads.haskell.org/~ghc/7.10.2/${name}-src.tar.xz";
|
url = "https://downloads.haskell.org/~ghc/7.10.2/${name}-src.tar.xz";
|
||||||
@ -78,7 +64,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# Install the bash completion file.
|
# Install the bash completion file.
|
||||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
|
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
|
||||||
|
|
||||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
@ -89,7 +75,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit bootPkgs prefix;
|
inherit bootPkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,28 +1,14 @@
|
|||||||
{ stdenv, __targetPackages
|
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
|
||||||
, buildPlatform, hostPlatform, targetPlatform
|
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
|
||||||
|
|
||||||
# build-tools
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
, bootPkgs, hscolour
|
|
||||||
, binutils, coreutils, fetchurl, fetchpatch, perl
|
|
||||||
, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
|
|
||||||
|
|
||||||
, ncurses, libiconv
|
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
# TODO(@Ericson2314) Make unconditional
|
|
||||||
prefix = stdenv.lib.optionalString
|
|
||||||
(targetPlatform != hostPlatform)
|
|
||||||
"${targetPlatform.config}-";
|
|
||||||
|
|
||||||
docFixes = fetchurl {
|
docFixes = fetchurl {
|
||||||
url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
|
url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
|
||||||
sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
|
sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
|
||||||
@ -32,7 +18,7 @@ in
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.10.3";
|
version = "7.10.3";
|
||||||
name = "${prefix}ghc-${version}";
|
name = "ghc-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
|
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
|
||||||
@ -76,7 +62,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# Install the bash completion file.
|
# Install the bash completion file.
|
||||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
|
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
|
||||||
|
|
||||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
@ -87,7 +73,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit bootPkgs prefix;
|
inherit bootPkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
, enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.2.2";
|
version = "7.2.2";
|
||||||
name = "ghc-${version}";
|
name = "ghc-${version}";
|
||||||
@ -54,8 +51,6 @@ stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags=["-S" "--keep-file-symbols"];
|
stripDebugFlags=["-S" "--keep-file-symbols"];
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,35 +1,32 @@
|
|||||||
{ stdenv
|
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
|
||||||
, fetchurl, perl, makeWrapper
|
|
||||||
, ncurses5, gmp, libiconv
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Prebuilt only does native
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.4.2";
|
version = "7.4.2";
|
||||||
|
|
||||||
name = "ghc-${version}-binary";
|
name = "ghc-${version}-binary";
|
||||||
|
|
||||||
src = {
|
src =
|
||||||
"i686-linux" = fetchurl {
|
if stdenv.system == "i686-linux" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
|
||||||
sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
|
sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
|
||||||
};
|
}
|
||||||
"x86_64-linux" = fetchurl {
|
else if stdenv.system == "x86_64-linux" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
||||||
sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
|
sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
|
||||||
};
|
}
|
||||||
"i686-darwin" = fetchurl {
|
else if stdenv.system == "i686-darwin" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
|
||||||
sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
|
sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
|
||||||
};
|
}
|
||||||
"x86_64-darwin" = fetchurl {
|
else if stdenv.system == "x86_64-darwin" then
|
||||||
|
fetchurl {
|
||||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
|
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
|
||||||
sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
|
sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
|
||||||
};
|
}
|
||||||
}.${stdenv.hostPlatform.system}
|
else throw "cannot bootstrap GHC on this platform";
|
||||||
or (throw "cannot bootstrap GHC on this platform");
|
|
||||||
|
|
||||||
buildInputs = [perl];
|
buildInputs = [perl];
|
||||||
|
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.4.2";
|
version = "7.4.2";
|
||||||
|
|
||||||
@ -56,8 +52,6 @@ stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv
|
{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
# The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
|
# The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
|
||||||
# to the gold linker). It prevents binaries' stacks from being marked as
|
# to the gold linker). It prevents binaries' stacks from being marked as
|
||||||
@ -82,8 +78,6 @@ in stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.8.3";
|
version = "7.8.3";
|
||||||
name = "ghc-${version}";
|
name = "ghc-${version}";
|
||||||
@ -53,8 +49,6 @@ stdenv.mkDerivation rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Cross compilation support
|
|
||||||
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
stdenv.mkDerivation (rec {
|
stdenv.mkDerivation (rec {
|
||||||
version = "7.8.4";
|
version = "7.8.4";
|
||||||
name = "ghc-${version}";
|
name = "ghc-${version}";
|
||||||
@ -53,8 +49,6 @@ stdenv.mkDerivation (rec {
|
|||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
passthru = { prefix = ""; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://haskell.org/ghc;
|
homepage = http://haskell.org/ghc;
|
||||||
description = "The Glasgow Haskell Compiler";
|
description = "The Glasgow Haskell Compiler";
|
||||||
|
@ -1,30 +1,18 @@
|
|||||||
{ stdenv, __targetPackages
|
{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
|
||||||
, buildPlatform, hostPlatform, targetPlatform
|
, hscolour, patchutils, sphinx
|
||||||
|
|
||||||
# build-tools
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
, bootPkgs, hscolour
|
|
||||||
, binutils, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx
|
|
||||||
|
|
||||||
, libiconv, ncurses
|
|
||||||
|
|
||||||
, # If enabled GHC will be build with the GPL-free but slower integer-simple
|
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
|
, cross ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
# TODO(@Ericson2314) Make unconditional
|
|
||||||
prefix = stdenv.lib.optionalString
|
|
||||||
(targetPlatform != hostPlatform)
|
|
||||||
"${targetPlatform.config}-";
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "8.0.2";
|
version = "8.0.2";
|
||||||
name = "${prefix}ghc-${version}";
|
name = "ghc-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://downloads.haskell.org/~ghc/8.0.2/${name}-src.tar.xz";
|
url = "https://downloads.haskell.org/~ghc/8.0.2/${name}-src.tar.xz";
|
||||||
@ -59,20 +47,19 @@ stdenv.mkDerivation rec {
|
|||||||
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
|
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
|
||||||
] ++ stdenv.lib.optional stdenv.isDarwin [
|
] ++ stdenv.lib.optional stdenv.isDarwin [
|
||||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||||
] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
|
] ++
|
||||||
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||||
"--disable-large-address-space"
|
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
|
||||||
];
|
|
||||||
|
|
||||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
|
paxmark m $out/lib/${name}/bin/{ghc,haddock}
|
||||||
|
|
||||||
# Install the bash completion file.
|
# Install the bash completion file.
|
||||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
|
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
|
||||||
|
|
||||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
@ -83,7 +70,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit bootPkgs prefix;
|
inherit bootPkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -1,30 +1,16 @@
|
|||||||
{ stdenv, __targetPackages
|
{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
|
||||||
, buildPlatform, hostPlatform, targetPlatform
|
, autoconf, automake, happy, alex, python3, sphinx, hscolour
|
||||||
, selfPkgs, cross ? null
|
, buildPlatform, targetPlatform , selfPkgs, cross ? null
|
||||||
|
|
||||||
# build-tools
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
, bootPkgs, alex, happy, hscolour
|
|
||||||
, autoconf, automake, binutils, coreutils, fetchurl, perl, python3, sphinx
|
|
||||||
|
|
||||||
, libiconv ? null, ncurses
|
|
||||||
|
|
||||||
, # If enabled, GHC will be build with the GPL-free but slower integer-simple
|
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
version = "8.2.1";
|
version = "8.2.1";
|
||||||
|
|
||||||
# TODO(@Ericson2314) Make unconditional
|
|
||||||
prefix = stdenv.lib.optionalString
|
|
||||||
(targetPlatform != hostPlatform)
|
|
||||||
"${targetPlatform.config}-";
|
|
||||||
|
|
||||||
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
|
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
|
||||||
commonPreConfigure = ''
|
commonPreConfigure = ''
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
@ -35,10 +21,9 @@ let
|
|||||||
'' + stdenv.lib.optionalString enableIntegerSimple ''
|
'' + stdenv.lib.optionalString enableIntegerSimple ''
|
||||||
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
|
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
|
||||||
'';
|
'';
|
||||||
in
|
in stdenv.mkDerivation (rec {
|
||||||
stdenv.mkDerivation (rec {
|
|
||||||
inherit version;
|
inherit version;
|
||||||
name = "${prefix}ghc-${version}";
|
name = "ghc-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
|
url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
|
||||||
@ -67,17 +52,15 @@ stdenv.mkDerivation (rec {
|
|||||||
|
|
||||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
checkTarget = "test";
|
checkTarget = "test";
|
||||||
|
|
||||||
# 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 = ''
|
postInstall = ''
|
||||||
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
|
paxmark m $out/lib/${name}/bin/{ghc,haddock}
|
||||||
|
|
||||||
# Install the bash completion file.
|
# Install the bash completion file.
|
||||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
|
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
|
||||||
|
|
||||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
@ -90,7 +73,7 @@ stdenv.mkDerivation (rec {
|
|||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit bootPkgs prefix;
|
inherit bootPkgs;
|
||||||
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
|
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
|
||||||
crossCompiler = selfPkgs.ghc.override {
|
crossCompiler = selfPkgs.ghc.override {
|
||||||
cross = targetPlatform;
|
cross = targetPlatform;
|
||||||
@ -122,7 +105,7 @@ stdenv.mkDerivation (rec {
|
|||||||
"--enable-bootstrap-with-devel-snapshot"
|
"--enable-bootstrap-with-devel-snapshot"
|
||||||
] ++
|
] ++
|
||||||
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||||
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
|
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
|
||||||
|
|
||||||
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
|
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
|
||||||
|
|
||||||
|
@ -1,33 +1,20 @@
|
|||||||
{ stdenv, __targetPackages
|
{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
|
||||||
, buildPlatform, hostPlatform, targetPlatform
|
, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
|
||||||
, selfPkgs, cross ? null
|
, selfPkgs, cross ? null
|
||||||
|
|
||||||
# build-tools
|
# If enabled GHC will be build with the GPL-free but slower integer-simple
|
||||||
, bootPkgs, alex, happy
|
|
||||||
, autoconf, automake, binutils, coreutils, fetchgit, perl, python3
|
|
||||||
|
|
||||||
, libiconv ? null, ncurses
|
|
||||||
|
|
||||||
, # If enabled, GHC will be build with the GPL-free but slower integer-simple
|
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null
|
, enableIntegerSimple ? false, gmp
|
||||||
|
|
||||||
, version ? "8.3.20170808"
|
, version ? "8.3.20170808"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (bootPkgs) ghc;
|
inherit (bootPkgs) ghc;
|
||||||
|
|
||||||
|
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
|
||||||
|
|
||||||
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
|
rev = "14457cf6a50f708eecece8f286f08687791d51f7";
|
||||||
|
|
||||||
# TODO(@Ericson2314) Make unconditional
|
|
||||||
prefix = stdenv.lib.optionalString
|
|
||||||
(targetPlatform != hostPlatform)
|
|
||||||
"${targetPlatform.config}-";
|
|
||||||
|
|
||||||
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
|
|
||||||
commonPreConfigure = ''
|
commonPreConfigure = ''
|
||||||
echo ${version} >VERSION
|
echo ${version} >VERSION
|
||||||
echo ${rev} >GIT_COMMIT_ID
|
echo ${rev} >GIT_COMMIT_ID
|
||||||
@ -40,8 +27,7 @@ let
|
|||||||
'' + stdenv.lib.optionalString enableIntegerSimple ''
|
'' + stdenv.lib.optionalString enableIntegerSimple ''
|
||||||
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
|
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
|
||||||
'';
|
'';
|
||||||
in
|
in stdenv.mkDerivation (rec {
|
||||||
stdenv.mkDerivation (rec {
|
|
||||||
inherit version rev;
|
inherit version rev;
|
||||||
name = "ghc-${version}";
|
name = "ghc-${version}";
|
||||||
|
|
||||||
@ -71,17 +57,15 @@ stdenv.mkDerivation (rec {
|
|||||||
|
|
||||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||||
# that in turn causes GHCi to abort
|
# that in turn causes GHCi to abort
|
||||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
||||||
|
|
||||||
checkTarget = "test";
|
checkTarget = "test";
|
||||||
|
|
||||||
# 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 = ''
|
postInstall = ''
|
||||||
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
|
paxmark m $out/lib/${name}/bin/{ghc,haddock}
|
||||||
|
|
||||||
# Install the bash completion file.
|
# Install the bash completion file.
|
||||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${prefix}ghc
|
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
|
||||||
|
|
||||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
@ -94,7 +78,7 @@ stdenv.mkDerivation (rec {
|
|||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit bootPkgs prefix;
|
inherit bootPkgs;
|
||||||
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
|
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
|
||||||
crossCompiler = selfPkgs.ghc.override {
|
crossCompiler = selfPkgs.ghc.override {
|
||||||
cross = targetPlatform;
|
cross = targetPlatform;
|
||||||
@ -126,7 +110,7 @@ stdenv.mkDerivation (rec {
|
|||||||
"--enable-bootstrap-with-devel-snapshot"
|
"--enable-bootstrap-with-devel-snapshot"
|
||||||
] ++
|
] ++
|
||||||
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||||
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
|
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
|
||||||
|
|
||||||
buildInputs = commonBuildInputs;
|
buildInputs = commonBuildInputs;
|
||||||
|
|
||||||
|
@ -1,14 +1,7 @@
|
|||||||
{ stdenv, buildPackages, ghc
|
{ stdenv, fetchurl, ghc, pkgconfig, glibcLocales, coreutils, gnugrep, gnused
|
||||||
, jailbreak-cabal, hscolour, cpphs, nodejs
|
, jailbreak-cabal, hscolour, cpphs, nodejs, lib, removeReferencesTo
|
||||||
, buildPlatform, hostPlatform
|
|
||||||
}:
|
}:
|
||||||
|
let isCross = (ghc.cross or null) != null; in
|
||||||
let
|
|
||||||
isCross = buildPlatform != hostPlatform;
|
|
||||||
inherit (buildPackages)
|
|
||||||
fetchurl removeReferencesTo
|
|
||||||
pkgconfig binutils coreutils gnugrep gnused glibcLocales;
|
|
||||||
in
|
|
||||||
|
|
||||||
{ pname
|
{ pname
|
||||||
, dontStrip ? (ghc.isGhcjs or false)
|
, dontStrip ? (ghc.isGhcjs or false)
|
||||||
@ -27,8 +20,8 @@ in
|
|||||||
, enableLibraryProfiling ? false
|
, enableLibraryProfiling ? false
|
||||||
, enableExecutableProfiling ? false
|
, enableExecutableProfiling ? false
|
||||||
# TODO enable shared libs for cross-compiling
|
# TODO enable shared libs for cross-compiling
|
||||||
, enableSharedExecutables ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
|
, enableSharedExecutables ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
|
||||||
, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
|
, enableSharedLibraries ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
|
||||||
, enableSplitObjs ? null # OBSOLETE, use enableDeadCodeElimination
|
, enableSplitObjs ? null # OBSOLETE, use enableDeadCodeElimination
|
||||||
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
|
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
|
||||||
, enableStaticLibraries ? true
|
, enableStaticLibraries ? true
|
||||||
@ -60,7 +53,7 @@ in
|
|||||||
, shellHook ? ""
|
, shellHook ? ""
|
||||||
, coreSetup ? false # Use only core packages to build Setup.hs.
|
, coreSetup ? false # Use only core packages to build Setup.hs.
|
||||||
, useCpphs ? false
|
, useCpphs ? false
|
||||||
, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
|
, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
|
||||||
, enableSeparateDataOutput ? false
|
, enableSeparateDataOutput ? false
|
||||||
, enableSeparateDocOutput ? doHaddock
|
, enableSeparateDocOutput ? doHaddock
|
||||||
} @ args:
|
} @ args:
|
||||||
@ -109,12 +102,11 @@ let
|
|||||||
enableParallelBuilding = (versionOlder "7.8" ghc.version && !hasActiveLibrary) || versionOlder "8.0.1" ghc.version;
|
enableParallelBuilding = (versionOlder "7.8" ghc.version && !hasActiveLibrary) || versionOlder "8.0.1" ghc.version;
|
||||||
|
|
||||||
crossCabalFlags = [
|
crossCabalFlags = [
|
||||||
"--with-ghc=${ghc.prefix}ghc"
|
"--with-ghc=${ghc.cross.config}-ghc"
|
||||||
"--with-ghc-pkg=${ghc.prefix}ghc-pkg"
|
"--with-ghc-pkg=${ghc.cross.config}-ghc-pkg"
|
||||||
"--with-gcc=${ghc.prefix}cc"
|
"--with-gcc=${ghc.cc}"
|
||||||
"--with-ld=${ghc.prefix}ld"
|
"--with-ld=${ghc.ld}"
|
||||||
"--with-hsc2hs=${nativeGhc}/bin/hsc2hs"
|
"--with-hsc2hs=${nativeGhc}/bin/hsc2hs"
|
||||||
"--with-strip=${binutils}/bin/${ghc.prefix}strip"
|
|
||||||
] ++ (if isHaLVM then [] else ["--hsc2hs-options=--cross-compile"]);
|
] ++ (if isHaLVM then [] else ["--hsc2hs-options=--cross-compile"]);
|
||||||
|
|
||||||
crossCabalFlagsString =
|
crossCabalFlagsString =
|
||||||
@ -143,7 +135,7 @@ let
|
|||||||
] ++ optionals isGhcjs [
|
] ++ optionals isGhcjs [
|
||||||
"--ghcjs"
|
"--ghcjs"
|
||||||
] ++ optionals isCross ([
|
] ++ optionals isCross ([
|
||||||
"--configure-option=--host=${hostPlatform.config}"
|
"--configure-option=--host=${ghc.cross.config}"
|
||||||
] ++ crossCabalFlags);
|
] ++ crossCabalFlags);
|
||||||
|
|
||||||
setupCompileFlags = [
|
setupCompileFlags = [
|
||||||
@ -178,7 +170,8 @@ let
|
|||||||
setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand;
|
setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand;
|
||||||
setupCommand = "./Setup";
|
setupCommand = "./Setup";
|
||||||
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
|
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
|
||||||
ghcCommand = "${ghc.prefix}${ghcCommand'}";
|
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
|
||||||
|
ghcCommand = "${crossPrefix}${ghcCommand'}";
|
||||||
ghcCommandCaps= toUpper ghcCommand';
|
ghcCommandCaps= toUpper ghcCommand';
|
||||||
|
|
||||||
in
|
in
|
||||||
@ -275,8 +268,6 @@ stdenv.mkDerivation ({
|
|||||||
runHook postCompileBuildDriver
|
runHook postCompileBuildDriver
|
||||||
'';
|
'';
|
||||||
|
|
||||||
inherit configureFlags;
|
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
@ -402,6 +393,7 @@ stdenv.mkDerivation ({
|
|||||||
// optionalAttrs (postCompileBuildDriver != "") { inherit postCompileBuildDriver; }
|
// optionalAttrs (postCompileBuildDriver != "") { inherit postCompileBuildDriver; }
|
||||||
// optionalAttrs (preUnpack != "") { inherit preUnpack; }
|
// optionalAttrs (preUnpack != "") { inherit preUnpack; }
|
||||||
// optionalAttrs (postUnpack != "") { inherit postUnpack; }
|
// optionalAttrs (postUnpack != "") { inherit postUnpack; }
|
||||||
|
// optionalAttrs (configureFlags != []) { inherit configureFlags; }
|
||||||
// optionalAttrs (patches != []) { inherit patches; }
|
// optionalAttrs (patches != []) { inherit patches; }
|
||||||
// optionalAttrs (patchPhase != "") { inherit patchPhase; }
|
// optionalAttrs (patchPhase != "") { inherit patchPhase; }
|
||||||
// optionalAttrs (preConfigure != "") { inherit preConfigure; }
|
// optionalAttrs (preConfigure != "") { inherit preConfigure; }
|
||||||
@ -420,5 +412,5 @@ stdenv.mkDerivation ({
|
|||||||
// optionalAttrs (postFixup != "") { inherit postFixup; }
|
// optionalAttrs (postFixup != "") { inherit postFixup; }
|
||||||
// optionalAttrs (dontStrip) { inherit dontStrip; }
|
// optionalAttrs (dontStrip) { inherit dontStrip; }
|
||||||
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
|
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
|
||||||
// optionalAttrs (buildPlatform.isLinux){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
// optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
||||||
)
|
)
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
# This expression takes a file like `hackage-packages.nix` and constructs
|
# This expression takes a file like `hackage-packages.nix` and constructs
|
||||||
# a full package set out of that.
|
# a full package set out of that.
|
||||||
|
|
||||||
{ # package-set used for build tools (all of nixpkgs)
|
{ # package-set used for non-haskell dependencies (all of nixpkgs)
|
||||||
buildPackages
|
|
||||||
|
|
||||||
, # package-set used for non-haskell dependencies (all of nixpkgs)
|
|
||||||
pkgs
|
pkgs
|
||||||
|
|
||||||
, # stdenv to use for building haskell packages
|
, # stdenv to use for building haskell packages
|
||||||
@ -31,21 +28,19 @@
|
|||||||
self:
|
self:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (stdenv) buildPlatform hostPlatform;
|
|
||||||
|
|
||||||
inherit (stdenv.lib) fix' extends makeOverridable;
|
inherit (stdenv.lib) fix' extends makeOverridable;
|
||||||
inherit (haskellLib) overrideCabal;
|
inherit (haskellLib) overrideCabal;
|
||||||
|
|
||||||
buildHaskellPackages = if hostPlatform != buildPlatform
|
|
||||||
then self.ghc.bootPkgs
|
|
||||||
else self;
|
|
||||||
|
|
||||||
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
|
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
nodejs = buildPackages.nodejs-slim;
|
inherit (pkgs) fetchurl pkgconfig glibcLocales coreutils gnugrep gnused;
|
||||||
inherit (buildHaskellPackages) jailbreak-cabal;
|
nodejs = pkgs.nodejs-slim;
|
||||||
|
jailbreak-cabal = if (self.ghc.cross or null) != null
|
||||||
|
then self.ghc.bootPkgs.jailbreak-cabal
|
||||||
|
else self.jailbreak-cabal;
|
||||||
inherit (self) ghc;
|
inherit (self) ghc;
|
||||||
hscolour = overrideCabal buildHaskellPackages.hscolour (drv: {
|
hscolour = overrideCabal self.hscolour (drv: {
|
||||||
isLibrary = false;
|
isLibrary = false;
|
||||||
doHaddock = false;
|
doHaddock = false;
|
||||||
hyperlinkSource = false; # Avoid depending on hscolour for this build.
|
hyperlinkSource = false; # Avoid depending on hscolour for this build.
|
||||||
@ -109,13 +104,13 @@ let
|
|||||||
haskellSrc2nix = { name, src, sha256 ? null }:
|
haskellSrc2nix = { name, src, sha256 ? null }:
|
||||||
let
|
let
|
||||||
sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"'';
|
sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"'';
|
||||||
in pkgs.buildPackages.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
name = "cabal2nix-${name}";
|
name = "cabal2nix-${name}";
|
||||||
nativeBuildInputs = [ pkgs.buildPackages.haskellPackages.cabal2nix ];
|
buildInputs = [ pkgs.haskellPackages.cabal2nix ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
phases = ["installPhase"];
|
phases = ["installPhase"];
|
||||||
LANG = "en_US.UTF-8";
|
LANG = "en_US.UTF-8";
|
||||||
LOCALE_ARCHIVE = pkgs.lib.optionalString buildPlatform.isLinux "${buildPackages.glibcLocales}/lib/locale/locale-archive";
|
LOCALE_ARCHIVE = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
export HOME="$TMP"
|
export HOME="$TMP"
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
|
@ -36,8 +36,9 @@ let
|
|||||||
isHaLVM = ghc.isHaLVM or false;
|
isHaLVM = ghc.isHaLVM or false;
|
||||||
ghc761OrLater = isGhcjs || isHaLVM || lib.versionOlder "7.6.1" ghc.version;
|
ghc761OrLater = isGhcjs || isHaLVM || lib.versionOlder "7.6.1" ghc.version;
|
||||||
packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
|
packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
|
||||||
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
|
ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
|
||||||
ghcCommand = "${ghc.prefix}${ghcCommand'}";
|
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
|
||||||
|
ghcCommand = "${crossPrefix}${ghcCommand'}";
|
||||||
ghcCommandCaps= lib.toUpper ghcCommand';
|
ghcCommandCaps= lib.toUpper ghcCommand';
|
||||||
libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
|
libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
|
||||||
docDir = "$out/share/doc/ghc/html";
|
docDir = "$out/share/doc/ghc/html";
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
{ haskellPackages, src, deps ? p : [], name }: let
|
{ haskellPackages, src, deps ? p : [], name }: let
|
||||||
inherit (haskellPackages) ghc ghcWithPackages;
|
inherit (haskellPackages) ghc ghcWithPackages;
|
||||||
with-env = ghcWithPackages deps;
|
with-env = ghcWithPackages deps;
|
||||||
ghcName = "${ghc.prefix}ghc";
|
crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
|
||||||
|
ghcName = "${crossPrefix}ghc";
|
||||||
in runCommand name { buildInputs = [ with-env cctools ]; } ''
|
in runCommand name { buildInputs = [ with-env cctools ]; } ''
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
mkdir -p $out/include
|
mkdir -p $out/include
|
||||||
|
Loading…
x
Reference in New Issue
Block a user