summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-02-09 12:14:06 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-02-09 12:14:06 -0500
commit5c09d977c794d9243ddac17f6c429b5432431f8f (patch)
tree1acbd7e7f0c01546d955d47c6a8fddfec8e632b6 /pkgs/stdenv
parent21d991b1fd78214023551a0dada17b129cbd5cd5 (diff)
parent18d059a4ac001fbaa9c2abc750a2830a52e1dae5 (diff)
downloadnixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar.gz
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar.bz2
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar.lz
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar.xz
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.tar.zst
nixpkgs-5c09d977c794d9243ddac17f6c429b5432431f8f.zip
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 86f895ab8f1..cafd1031ab8 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) && attrs ? pname && attrs ? version)) {
           name = "${attrs.pname}-${attrs.version}";
-        } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)) {
+        } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
           # 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`;