Skip to content

Commit

Permalink
Revert "haskell infra, ghc: Slight cleanup"
Browse files Browse the repository at this point in the history
  • Loading branch information
peti committed Sep 15, 2017
1 parent 666f60b commit 3510197
Show file tree
Hide file tree
Showing 20 changed files with 132 additions and 272 deletions.
33 changes: 14 additions & 19 deletions pkgs/development/compilers/ghc/6.10.2-binary.nix
@@ -1,29 +1,24 @@
{ stdenv
, fetchurl, perl
, libedit, ncurses5, gmp
}:

# Prebuilt only does native
assert stdenv.targetPlatform == stdenv.hostPlatform;
{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:

stdenv.mkDerivation rec {
version = "6.10.2";

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

src = {
"i686-linux" = fetchurl {
src =
if stdenv.system == "i686-linux" then
fetchurl {
# 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";
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
};
"x86_64-linux" = fetchurl {
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
# Idem.
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
};
}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform");
}
else throw "cannot bootstrap GHC on this platform";

buildInputs = [perl];

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

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
Expand All @@ -67,7 +62,7 @@ stdenv.mkDerivation rec {
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
# that the executables work with no special setup.
postInstall =
stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
(if stdenv.isDarwin then
''
mkdir -p $out/frameworks/GMP.framework/Versions/A
ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
Expand All @@ -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
chmod +x $out/bin/$i
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
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/compilers/ghc/6.10.4.nix
@@ -1,8 +1,5 @@
{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:

# TODO(@Ericson2314): Cross compilation support
assert stdenv.targetPlatform == stdenv.hostPlatform;

stdenv.mkDerivation rec {
version = "6.10.4";

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

NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";

passthru = { prefix = ""; };

meta = {
homepage = http://haskell.org/ghc;
description = "The Glasgow Haskell Compiler";
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/compilers/ghc/6.12.3.nix
@@ -1,8 +1,5 @@
{stdenv, fetchurl, ghc, perl, gmp, ncurses}:

# TODO(@Ericson2314): Cross compilation support
assert stdenv.targetPlatform == stdenv.hostPlatform;

stdenv.mkDerivation rec {
version = "6.12.3";

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

passthru = { prefix = ""; };

meta = {
homepage = http://haskell.org/ghc;
description = "The Glasgow Haskell Compiler";
Expand Down
33 changes: 15 additions & 18 deletions pkgs/development/compilers/ghc/7.0.4-binary.nix
@@ -1,35 +1,32 @@
{ stdenv
, fetchurl, perl
, ncurses5, gmp, libiconv
}:

# Prebuilt only does native
assert stdenv.targetPlatform == stdenv.hostPlatform;
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:

stdenv.mkDerivation rec {
version = "7.0.4";

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

src = {
"i686-linux" = fetchurl {
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
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";
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";
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";
sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
};
}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform");
}
else throw "cannot bootstrap GHC on this platform";

buildInputs = [perl];

Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/compilers/ghc/7.0.4.nix
@@ -1,8 +1,5 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:

# TODO(@Ericson2314): Cross compilation support
assert stdenv.targetPlatform == stdenv.hostPlatform;

stdenv.mkDerivation rec {
version = "7.0.4";
name = "ghc-${version}";
Expand Down Expand Up @@ -45,8 +42,6 @@ stdenv.mkDerivation rec {
# that in turn causes GHCi to abort
stripDebugFlags=["-S" "--keep-file-symbols"];

passthru = { prefix = ""; };

meta = {
homepage = http://haskell.org/ghc;
description = "The Glasgow Haskell Compiler";
Expand Down
28 changes: 7 additions & 21 deletions pkgs/development/compilers/ghc/7.10.2.nix
@@ -1,28 +1,14 @@
{ stdenv, __targetPackages
, buildPlatform, hostPlatform, targetPlatform
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour

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

assert !enableIntegerSimple -> gmp != null;

let
inherit (bootPkgs) ghc;

# TODO(@Ericson2314) Make unconditional
prefix = stdenv.lib.optionalString
(targetPlatform != hostPlatform)
"${targetPlatform.config}-";

buildMK = ''
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
Expand All @@ -41,7 +27,7 @@ in

stdenv.mkDerivation rec {
version = "7.10.2";
name = "${prefix}ghc-${version}";
name = "ghc-${version}";

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

postInstall = ''
# 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.
for i in "$out/bin/"*; do
Expand All @@ -89,7 +75,7 @@ stdenv.mkDerivation rec {
'';

passthru = {
inherit bootPkgs prefix;
inherit bootPkgs;
};

meta = {
Expand Down
28 changes: 7 additions & 21 deletions pkgs/development/compilers/ghc/7.10.3.nix
@@ -1,28 +1,14 @@
{ stdenv, __targetPackages
, buildPlatform, hostPlatform, targetPlatform
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour

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

assert !enableIntegerSimple -> gmp != null;

let
inherit (bootPkgs) ghc;

# TODO(@Ericson2314) Make unconditional
prefix = stdenv.lib.optionalString
(targetPlatform != hostPlatform)
"${targetPlatform.config}-";

docFixes = fetchurl {
url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
Expand All @@ -32,7 +18,7 @@ in

stdenv.mkDerivation rec {
version = "7.10.3";
name = "${prefix}ghc-${version}";
name = "ghc-${version}";

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

postInstall = ''
# 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.
for i in "$out/bin/"*; do
Expand All @@ -87,7 +73,7 @@ stdenv.mkDerivation rec {
'';

passthru = {
inherit bootPkgs prefix;
inherit bootPkgs;
};

meta = {
Expand Down
7 changes: 1 addition & 6 deletions pkgs/development/compilers/ghc/7.2.2.nix
Expand Up @@ -2,12 +2,9 @@

# If enabled GHC will be build with the GPL-free but slower integer-simple
# 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 {
version = "7.2.2";
name = "ghc-${version}";
Expand Down Expand Up @@ -54,8 +51,6 @@ stdenv.mkDerivation rec {
# that in turn causes GHCi to abort
stripDebugFlags=["-S" "--keep-file-symbols"];

passthru = { prefix = ""; };

meta = {
homepage = http://haskell.org/ghc;
description = "The Glasgow Haskell Compiler";
Expand Down
33 changes: 15 additions & 18 deletions pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -1,35 +1,32 @@
{ stdenv
, fetchurl, perl, makeWrapper
, ncurses5, gmp, libiconv
}:

# Prebuilt only does native
assert stdenv.targetPlatform == stdenv.hostPlatform;
{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:

stdenv.mkDerivation rec {
version = "7.4.2";

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

src = {
"i686-linux" = fetchurl {
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
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";
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";
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";
sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
};
}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform");
}
else throw "cannot bootstrap GHC on this platform";

buildInputs = [perl];

Expand Down

0 comments on commit 3510197

Please sign in to comment.