summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/lib/strings.nix5
-rw-r--r--pkgs/misc/source-and-tags/default.nix33
-rw-r--r--pkgs/tools/misc/myhasktags/default.nix37
-rw-r--r--pkgs/top-level/haskell-packages.nix5
4 files changed, 59 insertions, 21 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index c1ce5d09757..ed8111b4e6a 100644
--- a/pkgs/lib/strings.nix
+++ b/pkgs/lib/strings.nix
@@ -79,11 +79,6 @@ rec {
   # [] for zsh
   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
   # !!! isn't this what the `baseNameOf' primop does?
   dropPath = s : 
diff --git a/pkgs/misc/source-and-tags/default.nix b/pkgs/misc/source-and-tags/default.nix
index d9b4717cb70..bd831d1fbc8 100644
--- a/pkgs/misc/source-and-tags/default.nix
+++ b/pkgs/misc/source-and-tags/default.nix
@@ -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
     # is this a good choice?
     buildPhase =
-      lib.defineShList "sh_list_names" (lib.catAttrs "name" createTagFiles)
-    + lib.defineShList "sh_list_cmds" (lib.catAttrs "tagCmd" createTagFiles)
-    + "SRC_DEST=\$out/src/\$name
-      ensureDir \$SRC_DEST
-      cp -r \$srcDir \$SRC_DEST
-      cd \$SRC_DEST
-      for a in `seq 0 \${#sh_list}`; do
-          TAG_FILE=\"\$SRC_DEST/\"\${sh_list_names[$a]}$tagSuffix
-          cmd=\"\${sh_list_cmds[$a]}\"
-          echo running tag cmd \"$cmd\" in `pwd`
-          eval \"\$cmd\";
-          TAG_FILES=\"\$TAG_FILES\${TAG_FILES:+:}\$TAG_FILE\"
-       done
-       ensureDir $out/nix-support
-       echo \"TAG_FILES=\\\"\\\$TAG_FILES\\\${TAG_FILES:+:}$TAG_FILES\\\"\" >> $out/nix-support/setup-hook
-    ";
+      let createTags = lib.concatStringsSep "\n"
+          (map (a: ''
+            TAG_FILE="$SRC_DEST/${a.name}$tagSuffix"
+            echo running tag cmd "${a.tagCmd}" in `pwd`
+            ${a.tagCmd}
+            TAG_FILES="$TAG_FILES\''${TAG_FILES:+:}$TAG_FILE"
+           '') createTagFiles );
+      in ''
+      SRC_DEST=$out/src/$name
+      ensureDir $SRC_DEST
+      cp -r $srcDir $SRC_DEST
+      cd $SRC_DEST
+      ${createTags}
+
+      ensureDir $out/nix-support
+      echo "TAG_FILES=\"\$TAG_FILES\\''${TAG_FILES:+:}$TAG_FILES\"" >> $out/nix-support/setup-hook
+    '';
   };
   # example usage
   #testSourceWithTags = sourceWithTagsDerivation (ghc68extraLibs ghcsAndLibs.ghc68).happs_server_darcs.passthru.sourceWithTags;
diff --git a/pkgs/tools/misc/myhasktags/default.nix b/pkgs/tools/misc/myhasktags/default.nix
new file mode 100644
index 00000000000..1d22c7eedb7
--- /dev/null
+++ b/pkgs/tools/misc/myhasktags/default.nix
@@ -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?";
+  };
+}
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index 5b5c74f40af..b71a174f348 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -505,6 +505,11 @@ rec {
     inherit (pkgs) tetex polytable;
   };
 
+  myhasktags = import ../tools/misc/myhasktags {
+    inherit ghcReal;
+    inherit (pkgs) stdenv fetchurl;
+  };
+
   # Games.
 
   MazesOfMonad = import ../games/MazesOfMonad {