summaryrefslogtreecommitdiffstats
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2019-02-01 15:59:12 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2019-02-01 16:02:42 +0000
commit0d17ecce2c2e7c595583c8c24f3e3e3f72b12fc7 (patch)
treec3a5dde4cced72dcde8c82dbad54f98715054ab8 /pkgs/stdenv/generic
parenta06952dbb1cf5d34becbf4b1998069e0ad946bb4 (diff)
mkDerivation: cleaner handling of the `name` argument
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 9ba06995940c..8f0f12ea1a20 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -12,7 +12,7 @@ rec {
# * https://nixos.org/nix/manual/#ssec-derivation
# Explanation about derivations in general
mkDerivation =
- { name ? ""
+ {
# These types of dependencies are all exhaustively documented in
# the "Specifying Dependencies" section of the "Standard
@@ -21,7 +21,7 @@ rec {
# TODO(@Ericson2314): Stop using legacy dep attribute names
# host offset -> target offset
- , depsBuildBuild ? [] # -1 -> -1
+ depsBuildBuild ? [] # -1 -> -1
, depsBuildBuildPropagated ? [] # -1 -> -1
, nativeBuildInputs ? [] # -1 -> 0 N.B. Legacy name
, propagatedNativeBuildInputs ? [] # -1 -> 0 N.B. Legacy name
@@ -177,14 +177,14 @@ rec {
"checkInputs" "installCheckInputs"
"__impureHostDeps" "__propagatedImpureHostDeps"
"sandboxProfile" "propagatedSandboxProfile"])
- // (lib.optionalAttrs (name == "")) {
+ // (lib.optionalAttrs (!(attrs ? name))) {
name = "${attrs.pname}-${attrs.version}";
} // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)) {
# Fixed-output derivations like source tarballs shouldn't get a host
# suffix. But we have some weird ones with run-time deps that are
# just used for their side-affects. Those might as well since the
# hash can't be the same. See #32986.
- name = "${if name != "" then name else "${attrs.pname}-${attrs.version}"}-${stdenv.hostPlatform.config}";
+ name = "${attrs.name or "${attrs.pname}-${attrs.version}"}-${stdenv.hostPlatform.config}";
} // {
builder = attrs.realBuilder or stdenv.shell;
args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
@@ -274,7 +274,7 @@ rec {
meta = {
# `name` above includes cross-compilation cruft (and is under assert),
# lets have a clean always accessible version here.
- name = if name != "" then name else "${attrs.pname}-${attrs.version}";
+ name = attrs.name or "${attrs.pname}-${attrs.version}";
# If the packager hasn't specified `outputsToInstall`, choose a default,
# which is the name of `p.bin or p.out or p`;