Merge pull request #6110 from edwtjo/ihaskell-ng-wrapper

ihaskell-with-packages: add environment

+41
+35
pkgs/development/tools/haskell/ihaskell/ng-wrapper.nix
··· 1 + { stdenv, buildEnv, ghcWithPackages, makeWrapper, ihaskell, ipython, packages }: 2 + let 3 + ihaskellEnv = ghcWithPackages (self: [ 4 + self.ihaskell 5 + self.ihaskell-blaze 6 + self.ihaskell-diagrams 7 + self.ihaskell-display 8 + ] ++ packages self); 9 + profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar"; 10 + drv = buildEnv { 11 + name = "ihaskell-with-packages"; 12 + paths = [ ihaskellEnv ipython ]; 13 + postBuild = '' 14 + tar xf ${ihaskell.src} ${profile} 15 + mkdir -p $out/share/`dirname ${profile}` 16 + mkdir profile 17 + cd profile 18 + tar xf ../${profile} 19 + for cfg in ipython_*config.py;do 20 + sed -i -e "1iexe = '${ihaskell}/bin/IHaskell'" $cfg 21 + done 22 + tar cf $out/share/${profile} . 23 + wrapProgram "$out/bin/IHaskell" \ 24 + --prefix PATH : "${ihaskellEnv}/bin:${ipython}/bin" \ 25 + --set PROFILE_DIR "\$HOME/.ipython/profile_haskell" \ 26 + --set PROFILE_TAR "$out/share/${profile}" \ 27 + --set PROFILE_INIT "\$([ ! -d \$PROFILE_DIR ] \ 28 + && mkdir -p \$PROFILE_DIR \ 29 + && tar xf \$PROFILE_TAR -C \$PROFILE_DIR \ 30 + ; [ -d \$PROFILE_DIR ] && for cfg in \$PROFILE_DIR/ipython_*config.py;do \ 31 + sed -i -e '/.*exe.*IHaskell.*/d' \$cfg; sed -i -e \"1iexe = '${ihaskell}/bin/IHaskell'\" \$cfg;done )" \ 32 + --set GHC_PACKAGE_PATH "\$(echo $out/lib/*/package.conf.d| tr ' ' ':'):" \ 33 + ''; 34 + }; 35 + in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
+6
pkgs/top-level/all-packages.nix
··· 1565 1565 inherit (haskellPackages) ihaskell ghc; 1566 1566 }; 1567 1567 1568 + ihaskell-with-packages = callPackage ../development/tools/haskell/ihaskell/ng-wrapper.nix { 1569 + inherit (pythonPackages) ipython; 1570 + inherit (haskellngPackages) ihaskell ghcWithPackages; 1571 + packages = self: []; 1572 + }; 1573 + 1568 1574 imapproxy = callPackage ../tools/networking/imapproxy { }; 1569 1575 1570 1576 imapsync = callPackage ../tools/networking/imapsync {