Merge pull request #120762 from sternenseemann/mkderivation-host-suffix-middle
pkgs/stdenv/make-derivation: move hostSuffix before the version
This commit is contained in:
commit
8e4fe32876
@ -200,9 +200,7 @@ in rec {
|
|||||||
// (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
|
// (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
|
||||||
name =
|
name =
|
||||||
let
|
let
|
||||||
staticMarker = lib.optionalString stdenv.hostPlatform.isStatic "-static";
|
# Indicate the host platform of the derivation if cross compiling.
|
||||||
name' = attrs.name or
|
|
||||||
"${attrs.pname}${staticMarker}-${attrs.version}";
|
|
||||||
# Fixed-output derivations like source tarballs shouldn't get a host
|
# Fixed-output derivations like source tarballs shouldn't get a host
|
||||||
# suffix. But we have some weird ones with run-time deps that are
|
# 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
|
# just used for their side-affects. Those might as well since the
|
||||||
@ -210,7 +208,16 @@ in rec {
|
|||||||
hostSuffix = lib.optionalString
|
hostSuffix = lib.optionalString
|
||||||
(stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)
|
(stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)
|
||||||
"-${stdenv.hostPlatform.config}";
|
"-${stdenv.hostPlatform.config}";
|
||||||
in name' + hostSuffix;
|
# Disambiguate statically built packages. This was originally
|
||||||
|
# introduce as a means to prevent nix-env to get confused between
|
||||||
|
# nix and nixStatic. This should be also achieved by moving the
|
||||||
|
# hostSuffix before the version, so we could contemplate removing
|
||||||
|
# it again.
|
||||||
|
staticMarker = lib.optionalString stdenv.hostPlatform.isStatic "-static";
|
||||||
|
in
|
||||||
|
if attrs ? name
|
||||||
|
then attrs.name + hostSuffix
|
||||||
|
else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}";
|
||||||
}) // {
|
}) // {
|
||||||
builder = attrs.realBuilder or stdenv.shell;
|
builder = attrs.realBuilder or stdenv.shell;
|
||||||
args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
|
args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user