Merge pull request #85750 from zimbatm/srcOnly-docs

srcOnly: fix invocation and document
This commit is contained in:
zimbatm 2020-04-27 14:49:55 +02:00 committed by GitHub
commit 1bf7f5f240
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 3 deletions

View file

@ -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 { stdenv.mkDerivation {
inherit src buildInputs patches name; inherit
buildInputs
name
nativeBuildInputs
patches
src
;
installPhase = "cp -r . $out"; installPhase = "cp -r . $out";
phases = ["unpackPhase" "patchPhase" "installPhase"]; phases = ["unpackPhase" "patchPhase" "installPhase"];
} }

View file

@ -450,7 +450,7 @@ in
singularity-tools = callPackage ../build-support/singularity-tools { }; 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 { }; substituteAll = callPackage ../build-support/substitute/substitute-all.nix { };