9c6ee729d6
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
22 lines
694 B
Nix
22 lines
694 B
Nix
{ stdenv }:
|
|
# srcOnly is a utility builder that only fetches and unpacks the given `src`,
|
|
# and optionally patching with `patches` or adding build inputs.
|
|
#
|
|
# It can be invoked directly, or be used to wrap an existing derivation. Eg:
|
|
#
|
|
# > srcOnly pkgs.hello
|
|
#
|
|
attrs:
|
|
let
|
|
args = if builtins.hasAttr "drvAttrs" attrs then attrs.drvAttrs else attrs;
|
|
name = if builtins.hasAttr "name" args then args.name else "${args.pname}-${args.version}";
|
|
in
|
|
stdenv.mkDerivation (args // {
|
|
name = "${name}-source";
|
|
installPhase = "cp -r . $out";
|
|
outputs = [ "out" ];
|
|
separateDebugInfo = false;
|
|
dontUnpack = false;
|
|
dontInstall = false;
|
|
phases = ["unpackPhase" "patchPhase" "installPhase"];
|
|
})
|