2022-09-27 04:14:28 +02:00
|
|
|
{ stdenv }:
|
2020-04-22 09:48:05 +02:00
|
|
|
# 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
|
|
|
|
#
|
2022-06-18 09:40:09 +02:00
|
|
|
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";
|
2008-10-01 17:57:22 +02:00
|
|
|
installPhase = "cp -r . $out";
|
2022-06-26 12:11:51 +02:00
|
|
|
outputs = [ "out" ];
|
|
|
|
separateDebugInfo = false;
|
2008-10-01 17:57:22 +02:00
|
|
|
phases = ["unpackPhase" "patchPhase" "installPhase"];
|
2022-06-18 09:40:09 +02:00
|
|
|
})
|