diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2019-02-01 09:22:29 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2019-02-01 09:22:29 +0100 |
commit | 5effa4e0f98b317fe4607b1a6548811017c3325d (patch) | |
tree | d62ab19ccca3b0c6409595074b637eeb3d4371dc /pkgs/stdenv/generic/make-derivation.nix | |
parent | ca2edf79f75ad2a43a5af5c1283db9f0f843680a (diff) | |
parent | 8f58e00226e3192994050b12aa9ed119be0220f3 (diff) |
Merge branch 'master' into staging-next
Comments on conflicts:
- llvm: d6f401e1 vs. 469ecc70 - docs for 6 and 7 say the default is
to build all targets, so we should be fine
- some pypi hashes: they were equivalent, just base16 vs. base32
Diffstat (limited to 'pkgs/stdenv/generic/make-derivation.nix')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 88808a7b3f90..86f895ab8f1a 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -81,8 +81,6 @@ rec { , ... } @ attrs: let - computedName = if name != "" then name else "${attrs.pname}-${attrs.version}"; - # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when # no package has `doCheck = true`. doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform; @@ -96,7 +94,7 @@ rec { ++ depsHostHost ++ depsHostHostPropagated ++ buildInputs ++ propagatedBuildInputs ++ depsTargetTarget ++ depsTargetTargetPropagated) == 0; - dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || stdenv.cc == null; + dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || (stdenv.noCC or false); supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ]; defaultHardeningFlags = if stdenv.hostPlatform.isMusl then supportedHardeningFlags @@ -179,17 +177,15 @@ rec { "checkInputs" "installCheckInputs" "__impureHostDeps" "__propagatedImpureHostDeps" "sandboxProfile" "propagatedSandboxProfile"]) - // { - # A hack to make `nix-env -qa` and `nix search` ignore broken packages. - # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix. - name = assert validity.handled; computedName + lib.optionalString - # 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. - (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix) - ("-" + stdenv.hostPlatform.config); - + // (lib.optionalAttrs (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}"; + } // { builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; @@ -278,7 +274,7 @@ rec { meta = { # `name` above includes cross-compilation cruft (and is under assert), # lets have a clean always accessible version here. - name = computedName; + name = if name != "" then name else "${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`; @@ -289,7 +285,8 @@ rec { outputsToInstall = let hasOutput = out: builtins.elem out outputs; - in [( lib.findFirst hasOutput null (["bin" "out"] ++ outputs) )]; + in [( lib.findFirst hasOutput null (["bin" "out"] ++ outputs) )] + ++ lib.optional (hasOutput "man") "man"; } // attrs.meta or {} # Fill `meta.position` to identify the source location of the package. |