about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-12-14 14:54:47 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-12-14 14:54:47 +0000
commit560d0d15978ce2148aa9faba7f8f9b4b2eff2256 (patch)
treedb1241ca7e6f60f7338d3079d9f00295823327a7
parentabf1aeca3b0a4e163f5246f11257924569467020 (diff)
I found a package that carries LICENCE file - adding to forceCopy list; also added some service functionality (needed by the same package).
svn path=/nixpkgs/trunk/; revision=13630
-rw-r--r--pkgs/top-level/builder-defs.nix27
1 files changed, 23 insertions, 4 deletions
diff --git a/pkgs/top-level/builder-defs.nix b/pkgs/top-level/builder-defs.nix
index c69a32d99a101..fc5c1691f6177 100644
--- a/pkgs/top-level/builder-defs.nix
+++ b/pkgs/top-level/builder-defs.nix
@@ -9,7 +9,7 @@ args: with args; with stringsWithDeps; with lib;
 
         forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"];
         forceCopy = ["COPYING" "LICENSE" "DISTRIBUTION" "LEGAL" 
-          "README" "AUTHORS" "ChangeLog" "CHANGES"] ++ 
+          "README" "AUTHORS" "ChangeLog" "CHANGES" "LICENCE" "COPYRIGHT"] ++ 
           (optional (getAttr ["forceCopyDoc"] true args) "doc"); 
 
         archiveType = s: 
@@ -278,8 +278,8 @@ args: with args; with stringsWithDeps; with lib;
         ") ["minInit" "defEnsureDir"];
 
         doForceCopy = FullDepEntry (''
-                name=$(basename $out)
-                name=''${name#*-}
+                name="$(basename $out)"
+                name="''${name#*-}"
                 ensureDir "$prefix/share/$name"
                 for f in ${toString forceCopy}; do
                         cp -r "$f" "$prefix/share/$name/$f" || true
@@ -381,8 +381,27 @@ args: with args; with stringsWithDeps; with lib;
         surroundWithCommands = x : before : after : {deps=x.deps; text = before + "\n" +
                 x.text + "\n" + after ;};
 
-        realPhaseNames = args.phaseNames ++ 
+	createDirs = FullDepEntry (concatStringsSep ";"
+		(map (x: "ensureDir ${x}") (getAttr ["neededDirs"] [] args))
+	) ["minInit" "defEnsureDir"];
+
+	copyExtraDoc = FullDepEntry (''
+          name="$(basename $out)"
+          name="''${name#*-}"
+          ensureDir "$out/share/doc/$name"
+	'' + (concatStringsSep ";"
+               (map 
+	         (x: ''cp "${x}" "$out/share/doc/$name || true;"'') 
+		 (getAttr ["extraDoc"] [] args)))) ["minInit" "defEnsureDir" "doUnpack"];
+
+        realPhaseNames = 
+	  (optional ([] != getAttr ["neededDirs"] [] args) "createDirs")
+	  ++
+	  args.phaseNames 
+	  ++ 
           ["doForceShare" "doPropagate" "doForceCopy"]
+	  ++
+	  (optional ([] != getAttr ["extraDoc"] [] args) "copyExtraDoc")
           ++
           (optional (getAttr ["doCheck"] false args) "doMakeCheck")
           ++