* editline: renamed to libedit (which seems to be the proper name for
the package). * Removed the old ghc-wrapper, which hasn't been used for a long time. * Renamed the "boot" GHC to "binary", which is more descriptive. (They *can* be used for other things than bootstrapping a GHC source build.) * Updated the GHC 6.10.1 binary to 6.10.2. svn path=/nixpkgs/trunk/; revision=15095
This commit is contained in:
+42
-42
@@ -1,22 +1,22 @@
|
||||
{stdenv, fetchurl, perl, editline, ncurses, gmp, makeWrapper}:
|
||||
{stdenv, fetchurl, perl, libedit, ncurses, gmp, makeWrapper}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "6.10.1";
|
||||
version = "6.10.2-binary";
|
||||
|
||||
name = "ghc-${version}";
|
||||
|
||||
src =
|
||||
if stdenv.system == "i686-linux" then
|
||||
fetchurl {
|
||||
# libedit .so.0
|
||||
# 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 = "18l0vwlf7y86s65klpdvz4ccp8kydvcmyh03c86hld8jvx16q7zz";
|
||||
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
|
||||
}
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
fetchurl {
|
||||
# libedit .so.0
|
||||
# Idem.
|
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
|
||||
sha256 = "14jvvn333i36wm7mmvi47jr93f5hxrw1h2dpjvqql0rp00svhzzg";
|
||||
sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
|
||||
}
|
||||
else if stdenv.system == "i686-darwin" then
|
||||
fetchurl {
|
||||
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
|
||||
(if stdenv.isLinux then ''
|
||||
find . -type f -perm +100 \
|
||||
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${editline}/lib:${ncurses}/lib:${gmp}/lib" {} \;
|
||||
--set-rpath "${libedit}/lib:${ncurses}/lib:${gmp}/lib" {} \;
|
||||
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
|
||||
@@ -61,46 +61,46 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# No building is necessary, but calling make without flags ironically
|
||||
# calls install-strip ...
|
||||
buildPhase = ":";
|
||||
buildPhase = "true";
|
||||
|
||||
# The binaries for Darwin use frameworks, so fake those frameworks,
|
||||
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
|
||||
# that the executables work with no special setup.
|
||||
postInstall = (if stdenv.isDarwin then "
|
||||
postInstall =
|
||||
(if stdenv.isDarwin then
|
||||
''
|
||||
ensureDir $out/frameworks/GMP.framework/Versions/A
|
||||
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
|
||||
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP
|
||||
# !!! fix this
|
||||
ensureDir $out/frameworks/GNUeditline.framework/Versions/A
|
||||
ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline
|
||||
ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline
|
||||
|
||||
ensureDir $out/frameworks/GMP.framework/Versions/A
|
||||
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
|
||||
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP
|
||||
ensureDir $out/frameworks/GNUeditline.framework/Versions/A
|
||||
ln -s ${editline}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline
|
||||
ln -s ${editline}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline
|
||||
mv $out/bin $out/bin-orig
|
||||
mkdir $out/bin
|
||||
for i in $(cd $out/bin-orig && ls); do
|
||||
echo \"#! $SHELL -e\" >> $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
|
||||
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
|
||||
sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp}/lib\",\2@" $out/lib/ghc-${version}/package.conf
|
||||
|
||||
mv $out/bin $out/bin-orig
|
||||
mkdir $out/bin
|
||||
for i in $(cd $out/bin-orig && ls); do
|
||||
echo \"#! $SHELL -e\" >> $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
|
||||
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
|
||||
sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp}/lib\",\2@" $out/lib/ghc-${version}/package.conf
|
||||
|
||||
wrapProgram $out/bin/ghc --set LDPATH "${gmp}/lib"
|
||||
# sanity check, can ghc create executables?
|
||||
cd $TMP
|
||||
mkdir test-ghc; cd test-ghc
|
||||
cat > main.hs << EOF
|
||||
module Main where
|
||||
main = putStrLn "yes"
|
||||
EOF
|
||||
$out/bin/ghc --make main.hs
|
||||
echo compilation ok
|
||||
[ $(./main) == "yes" ]
|
||||
''
|
||||
;
|
||||
wrapProgram $out/bin/ghc --set LDPATH "${gmp}/lib"
|
||||
# sanity check, can ghc create executables?
|
||||
cd $TMP
|
||||
mkdir test-ghc; cd test-ghc
|
||||
cat > main.hs << EOF
|
||||
module Main where
|
||||
main = putStrLn "yes"
|
||||
EOF
|
||||
$out/bin/ghc --make main.hs
|
||||
echo compilation ok
|
||||
[ $(./main) == "yes" ]
|
||||
'';
|
||||
|
||||
}
|
||||
+9
-6
@@ -1,7 +1,7 @@
|
||||
{stdenv, fetchurl, perl, readline, ncurses, gmp}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = if stdenv.system == "i686-darwin" then "ghc-6.6.1" else "ghc-6.4.2";
|
||||
name = if stdenv.system == "i686-darwin" then "ghc-6.6.1-binary" else "ghc-6.4.2-binary";
|
||||
|
||||
src =
|
||||
if stdenv.system == "i686-linux" then
|
||||
@@ -15,6 +15,9 @@ stdenv.mkDerivation {
|
||||
md5 = "8f5fe48798f715cd05214a10987bf6d5";
|
||||
}
|
||||
else if stdenv.system == "i686-darwin" then
|
||||
/* Yes, this isn't GHC 6.4.2. But IIRC either there was no
|
||||
6.4.2 binary for Darwin, or it didn't work. In any case, in
|
||||
Nixpkgs we just need this bootstrapping a "real" GHC. */
|
||||
fetchurl {
|
||||
url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-i386-apple-darwin.tar.bz2;
|
||||
sha256 = "1drbsicanr6jlykvs4vs6gbi2q9ac1bcaxz2vzwh3pfv3lfibwia";
|
||||
@@ -38,7 +41,7 @@ stdenv.mkDerivation {
|
||||
# The binaries for Darwin use frameworks, so fake those frameworks,
|
||||
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
|
||||
# that the executables work with no special setup.
|
||||
postInstall = if stdenv.isDarwin then "
|
||||
postInstall = if stdenv.isDarwin then ''
|
||||
|
||||
ensureDir $out/frameworks/GMP.framework/Versions/A
|
||||
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
|
||||
@@ -50,13 +53,13 @@ stdenv.mkDerivation {
|
||||
mkdir $out/bin-orig
|
||||
for i in $(cd $out/bin && ls *); do
|
||||
mv $out/bin/$i $out/bin-orig/$i
|
||||
echo \"#! $SHELL -e\" >> $out/bin/$i
|
||||
echo "#! $SHELL -e" >> $out/bin/$i
|
||||
extraFlag=
|
||||
if test $i != ghc-pkg; then extraFlag=\"-framework-path $out/frameworks\"; fi
|
||||
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i $extraFlag \\\"\\$@\\\"\" >> $out/bin/$i
|
||||
if test $i != ghc-pkg; then extraFlag="-framework-path $out/frameworks"; fi
|
||||
echo "DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i $extraFlag \"\$@\"" >> $out/bin/$i
|
||||
chmod +x $out/bin/$i
|
||||
done
|
||||
|
||||
" else "";
|
||||
'' else "";
|
||||
|
||||
}
|
||||
@@ -24,14 +24,11 @@ stdenv.mkDerivation (rec {
|
||||
"--with-gmp-libraries=${gmp}/lib"
|
||||
"--with-gmp-includes=${gmp}/include"
|
||||
"--with-readline-libraries=${readline}/lib"
|
||||
"--with-gcc=${gcc}/bin/gcc"
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
preConfigure = "
|
||||
# still requires a hack for ncurses
|
||||
sed -i \"s|^\\\(ld-options.*$\\\)|\\\1 -L${ncurses}/lib|\" libraries/readline/readline.buildinfo.in
|
||||
";
|
||||
|
||||
inherit (stdenv) gcc;
|
||||
inherit readline gmp ncurses;
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ stdenv.mkDerivation (rec {
|
||||
"--with-gmp-libraries=${gmp}/lib"
|
||||
"--with-gmp-includes=${gmp}/include"
|
||||
"--with-readline-libraries=${readline}/lib"
|
||||
"--with-gcc=${gcc}/bin/gcc"
|
||||
"--with-gcc=${stdenv.gcc}/bin/gcc"
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
@@ -34,7 +34,4 @@ stdenv.mkDerivation (rec {
|
||||
'';
|
||||
|
||||
installTargets = ["install" "install-docs"];
|
||||
|
||||
inherit (stdenv) gcc;
|
||||
inherit readline gmp ncurses;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user