about summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-06-13 16:13:34 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-06-13 16:13:34 +0000
commit508ba0f8c73cdb7b7030a707a052028610626a9b (patch)
treef8a212da6a65f004a79521acfc4716de9ca1d5d5 /pkgs/top-level
parent02f18d5743feb55c908df26f5825a312a9d6c414 (diff)
downloadnixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar.gz
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar.bz2
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar.lz
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar.xz
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.tar.zst
nixlib-508ba0f8c73cdb7b7030a707a052028610626a9b.zip
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
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/builder-defs.nix14
1 files changed, 13 insertions, 1 deletions
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")
 	  ;