summary refs log tree commit diff
path: root/pkgs/build-support/src-only/default.nix
blob: c721fdf40c69a1f7ff8797144dd6cbae5fee4472 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ 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
    buildInputs
    name
    nativeBuildInputs
    patches
    src
    ;
  installPhase = "cp -r . $out";
  phases = ["unpackPhase" "patchPhase" "installPhase"];
}