* 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 { stdenv.mkDerivation rec {
version = "6.10.1"; version = "6.10.2-binary";
name = "ghc-${version}"; name = "ghc-${version}";
src = src =
if stdenv.system == "i686-linux" then if stdenv.system == "i686-linux" then
fetchurl { 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"; 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 else if stdenv.system == "x86_64-linux" then
fetchurl { fetchurl {
# libedit .so.0 # Idem.
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 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 else if stdenv.system == "i686-darwin" then
fetchurl { fetchurl {
@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
(if stdenv.isLinux then '' (if stdenv.isLinux then ''
find . -type f -perm +100 \ find . -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ -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 for prog in ld ar gcc strip ranlib; do
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
done done
@ -61,46 +61,46 @@ stdenv.mkDerivation rec {
# No building is necessary, but calling make without flags ironically # No building is necessary, but calling make without flags ironically
# calls install-strip ... # calls install-strip ...
buildPhase = ":"; buildPhase = "true";
# The binaries for Darwin use frameworks, so fake those frameworks, # The binaries for Darwin use frameworks, so fake those frameworks,
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
# that the executables work with no special setup. # 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 mv $out/bin $out/bin-orig
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP mkdir $out/bin
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP for i in $(cd $out/bin-orig && ls); do
ensureDir $out/frameworks/GNUeditline.framework/Versions/A echo \"#! $SHELL -e\" >> $out/bin/$i
ln -s ${editline}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
ln -s ${editline}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline 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 wrapProgram $out/bin/ghc --set LDPATH "${gmp}/lib"
mkdir $out/bin # sanity check, can ghc create executables?
for i in $(cd $out/bin-orig && ls); do cd $TMP
echo \"#! $SHELL -e\" >> $out/bin/$i mkdir test-ghc; cd test-ghc
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i cat > main.hs << EOF
chmod +x $out/bin/$i module Main where
done main = putStrLn "yes"
EOF
" else "") $out/bin/ghc --make main.hs
+ echo compilation ok
'' [ $(./main) == "yes" ]
# 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" ]
''
;
} }

View File

@ -1,7 +1,7 @@
{stdenv, fetchurl, perl, readline, ncurses, gmp}: {stdenv, fetchurl, perl, readline, ncurses, gmp}:
stdenv.mkDerivation { 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 = src =
if stdenv.system == "i686-linux" then if stdenv.system == "i686-linux" then
@ -15,6 +15,9 @@ stdenv.mkDerivation {
md5 = "8f5fe48798f715cd05214a10987bf6d5"; md5 = "8f5fe48798f715cd05214a10987bf6d5";
} }
else if stdenv.system == "i686-darwin" then 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 { fetchurl {
url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-i386-apple-darwin.tar.bz2; url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-i386-apple-darwin.tar.bz2;
sha256 = "1drbsicanr6jlykvs4vs6gbi2q9ac1bcaxz2vzwh3pfv3lfibwia"; sha256 = "1drbsicanr6jlykvs4vs6gbi2q9ac1bcaxz2vzwh3pfv3lfibwia";
@ -38,7 +41,7 @@ stdenv.mkDerivation {
# The binaries for Darwin use frameworks, so fake those frameworks, # The binaries for Darwin use frameworks, so fake those frameworks,
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
# that the executables work with no special setup. # 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 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/GMP
@ -50,13 +53,13 @@ stdenv.mkDerivation {
mkdir $out/bin-orig mkdir $out/bin-orig
for i in $(cd $out/bin && ls *); do for i in $(cd $out/bin && ls *); do
mv $out/bin/$i $out/bin-orig/$i mv $out/bin/$i $out/bin-orig/$i
echo \"#! $SHELL -e\" >> $out/bin/$i echo "#! $SHELL -e" >> $out/bin/$i
extraFlag= extraFlag=
if test $i != ghc-pkg; then extraFlag=\"-framework-path $out/frameworks\"; fi 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 echo "DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i $extraFlag \"\$@\"" >> $out/bin/$i
chmod +x $out/bin/$i chmod +x $out/bin/$i
done done
" else ""; '' else "";
} }

View File

@ -24,14 +24,11 @@ stdenv.mkDerivation (rec {
"--with-gmp-libraries=${gmp}/lib" "--with-gmp-libraries=${gmp}/lib"
"--with-gmp-includes=${gmp}/include" "--with-gmp-includes=${gmp}/include"
"--with-readline-libraries=${readline}/lib" "--with-readline-libraries=${readline}/lib"
"--with-gcc=${gcc}/bin/gcc" "--with-gcc=${stdenv.gcc}/bin/gcc"
]; ];
preConfigure = " preConfigure = "
# still requires a hack for ncurses # still requires a hack for ncurses
sed -i \"s|^\\\(ld-options.*$\\\)|\\\1 -L${ncurses}/lib|\" libraries/readline/readline.buildinfo.in 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-libraries=${gmp}/lib"
"--with-gmp-includes=${gmp}/include" "--with-gmp-includes=${gmp}/include"
"--with-readline-libraries=${readline}/lib" "--with-readline-libraries=${readline}/lib"
"--with-gcc=${gcc}/bin/gcc" "--with-gcc=${stdenv.gcc}/bin/gcc"
]; ];
preConfigure = '' preConfigure = ''
@ -34,7 +34,4 @@ stdenv.mkDerivation (rec {
''; '';
installTargets = ["install" "install-docs"]; installTargets = ["install" "install-docs"];
inherit (stdenv) gcc;
inherit readline gmp ncurses;
}) })

View File

@ -9,7 +9,7 @@ let
buildInputs = with args; [ buildInputs = with args; [
zlib sqlite gmp libffi cairo ncurses freetype mesa zlib sqlite gmp libffi cairo ncurses freetype mesa
libpng libtiff libjpeg readline libsndfile libxml2 libpng libtiff libjpeg readline libsndfile libxml2
freeglut e2fsprogs libsamplerate pcre libevent editline freeglut e2fsprogs libsamplerate pcre libevent libedit
]; ];
in in
rec { 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 : { cabal.mkDerivation (self : {
pname = "editline"; pname = "editline";
version = "0.2"; version = "0.2";
sha256 = "6ee0b553cc8d7542c096730ceebabdcb9b2951d7b00a5a0ddbf47b5436a77ce4"; sha256 = "6ee0b553cc8d7542c096730ceebabdcb9b2951d7b00a5a0ddbf47b5436a77ce4";
propagatedBuildInputs = [ editline ]; propagatedBuildInputs = [ libedit ];
patchLibFiles = [ "editline.buildinfo.in" ]; patchLibFiles = [ "editline.buildinfo.in" ];
preConfigure = '' preConfigure = ''
sed -i -e '/el_get/d' include/HsEditline.h 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)";
};
}

View File

@ -1705,7 +1705,8 @@ let
ghcsAndLibs = ghcsAndLibs =
assert builtins ? listToAttrs; assert builtins ? listToAttrs;
recurseIntoAttrs (import ../development/compilers/ghcs { recurseIntoAttrs (import ../development/compilers/ghcs {
inherit ghcboot fetchurl stdenv recurseIntoAttrs perl gnum4 gmp readline lib; ghcboot = ghc642Binary;
inherit fetchurl stdenv recurseIntoAttrs perl gnum4 gmp readline lib;
inherit ghcPkgUtil ctags autoconf automake getConfig; inherit ghcPkgUtil ctags autoconf automake getConfig;
inherit (ghc68executables) hasktags; inherit (ghc68executables) hasktags;
inherit (bleedingEdgeRepos) sourceByName; inherit (bleedingEdgeRepos) sourceByName;
@ -1835,36 +1836,42 @@ let
ghc682 = import ../development/compilers/ghc/6.8.2.nix { ghc682 = import ../development/compilers/ghc/6.8.2.nix {
inherit fetchurl stdenv readline perl gmp ncurses m4; inherit fetchurl stdenv readline perl gmp ncurses m4;
ghc = ghcboot; ghc = ghc642Binary;
}; };
ghc683 = import ../development/compilers/ghc/6.8.3.nix { ghc683 = import ../development/compilers/ghc/6.8.3.nix {
inherit fetchurl stdenv readline perl gmp ncurses m4; inherit fetchurl stdenv readline perl gmp ncurses m4;
ghc = ghcboot; ghc = ghc642Binary;
haddock = haddockboot; haddock = import ../development/tools/documentation/haddock/boot.nix {
inherit gmp;
cabal = import ../development/libraries/haskell/cabal/cabal.nix {
inherit stdenv fetchurl;
ghc = ghc642Binary;
};
};
}; };
ghc661 = import ../development/compilers/ghc/6.6.1.nix { ghc661 = import ../development/compilers/ghc/6.6.1.nix {
inherit fetchurl stdenv readline perl58 gmp ncurses m4; inherit fetchurl stdenv readline perl58 gmp ncurses m4;
ghc = ghcboot; ghc = ghc642Binary;
}; };
ghc64 = import ../development/compilers/ghc/6.4.2.nix { ghc642 = import ../development/compilers/ghc/6.4.2.nix {
inherit fetchurl stdenv perl ncurses readline m4 gmp; inherit fetchurl stdenv perl ncurses readline m4 gmp;
ghc = ghcboot; ghc = ghc642Binary;
}; };
ghcboot = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot.nix { ghc642Binary = lowPrio (import ../development/compilers/ghc/6.4.2-binary.nix {
inherit fetchurl stdenv ncurses gmp; inherit fetchurl stdenv ncurses gmp;
readline = if stdenv.system == "i686-linux" then readline4 else readline; readline = if stdenv.system == "i686-linux" then readline4 else readline;
perl = perl58; perl = perl58;
})); });
ghcboot610 = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot610.nix { ghc6103Binary = lowPrio (import ../development/compilers/ghc/6.10.2-binary.nix {
inherit fetchurl stdenv ncurses gmp editline makeWrapper; inherit fetchurl stdenv ncurses gmp libedit makeWrapper;
# readline = if stdenv.system == "i686-linux" then readline4 else readline; # readline = if stdenv.system == "i686-linux" then readline4 else readline;
perl = perl58; perl = perl58;
})); });
gprolog = import ../development/compilers/gprolog { gprolog = import ../development/compilers/gprolog {
inherit fetchurl stdenv; inherit fetchurl stdenv;
@ -2103,7 +2110,7 @@ let
io = builderDefsPackage (import ../development/interpreters/io) { io = builderDefsPackage (import ../development/interpreters/io) {
inherit sqlite zlib gmp libffi cairo ncurses freetype mesa inherit sqlite zlib gmp libffi cairo ncurses freetype mesa
libpng libtiff libjpeg readline libsndfile libxml2 libpng libtiff libjpeg readline libsndfile libxml2
freeglut e2fsprogs libsamplerate pcre libevent editline; freeglut e2fsprogs libsamplerate pcre libevent libedit;
}; };
kaffe = import ../development/interpreters/kaffe { kaffe = import ../development/interpreters/kaffe {
@ -2497,12 +2504,6 @@ let
inherit fetchurl stdenv; inherit fetchurl stdenv;
}; };
# used to bootstrap ghc with
haddockboot = lowPrio (appendToName "boot" (import ../development/tools/documentation/haddock/boot.nix {
inherit gmp;
cabal = cabalboot;
}));
# old version of haddock, still more stable than 2.0 # old version of haddock, still more stable than 2.0
haddock09 = import ../development/tools/documentation/haddock/haddock-0.9.nix { haddock09 = import ../development/tools/documentation/haddock/haddock-0.9.nix {
inherit cabal; inherit cabal;
@ -2915,10 +2916,6 @@ let
inherit fetchurl stdenv perl; inherit fetchurl stdenv perl;
}; };
editline = import ../development/libraries/editline {
inherit fetchurl stdenv ncurses;
};
enchant = selectVersion ../development/libraries/enchant "1.3.0" { enchant = selectVersion ../development/libraries/enchant "1.3.0" {
inherit fetchurl stdenv aspell pkgconfig; inherit fetchurl stdenv aspell pkgconfig;
inherit (gnome) glib; inherit (gnome) glib;
@ -3396,6 +3393,10 @@ let
inherit fetchurl stdenv libdvdcss; inherit fetchurl stdenv libdvdcss;
}; };
libedit = import ../development/libraries/libedit {
inherit fetchurl stdenv ncurses;
};
libevent = import ../development/libraries/libevent { libevent = import ../development/libraries/libevent {
inherit fetchurl stdenv; inherit fetchurl stdenv;
}; };
@ -4195,11 +4196,6 @@ let
ghc = ghc683; ghc = ghc683;
}; };
cabalboot = import ../development/libraries/haskell/cabal/cabal.nix {
inherit stdenv fetchurl;
ghc = ghcboot;
};
cabal = cabal683; cabal = cabal683;
Crypto = import ../development/libraries/haskell/Crypto { Crypto = import ../development/libraries/haskell/Crypto {
@ -4224,7 +4220,7 @@ let
}; };
haskellEditline = import ../development/libraries/haskell/editline { haskellEditline = import ../development/libraries/haskell/editline {
inherit cabal editline; inherit cabal libedit;
}; };
HDBC = import ../development/libraries/haskell/HDBC/HDBC-1.1.4.nix { HDBC = import ../development/libraries/haskell/HDBC/HDBC-1.1.4.nix {