mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 06:14:57 +01:00
affa8f75ec
This reverts commit 610ee378fc
.
Reason for reapply: The change was alright, just went to the wrong
branch.
22 lines
713 B
Nix
22 lines
713 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 -pr --reflink=auto -- . $out";
|
|
outputs = [ "out" ];
|
|
separateDebugInfo = false;
|
|
dontUnpack = false;
|
|
dontInstall = false;
|
|
phases = ["unpackPhase" "patchPhase" "installPhase"];
|
|
})
|