git.iko.soy/typeable/nixpkgs
on master help sign in
Merge master-merged PR #29708 into staging
commitff88f7922b4d5c823aee9429b60b8482374c2079 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateSat 23 Sep 2017, 13:12 (9 years ago) parent5eb2c7a2d52156
3 files changed+137−159
pkgs/development/compilers/ghc/6.10.2-binary.nix+37−58 pkgs/development/compilers/ghc/7.0.4-binary.nix+55−56 pkgs/development/compilers/ghc/7.4.2-binary.nix+45−45
pkgs/development/compilers/ghc/6.10.2-binary.nix+37−58
@@ -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− # This binary requires libedit.so.0 (rather than libedit.so.2).
12− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
13− sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
14− }
15− else if stdenv.system == "x86_64-linux" then
16− fetchurl {
17− # Idem.
18− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
19− sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
20− }
21− else throw "cannot bootstrap GHC on this platform";
11+ src = fetchurl ({
12+ "i686-linux" = {
13+ # This binary requires libedit.so.0 (rather than libedit.so.2).
14+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
15+ sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
16+ };
17+ "x86_64-linux" = {
18+ # Idem.
19+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
20+ sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
21+ };
22+ }.${stdenv.hostPlatform.system}
23+ or (throw "cannot bootstrap GHC on this platform"));
2224
2325 buildInputs = [perl];
2426
@@ -27,27 +29,27 @@ stdenv.mkDerivation rec {
2729 # first. The GHC Cabal build system makes use of strip by default and
2830 # has hardcoded paths to /usr/bin/strip in many places. We replace
2931 # those below, making them point to our dummy script.
30− ''
32+ ''
3133 mkdir "$TMP/bin"
3234 for i in strip; do
3335 echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
3436 chmod +x "$TMP/bin/$i"
3537 done
3638 PATH="$TMP/bin:$PATH"
37− '' +
39+ '' +
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
@@ -58,44 +60,21 @@ stdenv.mkDerivation rec {
5860 # calls install-strip ...
5961 dontBuild = true;
6062
61− # The binaries for Darwin use frameworks, so fake those frameworks,
62− # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
63− # that the executables work with no special setup.
64− postInstall =
65− (if stdenv.isDarwin then
66− ''
67− mkdir -p $out/frameworks/GMP.framework/Versions/A
68− ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
69− ln -s ${gmp.out}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP
70− # !!! fix this
71− mkdir -p $out/frameworks/GNUeditline.framework/Versions/A
72− ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline
73− ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline
63+ postInstall = ''
64+ # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
65+ sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp.out}/lib\",\2@" $out/lib/ghc-${version}/package.conf
7466
75− mv $out/bin $out/bin-orig
76− mkdir $out/bin
77− for i in $(cd $out/bin-orig && ls); do
78− echo \"#! $SHELL -e\" >> $out/bin/$i
79− echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
80− chmod +x $out/bin/$i
81− done
82− '' else "")
83− +
84− ''
85− # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
86− sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp.out}/lib\",\2@" $out/lib/ghc-${version}/package.conf
87−
88− # Sanity check, can ghc create executables?
89− cd $TMP
90− mkdir test-ghc; cd test-ghc
91− cat > main.hs << EOF
92− module Main where
93− main = putStrLn "yes"
94− EOF
95− $out/bin/ghc --make main.hs
96− echo compilation ok
97− [ $(./main) == "yes" ]
98− '';
67+ # Sanity check, can ghc create executables?
68+ cd $TMP
69+ mkdir test-ghc; cd test-ghc
70+ cat > main.hs << EOF
71+ module Main where
72+ main = putStrLn "yes"
73+ EOF
74+ $out/bin/ghc --make main.hs
75+ echo compilation ok
76+ [ $(./main) == "yes" ]
77+ '';
9978
10079 meta = {
10180 homepage = http://haskell.org/ghc;
pkgs/development/compilers/ghc/7.0.4-binary.nix+55−56
@@ -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− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
12− sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
16− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
17− sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
21− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
22− sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
26− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
27− sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
28− }
29− else throw "cannot bootstrap GHC on this platform";
11+ src = fetchurl ({
12+ "i686-linux" = {
13+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
14+ sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
15+ };
16+ "x86_64-linux" = {
17+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
18+ sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
19+ };
20+ "i686-darwin" = {
21+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
22+ sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
23+ };
24+ "x86_64-darwin" = {
25+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
26+ sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
27+ };
28+ }.${stdenv.hostPlatform.system}
29+ or (throw "cannot bootstrap GHC on this platform"));
3030
3131 buildInputs = [perl];
3232
@@ -41,22 +41,22 @@ stdenv.mkDerivation rec {
4141 # first. The GHC Cabal build system makes use of strip by default and
4242 # has hardcoded paths to /usr/bin/strip in many places. We replace
4343 # those below, making them point to our dummy script.
44− ''
44+ ''
4545 mkdir "$TMP/bin"
4646 for i in strip; do
4747 echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
4848 chmod +x "$TMP/bin/$i"
4949 done
5050 PATH="$TMP/bin:$PATH"
51− '' +
51+ '' +
5252 # We have to patch the GMP paths for the integer-gmp package.
53− ''
53+ ''
5454 find . -name integer-gmp.buildinfo \
5555 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
56− '' + stdenv.lib.optionalString stdenv.isDarwin ''
56+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
5757 find . -name base.buildinfo \
5858 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
59− '' +
59+ '' +
6060 # On Linux, use patchelf to modify the executables so that they can
6161 # find editline/gmp.
6262 stdenv.lib.optionalString stdenv.isLinux ''
@@ -68,24 +68,24 @@ stdenv.mkDerivation rec {
6868 for prog in ld ar gcc strip ranlib; do
6969 find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
7070 done
71− '' + stdenv.lib.optionalString stdenv.isDarwin ''
72− # not enough room in the object files for the full path to libiconv :(
73− fix () {
74− install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1
75− }
71+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
72+ # not enough room in the object files for the full path to libiconv :(
73+ fix () {
74+ install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1
75+ }
7676
77− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/utils/ghc-pwd/dist/build/tmp
78− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/utils/hpc/dist/build/tmp
79− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.0.4/ghc/stage2/build/tmp
77+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/ghc-pwd/dist/build/tmp
78+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/hpc/dist/build/tmp
79+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/ghc/stage2/build/tmp
8080
81− for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do
82− fix $(find . -type f -name $file)
83− done
81+ for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do
82+ fix $(find . -type f -name $file)
83+ done
8484
85− for file in $(find . -name setup-config); do
86− substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
87− done
88− '';
85+ for file in $(find . -name setup-config); do
86+ substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
87+ done
88+ '';
8989
9090 configurePhase = ''
9191 ./configure --prefix=$out \
@@ -101,19 +101,18 @@ stdenv.mkDerivation rec {
101101 # calls install-strip ...
102102 dontBuild = true;
103103
104− postInstall =
105− ''
106− # Sanity check, can ghc create executables?
107− cd $TMP
108− mkdir test-ghc; cd test-ghc
109− cat > main.hs << EOF
110− module Main where
111− main = putStrLn "yes"
112− EOF
113− $out/bin/ghc --make main.hs
114− echo compilation ok
115− [ $(./main) == "yes" ]
116− '';
104+ postInstall = ''
105+ # Sanity check, can ghc create executables?
106+ cd $TMP
107+ mkdir test-ghc; cd test-ghc
108+ cat > main.hs << EOF
109+ module Main where
110+ main = putStrLn "yes"
111+ EOF
112+ $out/bin/ghc --make main.hs
113+ echo compilation ok
114+ [ $(./main) == "yes" ]
115+ '';
117116
118117 meta.license = stdenv.lib.licenses.bsd3;
119118 meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
pkgs/development/compilers/ghc/7.4.2-binary.nix+45−45
@@ -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− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
12− sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
13− }
14− else if stdenv.system == "x86_64-linux" then
15− fetchurl {
16− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
17− sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
18− }
19− else if stdenv.system == "i686-darwin" then
20− fetchurl {
21− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
22− sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
23− }
24− else if stdenv.system == "x86_64-darwin" then
25− fetchurl {
26− url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
27− sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
28− }
29− else throw "cannot bootstrap GHC on this platform";
11+ src = fetchurl ({
12+ "i686-linux" = {
13+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
14+ sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
15+ };
16+ "x86_64-linux" = {
17+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
18+ sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
19+ };
20+ "i686-darwin" = {
21+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
22+ sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
23+ };
24+ "x86_64-darwin" = {
25+ url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
26+ sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
27+ };
28+ }.${stdenv.hostPlatform.system}
29+ or (throw "cannot bootstrap GHC on this platform"));
3030
3131 buildInputs = [perl];
3232
@@ -41,22 +41,22 @@ stdenv.mkDerivation rec {
4141 # first. The GHC Cabal build system makes use of strip by default and
4242 # has hardcoded paths to /usr/bin/strip in many places. We replace
4343 # those below, making them point to our dummy script.
44− ''
44+ ''
4545 mkdir "$TMP/bin"
4646 for i in strip; do
4747 echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
4848 chmod +x "$TMP/bin/$i"
4949 done
5050 PATH="$TMP/bin:$PATH"
51− '' +
51+ '' +
5252 # We have to patch the GMP paths for the integer-gmp package.
53− ''
53+ ''
5454 find . -name integer-gmp.buildinfo \
5555 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
56− '' + stdenv.lib.optionalString stdenv.isDarwin ''
56+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
5757 find . -name base.buildinfo \
5858 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
59− '' +
59+ '' +
6060 # On Linux, use patchelf to modify the executables so that they can
6161 # find editline/gmp.
6262 stdenv.lib.optionalString stdenv.isLinux ''
@@ -73,24 +73,24 @@ stdenv.mkDerivation rec {
7373 for prog in ld ar gcc strip ranlib; do
7474 find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
7575 done
76− '' + stdenv.lib.optionalString stdenv.isDarwin ''
77− # not enough room in the object files for the full path to libiconv :(
78− fix () {
79− install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1
80− }
76+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
77+ # not enough room in the object files for the full path to libiconv :(
78+ fix () {
79+ install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1
80+ }
8181
82− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/ghc-pwd/dist-install/build/tmp
83− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/hpc/dist-install/build/tmp
84− ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/ghc/stage2/build/tmp
82+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/ghc-pwd/dist-install/build/tmp
83+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/utils/hpc/dist-install/build/tmp
84+ ln -s ${libiconv}/lib/libiconv.dylib ghc-${version}/ghc/stage2/build/tmp
8585
86− for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do
87− fix $(find . -type f -name $file)
88− done
86+ for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do
87+ fix $(find . -type f -name $file)
88+ done
8989
90− for file in $(find . -name setup-config); do
91− substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
92− done
93− '';
90+ for file in $(find . -name setup-config); do
91+ substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
92+ done
93+ '';
9494
9595 configurePhase = ''
9696 ./configure --prefix=$out \
@@ -107,10 +107,10 @@ stdenv.mkDerivation rec {
107107 dontBuild = true;
108108
109109 preInstall = stdenv.lib.optionalString stdenv.isDarwin ''
110− mkdir -p $out/lib/ghc-7.4.2
110+ mkdir -p $out/lib/ghc-${version}
111111 mkdir -p $out/bin
112112 ln -s ${libiconv}/lib/libiconv.dylib $out/bin
113− ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-7.4.2/libiconv.dylib
113+ ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-${version}/libiconv.dylib
114114 ln -s ${libiconv}/lib/libiconv.dylib utils/ghc-cabal/dist-install/build/tmp
115115 '';
116116