From 560d0d15978ce2148aa9faba7f8f9b4b2eff2256 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 14 Dec 2008 14:54:47 +0000 Subject: 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 --- pkgs/top-level/builder-defs.nix | 27 +++++++++++++++++++++++---- 1 file 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") ++ -- cgit 1.4.1