mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-05 17:56:46 +01:00
31ead7d030
The only reason to pass build inputs is to extend the unpackPhase with custom unpack commands. Eg: add "unrar" to unpack rar sources. And those should really be passed as native build inputs. Why? Because nativeBuildInputs is for dependencies that are used at build time but will not propagate as runtime dependencies. And also, cross-compilation.
32 lines
718 B
Nix
32 lines
718 B
Nix
{ 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"];
|
|
}
|