* 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:
Eelco Dolstra
2009-04-16 19:25:22 +00:00
parent d182df5526
commit 79cb8d11a6
11 changed files with 98 additions and 139 deletions

View File

@@ -1,34 +0,0 @@
source $stdenv/setup
export HOME=$(pwd)/fake-home
makeWrapper() {
wrapperBase="$1"
wrapperName="$2"
wrapper="$out/$wrapperName"
shift; shift #the other arguments are passed to the source app
echo '#!'"$SHELL" > "$wrapper"
echo "exec \"$wrapperBase/$wrapperName\" $@" '"$@"' > "$wrapper"
chmod +x "$wrapper"
}
mkdir -p $out/nix-support $out/bin
packages_db=$out/nix-support/package.conf
#create packages database (start with compiler base packages)
cp $ghc/lib/ghc-*/package.conf $packages_db
chmod +w $packages_db
for lib in $libraries; do
sh $lib/nix-support/register.sh $packages_db || exit 1
done
rm -f $packages_db.old
#create the wrappers
#NB: The double dash for ghc-pkg is not a typo!
makeWrapper $ghc "bin/ghc" "-package-conf" $packages_db
makeWrapper $ghc "bin/ghci" "-package-conf" $packages_db
makeWrapper $ghc "bin/runghc" "-package-conf" $packages_db
makeWrapper $ghc "bin/runhaskell" "-package-conf" $packages_db
makeWrapper $ghc "bin/ghc-pkg" "--global-conf" $packages_db
# todo: link all other binaries of ghc

View File

@@ -1,7 +0,0 @@
{stdenv, ghc, libraries}:
stdenv.mkDerivation {
inherit (ghc) name meta;
inherit ghc libraries;
builder = ./builder.sh;
}

View File

@@ -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" ]
'';
}

View File

@@ -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 "";
}

View File

@@ -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;
})

View File

@@ -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;
})

View File

@@ -9,7 +9,7 @@ let
buildInputs = with args; [
zlib sqlite gmp libffi cairo ncurses freetype mesa
libpng libtiff libjpeg readline libsndfile libxml2
freeglut e2fsprogs libsamplerate pcre libevent editline
freeglut e2fsprogs libsamplerate pcre libevent libedit
];
in
rec {

View File

@@ -1,10 +0,0 @@
{ stdenv, fetchurl, ncurses }:
stdenv.mkDerivation {
name = "editline-2.11";
src = fetchurl {
url = http://www.thrysoee.dk/editline/libedit-20080712-2.11.tar.gz;
sha256 = "6ff51a15d1ada16c44be0f32a539b492cd3b0286c3dfa413915525f55851d1e6";
};
propagatedBuildInputs = [ ncurses ];
}

View File

@@ -1,10 +1,10 @@
{ cabal, editline } :
{ cabal, libedit } :
cabal.mkDerivation (self : {
pname = "editline";
version = "0.2";
sha256 = "6ee0b553cc8d7542c096730ceebabdcb9b2951d7b00a5a0ddbf47b5436a77ce4";
propagatedBuildInputs = [ editline ];
propagatedBuildInputs = [ libedit ];
patchLibFiles = [ "editline.buildinfo.in" ];
preConfigure = ''
sed -i -e '/el_get/d' include/HsEditline.h

View File

@@ -0,0 +1,17 @@
{ stdenv, fetchurl, ncurses }:
stdenv.mkDerivation {
name = "libedit-20090405-3.0";
src = fetchurl {
url = http://www.thrysoee.dk/editline/libedit-20090405-3.0.tar.gz;
sha256 = "1il68apydk6nnm30v8gn61vbi23ii571bixp7662j96xsivy7z5l";
};
propagatedBuildInputs = [ ncurses ];
meta = {
homepage = "http://www.thrysoee.dk/editline/";
description = "A port of the NetBSD Editline library (libedit)";
};
}