3
0
Fork 0
forked from mirrors/nixpkgs

xmonad: cleanup wrapper

This commit is contained in:
Nikolay Amiantov 2015-03-08 18:36:37 +03:00
parent 3d0a6819da
commit 9545c0b80e
2 changed files with 9 additions and 15 deletions

View file

@ -1,22 +1,16 @@
{ stdenv, buildEnv, ghcWithPackages, xmessage, makeWrapper, packages }:
{ stdenv, ghcWithPackages, xmessage, makeWrapper, packages }:
let
xmonadEnv = ghcWithPackages (self: [ self.xmonad ] ++ packages self);
drv = buildEnv {
in stdenv.mkDerivation {
name = "xmonad-with-packages";
paths = [ xmonadEnv ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
rm $out/bin
mkdir $out/bin
for i in ${xmonadEnv}/bin/*; do
ln -s $i $out/bin
done
wrapProgram $out/bin/xmonad \
--set XMONAD_GHC "${xmonadEnv}/bin/ghc" \
buildCommand = ''
mkdir -p $out/bin
makeWrapper ${xmonadEnv}/bin/xmonad $out/bin/xmonad \
--set NIX_GHC "${xmonadEnv}/bin/ghc" \
--set XMONAD_XMESSAGE "${xmessage}/bin/xmessage"
'';
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
}

View file

@ -12,7 +12,7 @@
err = base ++ ".errors"
src = base ++ ".hs"
lib = dir </> "lib"
+ ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "XMONAD_GHC")
+ ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC")
libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
srcT <- getModTime src
binT <- getModTime bin