summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2020-04-27 14:49:55 +0200
committerGitHub <noreply@github.com>2020-04-27 14:49:55 +0200
commit1bf7f5f240a45e91782465d8694b920a62d13b37 (patch)
treec37e5570593ba125f35827dd31872826a3579cff /pkgs
parent98dbff9a65c4d0f67834787398021a636896f204 (diff)
parent31ead7d030b235fcbb7b6a6d92600f23702c7505 (diff)
Merge pull request #85750 from zimbatm/srcOnly-docs
srcOnly: fix invocation and document
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/src-only/default.nix29
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 28 insertions, 3 deletions
diff --git a/pkgs/build-support/src-only/default.nix b/pkgs/build-support/src-only/default.nix
index a93b36480908..c721fdf40c69 100644
--- a/pkgs/build-support/src-only/default.nix
+++ b/pkgs/build-support/src-only/default.nix
@@ -1,6 +1,31 @@
-{stdenv, name, src, patches ? [], buildInputs ? [], ...}:
+{ stdenv }@orig:
+# srcOnly is a utility builder that only fetches and unpacks the given `src`,
+# maybe pathings it in the process with the optional `patches` and
+# `buildInputs` attributes.
+#
+# It can be invoked directly, or be used to wrap an existing derivation. Eg:
+#
+# > srcOnly pkgs.hello
+#
+{ name
+, src
+, stdenv ? orig.stdenv
+, patches ? []
+, # deprecated, use the nativeBuildInputs
+ buildInputs ? []
+, # used to pass extra unpackers
+ nativeBuildInputs ? []
+, # needed when passing an existing derivation
+ ...
+}:
stdenv.mkDerivation {
- inherit src buildInputs patches name;
+ inherit
+ buildInputs
+ name
+ nativeBuildInputs
+ patches
+ src
+ ;
installPhase = "cp -r . $out";
phases = ["unpackPhase" "patchPhase" "installPhase"];
}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 97cb7e8f1e13..49ab4d06c106 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -450,7 +450,7 @@ in
singularity-tools = callPackage ../build-support/singularity-tools { };
- srcOnly = args: callPackage ../build-support/src-only args;
+ srcOnly = callPackage ../build-support/src-only { };
substituteAll = callPackage ../build-support/substitute/substitute-all.nix { };