diff --git a/pkgs/development/compilers/ghc-wrapper/builder.sh b/pkgs/development/compilers/ghc-wrapper/builder.sh deleted file mode 100644 index 9851f9b2b1b..00000000000 --- a/pkgs/development/compilers/ghc-wrapper/builder.sh +++ /dev/null @@ -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 diff --git a/pkgs/development/compilers/ghc-wrapper/default.nix b/pkgs/development/compilers/ghc-wrapper/default.nix deleted file mode 100644 index 8c35db926b6..00000000000 --- a/pkgs/development/compilers/ghc-wrapper/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{stdenv, ghc, libraries}: - -stdenv.mkDerivation { - inherit (ghc) name meta; - inherit ghc libraries; - builder = ./builder.sh; -} diff --git a/pkgs/development/compilers/ghc/boot610.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix similarity index 51% rename from pkgs/development/compilers/ghc/boot610.nix rename to pkgs/development/compilers/ghc/6.10.2-binary.nix index 7cfafaa13e8..0806c5b3dc9 100644 --- a/pkgs/development/compilers/ghc/boot610.nix +++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix @@ -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" ] + ''; } diff --git a/pkgs/development/compilers/ghc/boot.nix b/pkgs/development/compilers/ghc/6.4.2-binary.nix similarity index 78% rename from pkgs/development/compilers/ghc/boot.nix rename to pkgs/development/compilers/ghc/6.4.2-binary.nix index 60664374b8e..31777244521 100644 --- a/pkgs/development/compilers/ghc/boot.nix +++ b/pkgs/development/compilers/ghc/6.4.2-binary.nix @@ -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 ""; } diff --git a/pkgs/development/compilers/ghc/6.8.2.nix b/pkgs/development/compilers/ghc/6.8.2.nix index 2bcd88dc2fe..4015d364b27 100644 --- a/pkgs/development/compilers/ghc/6.8.2.nix +++ b/pkgs/development/compilers/ghc/6.8.2.nix @@ -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; }) diff --git a/pkgs/development/compilers/ghc/6.8.3.nix b/pkgs/development/compilers/ghc/6.8.3.nix index 07369ddc6f5..d9f3c1760a1 100644 --- a/pkgs/development/compilers/ghc/6.8.3.nix +++ b/pkgs/development/compilers/ghc/6.8.3.nix @@ -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; }) diff --git a/pkgs/development/interpreters/io/default.nix b/pkgs/development/interpreters/io/default.nix index 4d737fe7065..2ba7c5fb697 100644 --- a/pkgs/development/interpreters/io/default.nix +++ b/pkgs/development/interpreters/io/default.nix @@ -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 { diff --git a/pkgs/development/libraries/editline/default.nix b/pkgs/development/libraries/editline/default.nix deleted file mode 100644 index ef1ade22289..00000000000 --- a/pkgs/development/libraries/editline/default.nix +++ /dev/null @@ -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 ]; -} diff --git a/pkgs/development/libraries/haskell/editline/default.nix b/pkgs/development/libraries/haskell/editline/default.nix index 58c700921aa..f3dfa9f6655 100644 --- a/pkgs/development/libraries/haskell/editline/default.nix +++ b/pkgs/development/libraries/haskell/editline/default.nix @@ -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 diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix new file mode 100644 index 00000000000..622d6e21c97 --- /dev/null +++ b/pkgs/development/libraries/libedit/default.nix @@ -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)"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7378f2741ae..2e0826fb62a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1705,7 +1705,8 @@ let ghcsAndLibs = assert builtins ? listToAttrs; 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 (ghc68executables) hasktags; inherit (bleedingEdgeRepos) sourceByName; @@ -1835,36 +1836,42 @@ let ghc682 = import ../development/compilers/ghc/6.8.2.nix { inherit fetchurl stdenv readline perl gmp ncurses m4; - ghc = ghcboot; + ghc = ghc642Binary; }; ghc683 = import ../development/compilers/ghc/6.8.3.nix { inherit fetchurl stdenv readline perl gmp ncurses m4; - ghc = ghcboot; - haddock = haddockboot; + ghc = ghc642Binary; + 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 { 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; - 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; readline = if stdenv.system == "i686-linux" then readline4 else readline; perl = perl58; - })); + }); - ghcboot610 = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot610.nix { - inherit fetchurl stdenv ncurses gmp editline makeWrapper; + ghc6103Binary = lowPrio (import ../development/compilers/ghc/6.10.2-binary.nix { + inherit fetchurl stdenv ncurses gmp libedit makeWrapper; # readline = if stdenv.system == "i686-linux" then readline4 else readline; perl = perl58; - })); + }); gprolog = import ../development/compilers/gprolog { inherit fetchurl stdenv; @@ -2103,7 +2110,7 @@ let io = builderDefsPackage (import ../development/interpreters/io) { inherit sqlite zlib gmp libffi cairo ncurses freetype mesa libpng libtiff libjpeg readline libsndfile libxml2 - freeglut e2fsprogs libsamplerate pcre libevent editline; + freeglut e2fsprogs libsamplerate pcre libevent libedit; }; kaffe = import ../development/interpreters/kaffe { @@ -2497,12 +2504,6 @@ let 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 haddock09 = import ../development/tools/documentation/haddock/haddock-0.9.nix { inherit cabal; @@ -2915,10 +2916,6 @@ let inherit fetchurl stdenv perl; }; - editline = import ../development/libraries/editline { - inherit fetchurl stdenv ncurses; - }; - enchant = selectVersion ../development/libraries/enchant "1.3.0" { inherit fetchurl stdenv aspell pkgconfig; inherit (gnome) glib; @@ -3396,6 +3393,10 @@ let inherit fetchurl stdenv libdvdcss; }; + libedit = import ../development/libraries/libedit { + inherit fetchurl stdenv ncurses; + }; + libevent = import ../development/libraries/libevent { inherit fetchurl stdenv; }; @@ -4195,11 +4196,6 @@ let ghc = ghc683; }; - cabalboot = import ../development/libraries/haskell/cabal/cabal.nix { - inherit stdenv fetchurl; - ghc = ghcboot; - }; - cabal = cabal683; Crypto = import ../development/libraries/haskell/Crypto { @@ -4224,7 +4220,7 @@ let }; haskellEditline = import ../development/libraries/haskell/editline { - inherit cabal editline; + inherit cabal libedit; }; HDBC = import ../development/libraries/haskell/HDBC/HDBC-1.1.4.nix {