fix sourceWithTagsDerivation, myhasktags now based on current haskell derivations

svn path=/nixpkgs/trunk/; revision=16263
This commit is contained in:
Marc Weber 2009-07-09 03:50:47 +00:00
parent 4f81282226
commit 6abf8471fb
4 changed files with 59 additions and 21 deletions

View file

@ -79,11 +79,6 @@ rec {
# [] for zsh # [] for zsh
escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]"); escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]");
# !!! what is this for?
defineShList = name: list: "\n${name}=(${concatStringsSep " " (map escapeShellArg list)})\n";
# arg: http://foo/bar/bz.ext returns bz.ext # arg: http://foo/bar/bz.ext returns bz.ext
# !!! isn't this what the `baseNameOf' primop does? # !!! isn't this what the `baseNameOf' primop does?
dropPath = s : dropPath = s :

View file

@ -19,22 +19,23 @@ args: with args; {
# using separate tag directory so that you don't have to glob that much files when starting your editor # using separate tag directory so that you don't have to glob that much files when starting your editor
# is this a good choice? # is this a good choice?
buildPhase = buildPhase =
lib.defineShList "sh_list_names" (lib.catAttrs "name" createTagFiles) let createTags = lib.concatStringsSep "\n"
+ lib.defineShList "sh_list_cmds" (lib.catAttrs "tagCmd" createTagFiles) (map (a: ''
+ "SRC_DEST=\$out/src/\$name TAG_FILE="$SRC_DEST/${a.name}$tagSuffix"
ensureDir \$SRC_DEST echo running tag cmd "${a.tagCmd}" in `pwd`
cp -r \$srcDir \$SRC_DEST ${a.tagCmd}
cd \$SRC_DEST TAG_FILES="$TAG_FILES\''${TAG_FILES:+:}$TAG_FILE"
for a in `seq 0 \${#sh_list}`; do '') createTagFiles );
TAG_FILE=\"\$SRC_DEST/\"\${sh_list_names[$a]}$tagSuffix in ''
cmd=\"\${sh_list_cmds[$a]}\" SRC_DEST=$out/src/$name
echo running tag cmd \"$cmd\" in `pwd` ensureDir $SRC_DEST
eval \"\$cmd\"; cp -r $srcDir $SRC_DEST
TAG_FILES=\"\$TAG_FILES\${TAG_FILES:+:}\$TAG_FILE\" cd $SRC_DEST
done ${createTags}
ensureDir $out/nix-support
echo \"TAG_FILES=\\\"\\\$TAG_FILES\\\${TAG_FILES:+:}$TAG_FILES\\\"\" >> $out/nix-support/setup-hook ensureDir $out/nix-support
"; echo "TAG_FILES=\"\$TAG_FILES\\''${TAG_FILES:+:}$TAG_FILES\"" >> $out/nix-support/setup-hook
'';
}; };
# example usage # example usage
#testSourceWithTags = sourceWithTagsDerivation (ghc68extraLibs ghcsAndLibs.ghc68).happs_server_darcs.passthru.sourceWithTags; #testSourceWithTags = sourceWithTagsDerivation (ghc68extraLibs ghcsAndLibs.ghc68).happs_server_darcs.passthru.sourceWithTags;

View file

@ -0,0 +1,37 @@
{fetchurl, stdenv, ghcReal} :
/* use case:
packageOverrides = {
haskellCollection =
let hp = haskellPackages;
install = [ hp.QuickCheck /* ... * /];
in
misc.collection {
name = "my-haskell-packages-collection";
list = install ++ (map (x : sourceWithTagsDerivation (sourceWithTagsFromDerivation (addHasktagsTaggingInfo x) ))
(lib.filter (x : builtins.hasAttr "src" x) install ) );
};
};
*/
stdenv.mkDerivation {
name = "hasktags-modified";
version = "0.0"; # Haskell Platform 2009.0.0
src = fetchurl {
url = http://mawercer.de/~nix/hasktags.hs;
sha256 = "c68ece10a47fdab0ecab2865582ba49299d5d1acd26db95fe0dc7926e36eb1c1";
};
phases="buildPhase";
buildPhase = ''
ensureDir $out/bin
ghc --make $src -o $out/bin/hasktags-modified
'';
buildInputs = [ ghcReal ];
meta = {
description = "my patched version of hasktags. Should be merged into hasktags?";
};
}

View file

@ -505,6 +505,11 @@ rec {
inherit (pkgs) tetex polytable; inherit (pkgs) tetex polytable;
}; };
myhasktags = import ../tools/misc/myhasktags {
inherit ghcReal;
inherit (pkgs) stdenv fetchurl;
};
# Games. # Games.
MazesOfMonad = import ../games/MazesOfMonad { MazesOfMonad = import ../games/MazesOfMonad {