From 31ead7d030b235fcbb7b6a6d92600f23702c7505 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 23 Apr 2020 11:44:55 +0200 Subject: [PATCH] srcOnly: rename buildInputs to nativeBuildInputs 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. --- pkgs/build-support/src-only/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/src-only/default.nix b/pkgs/build-support/src-only/default.nix index 8ca262a998b..c721fdf40c6 100644 --- a/pkgs/build-support/src-only/default.nix +++ b/pkgs/build-support/src-only/default.nix @@ -11,11 +11,21 @@ , src , stdenv ? orig.stdenv , patches ? [] -, buildInputs ? [] -, ... # needed when passing an existing derivation +, # deprecated, use the nativeBuildInputs + buildInputs ? [] +, # used to pass extra unpackers + nativeBuildInputs ? [] +, # needed when passing an existing derivation + ... }: stdenv.mkDerivation { - inherit src buildInputs patches name; + inherit + buildInputs + name + nativeBuildInputs + patches + src + ; installPhase = "cp -r . $out"; phases = ["unpackPhase" "patchPhase" "installPhase"]; }