From 508ba0f8c73cdb7b7030a707a052028610626a9b Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 13 Jun 2008 16:13:34 +0000 Subject: [PATCH] Just copy some files regardless of what installer thinks about them. File named COPYING or AUTHORS must be copied to some reasonable place anyway. svn path=/nixpkgs/trunk/; revision=12080 --- pkgs/top-level/builder-defs.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/builder-defs.nix b/pkgs/top-level/builder-defs.nix index 112f6b5c2ffe..12f7f5519c83 100644 --- a/pkgs/top-level/builder-defs.nix +++ b/pkgs/top-level/builder-defs.nix @@ -8,6 +8,9 @@ args: with args; with stringsWithDeps; with lib; addSbinPath = getAttr ["addSbinPath"] false args; forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"]; + forceCopy = ["COPYING" "LICENSE" "DISTRIBUTION" "LEGAL" + "README" "AUTHORS" "ChangeLog" "CHANGES"] ++ + (optional (getAttr ["forceCopyDoc"] true args) "doc"); archiveType = s: (if hasSuffixHack ".tar" s then "tar" @@ -269,6 +272,15 @@ args: with args; with stringsWithDeps; with lib; done; ") ["minInit" "defEnsureDir"]; + doForceCopy = FullDepEntry ('' + name=$(basename $out) + name=''${name#*-} + ensureDir "$prefix/share/$name" + for f in ${toString forceCopy}; do + cp -r "$f" "$prefix/share/$name/$f" || true + done; + '') ["minInit" "defEnsureDir"]; + doDump = n: noDepEntry "echo Dump number ${n}; set"; patchFlags = if args ? patchFlags then args.patchFlags else "-p1"; @@ -428,7 +440,7 @@ args: with args; with stringsWithDeps; with lib; " ["defCreateEmptyPackageDatabaseAndSetupHook" "defCabalSetupCmd"]; realPhaseNames = args.phaseNames ++ - ["doForceShare" "doPropagate"] + ["doForceShare" "doPropagate" "doForceCopy"] ++ (optional (getAttr ["alwaysFail"] false args) "doFail") ;