git.iko.soy/typeable/nixpkgs
on master help sign in
ghc prebuilt: Clean up syntax, without changes hashes

If I'm going to make a bunch more of these, I think it's a good idea to make them more uniform first.

commita8ef3f67420fb9b87c5b238c8fc93d4cda446a34 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateSun 10 Sep 2017, 15:36 (9 years ago) parent17de435
3 files changed+45−43
pkgs/development/compilers/ghc/6.10.2-binary.nix+15−13 pkgs/development/compilers/ghc/7.0.4-binary.nix+15−15 pkgs/development/compilers/ghc/7.4.2-binary.nix+15−15
pkgs/development/compilers/ghc/6.10.2-binary.nix+15−13
@@ -1,24 +1,26 @@
1−{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:
1+{ stdenv
2+, fetchurl, perl
3+, libedit, ncurses5, gmp
4+}:
25
36stdenv.mkDerivation rec {
47 version = "6.10.2";
58
69 name = "ghc-${version}-binary";
710
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
11+ src = fetchurl ({
12+ "i686-linux" = {
1113 # This binary requires libedit.so.0 (rather than libedit.so.2).
1214 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1315 sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
14− }
15− else if stdenv.system == "x86_64-linux" then
16− fetchurl {
16+ };
17+ "x86_64-linux" = {
1718 # Idem.
1819 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1920 sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
20− }
21− else throw "cannot bootstrap GHC on this platform";
21+ };
22+ }.${stdenv.hostPlatform.system}
23+ or (throw "cannot bootstrap GHC on this platform"));
2224
2325 buildInputs = [perl];
2426
@@ -37,17 +39,17 @@ stdenv.mkDerivation rec {
3739 '' +
3840 # On Linux, use patchelf to modify the executables so that they can
3941 # find editline/gmp.
40− (if stdenv.isLinux then ''
42+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
4143 find . -type f -perm -0100 \
4244 -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
43− --set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
45+ --set-rpath "${stdenv.lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
4446 for prog in ld ar gcc strip ranlib; do
4547 find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
4648 done
47− '' else "");
49+ '';
4850
4951 configurePhase = ''
50− ./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
52+ ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
5153 '';
5254
5355 # Stripping combined with patchelf breaks the executables (they die
pkgs/development/compilers/ghc/7.0.4-binary.nix+15−15
@@ -1,32 +1,32 @@
1−{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:
1+{ stdenv
2+, fetchurl, perl
3+, ncurses5, gmp, libiconv
4+}:
25
36stdenv.mkDerivation rec {
47 version = "7.0.4";
58
69 name = "ghc-${version}-binary";
710
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
11+ src = fetchurl ({
12+ "i686-linux" = {
1113 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1214 sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
15+ };
16+ "x86_64-linux" = {
1617 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1718 sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
19+ };
20+ "i686-darwin" = {
2121 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2222 sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
23+ };
24+ "x86_64-darwin" = {
2625 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2726 sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
28− }
29− else throw "cannot bootstrap GHC on this platform";
27+ };
28+ }.${stdenv.hostPlatform.system}
29+ or (throw "cannot bootstrap GHC on this platform"));
3030
3131 buildInputs = [perl];
3232
pkgs/development/compilers/ghc/7.4.2-binary.nix+15−15
@@ -1,32 +1,32 @@
1−{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
1+{ stdenv
2+, fetchurl, perl, makeWrapper
3+, ncurses5, gmp, libiconv
4+}:
25
36stdenv.mkDerivation rec {
47 version = "7.4.2";
58
69 name = "ghc-${version}-binary";
710
8− src =
9− if stdenv.system == "i686-linux" then
10− fetchurl {
11+ src = fetchurl ({
12+ "i686-linux" = {
1113 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
1214 sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
15+ };
16+ "x86_64-linux" = {
1617 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
1718 sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
19+ };
20+ "i686-darwin" = {
2121 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
2222 sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
23+ };
24+ "x86_64-darwin" = {
2625 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
2726 sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
28− }
29− else throw "cannot bootstrap GHC on this platform";
27+ };
28+ }.${stdenv.hostPlatform.system}
29+ or (throw "cannot bootstrap GHC on this platform"));
3030
3131 buildInputs = [perl];
3232