ihaskell: deprecate old haskellPackages expression
This commit is contained in:
parent
c1ab1f0e84
commit
f13d9f28e8
@ -1,35 +0,0 @@
|
|||||||
{ stdenv, buildEnv, ghcWithPackages, makeWrapper, ihaskell, ipython, packages }:
|
|
||||||
let
|
|
||||||
ihaskellEnv = ghcWithPackages (self: [
|
|
||||||
self.ihaskell
|
|
||||||
self.ihaskell-blaze
|
|
||||||
self.ihaskell-diagrams
|
|
||||||
self.ihaskell-display
|
|
||||||
] ++ packages self);
|
|
||||||
profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar";
|
|
||||||
drv = buildEnv {
|
|
||||||
name = "ihaskell-with-packages";
|
|
||||||
paths = [ ihaskellEnv ipython ];
|
|
||||||
postBuild = ''
|
|
||||||
tar xf ${ihaskell.src} ${profile}
|
|
||||||
mkdir -p $out/share/`dirname ${profile}`
|
|
||||||
mkdir profile
|
|
||||||
cd profile
|
|
||||||
tar xf ../${profile}
|
|
||||||
for cfg in ipython_*config.py;do
|
|
||||||
sed -i -e "1iexe = '${ihaskell}/bin/IHaskell'" $cfg
|
|
||||||
done
|
|
||||||
tar cf $out/share/${profile} .
|
|
||||||
wrapProgram "$out/bin/IHaskell" \
|
|
||||||
--prefix PATH : "${ihaskellEnv}/bin:${ipython}/bin" \
|
|
||||||
--set PROFILE_DIR "\$HOME/.ipython/profile_haskell" \
|
|
||||||
--set PROFILE_TAR "$out/share/${profile}" \
|
|
||||||
--set PROFILE_INIT "\$([ ! -d \$PROFILE_DIR ] \
|
|
||||||
&& mkdir -p \$PROFILE_DIR \
|
|
||||||
&& tar xf \$PROFILE_TAR -C \$PROFILE_DIR \
|
|
||||||
; [ -d \$PROFILE_DIR ] && for cfg in \$PROFILE_DIR/ipython_*config.py;do \
|
|
||||||
sed -i -e '/.*exe.*IHaskell.*/d' \$cfg; sed -i -e \"1iexe = '${ihaskell}/bin/IHaskell'\" \$cfg;done )" \
|
|
||||||
--set GHC_PACKAGE_PATH "\$(echo $out/lib/*/package.conf.d| tr ' ' ':'):" \
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
|
|
@ -1,15 +1,17 @@
|
|||||||
{ stdenv, makeWrapper, ihaskell, ipython, ghc }:
|
{ stdenv, buildEnv, ghcWithPackages, makeWrapper, ihaskell, ipython, packages }:
|
||||||
|
let
|
||||||
stdenv.mkDerivation rec {
|
ihaskellEnv = ghcWithPackages (self: [
|
||||||
|
self.ihaskell
|
||||||
inherit (ihaskell) name pname src version meta;
|
self.ihaskell-blaze
|
||||||
|
self.ihaskell-diagrams
|
||||||
buildInputs = [ makeWrapper ];
|
self.ihaskell-display
|
||||||
|
] ++ packages self);
|
||||||
preferLocalBuild = true;
|
profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar";
|
||||||
|
drv = buildEnv {
|
||||||
buildCommand = let profile = "${pname}-${version}/profile/profile.tar"; in ''
|
name = "ihaskell-with-packages";
|
||||||
tar xf $src ${profile}
|
paths = [ ihaskellEnv ipython ];
|
||||||
|
postBuild = ''
|
||||||
|
tar xf ${ihaskell.src} ${profile}
|
||||||
mkdir -p $out/share/`dirname ${profile}`
|
mkdir -p $out/share/`dirname ${profile}`
|
||||||
mkdir profile
|
mkdir profile
|
||||||
cd profile
|
cd profile
|
||||||
@ -18,19 +20,16 @@ stdenv.mkDerivation rec {
|
|||||||
sed -i -e "1iexe = '${ihaskell}/bin/IHaskell'" $cfg
|
sed -i -e "1iexe = '${ihaskell}/bin/IHaskell'" $cfg
|
||||||
done
|
done
|
||||||
tar cf $out/share/${profile} .
|
tar cf $out/share/${profile} .
|
||||||
makeWrapper "${ihaskell}/bin/IHaskell" "$out/bin/ihaskell" \
|
wrapProgram "$out/bin/IHaskell" \
|
||||||
--prefix PATH : "${ghc}/bin:${ihaskell}/bin:${ipython}/bin" \
|
--prefix PATH : "${ihaskellEnv}/bin:${ipython}/bin" \
|
||||||
--prefix LD_LIBRARY_PATH : "${ihaskell}/lib/ghc-${ghc.version}/${name}/" \
|
|
||||||
--add-flags "--ipython=${ipython}/bin/ipython" \
|
|
||||||
--set PROFILE_DIR "\$HOME/.ipython/profile_haskell" \
|
--set PROFILE_DIR "\$HOME/.ipython/profile_haskell" \
|
||||||
--set PROFILE_TAR "$out/share/${profile}" \
|
--set PROFILE_TAR "$out/share/${profile}" \
|
||||||
--set PROFILE_INIT "\$([ ! -d \$PROFILE_DIR ] \
|
--set PROFILE_INIT "\$([ ! -d \$PROFILE_DIR ] \
|
||||||
&& mkdir -p \$PROFILE_DIR \
|
&& mkdir -p \$PROFILE_DIR \
|
||||||
&& tar xf \$PROFILE_TAR -C \$PROFILE_DIR \
|
&& tar xf \$PROFILE_TAR -C \$PROFILE_DIR \
|
||||||
; [ -d \$PROFILE_DIR ] && for cfg in \$PROFILE_DIR/ipython_*config.py;do \
|
; [ -d \$PROFILE_DIR ] && for cfg in \$PROFILE_DIR/ipython_*config.py;do \
|
||||||
sed -i -e '/.*exe.*IHaskell.*/d' \$cfg; sed -i -e \"1iexe = '${ihaskell}/bin/IHaskell'\" \$cfg;done ) \
|
sed -i -e '/.*exe.*IHaskell.*/d' \$cfg; sed -i -e \"1iexe = '${ihaskell}/bin/IHaskell'\" \$cfg;done )" \
|
||||||
" \
|
--set GHC_PACKAGE_PATH "\$(echo $out/lib/*/package.conf.d| tr ' ' ':'):" \
|
||||||
--prefix GHC_PACKAGE_PATH : "\$(${ghc.GHCGetPackages} ${ghc.version}|sed -e 's, -package-db ,:,g'|cut -b 2-):${ihaskell}/lib/ghc-${ghc.version}/package.conf.d/${pname}-${version}.installedconf" \
|
'';
|
||||||
--set GHC_PACKAGE_PATH "\$GHC_PACKAGE_PATH:" # always end with : to include base packages
|
};
|
||||||
'';
|
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
|
||||||
}
|
|
@ -1677,11 +1677,6 @@ let
|
|||||||
ifuse = callPackage ../tools/filesystems/ifuse/default.nix { };
|
ifuse = callPackage ../tools/filesystems/ifuse/default.nix { };
|
||||||
|
|
||||||
ihaskell = callPackage ../development/tools/haskell/ihaskell/wrapper.nix {
|
ihaskell = callPackage ../development/tools/haskell/ihaskell/wrapper.nix {
|
||||||
inherit (pythonPackages) ipython;
|
|
||||||
inherit (haskellPackages) ihaskell ghc;
|
|
||||||
};
|
|
||||||
|
|
||||||
ihaskell-with-packages = callPackage ../development/tools/haskell/ihaskell/ng-wrapper.nix {
|
|
||||||
inherit (pythonPackages) ipython;
|
inherit (pythonPackages) ipython;
|
||||||
inherit (haskellngPackages) ihaskell ghcWithPackages;
|
inherit (haskellngPackages) ihaskell ghcWithPackages;
|
||||||
packages = config.ihaskell.packages or (self: []);
|
packages = config.ihaskell.packages or (self: []);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user