diff options
Diffstat (limited to 'pkgs/build-support/builder-defs/builder-defs.nix')
-rw-r--r-- | pkgs/build-support/builder-defs/builder-defs.nix | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix index e7c64501614c2..d4e7f703af9ba 100644 --- a/pkgs/build-support/builder-defs/builder-defs.nix +++ b/pkgs/build-support/builder-defs/builder-defs.nix @@ -1,26 +1,26 @@ -args: with args; with stringsWithDeps; with lib; +args @ {stringsWithDeps, lib, stdenv, writeScript, fetchurl, fetchmtn, fetchgit, ...}: with args; with stringsWithDeps; with lib; let inherit (builtins) head tail trace; in (rec { - inherit writeScript; + inherit writeScript; src = attrByPath ["src"] "" args; addSbinPath = attrByPath ["addSbinPath"] false args; forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"]; - forceCopy = ["COPYING" "LICENSE" "DISTRIBUTION" "LEGAL" - "README" "AUTHORS" "ChangeLog" "CHANGES" "LICENCE" "COPYRIGHT"] ++ - (optional (attrByPath ["forceCopyDoc"] true args) "doc"); + forceCopy = ["COPYING" "LICENSE" "DISTRIBUTION" "LEGAL" + "README" "AUTHORS" "ChangeLog" "CHANGES" "LICENCE" "COPYRIGHT"] ++ + (optional (attrByPath ["forceCopyDoc"] true args) "doc"); hasSuffixHack = a: b: hasSuffix (a+(substring 0 0 b)) ((substring 0 0 a)+b); - - archiveType = s: + + archiveType = s: (if hasSuffixHack ".tar" s then "tar" - else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" - else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || + else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" + else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || (hasSuffixHack ".tbz" s) then "tbz2" - else if hasSuffixHack ".tar.Z" s then "tZ" + else if hasSuffixHack ".tar.Z" s then "tZ" else if hasSuffixHack ".tar.lzma" s then "tar.lzma" else if hasSuffixHack ".tar.xz" s then "tar.xz" else if hasSuffixHack ".rar" s then "rar" |