mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
buildDotnetModule: make dotnet-runtime optional
This commit is contained in:
parent
193378ead2
commit
4219a94158
@ -188,7 +188,9 @@ let
|
||||
|
||||
# propagate the runtime sandbox profile since the contents apply to published
|
||||
# executables
|
||||
propagatedSandboxProfile = toString dotnet-runtime.__propagatedSandboxProfile;
|
||||
propagatedSandboxProfile = lib.optionalString (dotnet-runtime != null) (
|
||||
toString dotnet-runtime.__propagatedSandboxProfile
|
||||
);
|
||||
|
||||
meta = (args.meta or { }) // {
|
||||
inherit platforms;
|
||||
|
@ -53,7 +53,7 @@
|
||||
name = "dotnet-fixup-hook";
|
||||
substitutions = {
|
||||
# this is used for DOTNET_ROOT, so we need unwrapped
|
||||
dotnetRuntime = dotnet-runtime.unwrapped;
|
||||
dotnetRuntime = if (dotnet-runtime != null) then dotnet-runtime.unwrapped else null;
|
||||
wrapperPath = lib.makeBinPath [ which coreutils ];
|
||||
};
|
||||
}
|
||||
|
@ -44,9 +44,11 @@ dotnetFromEnv'
|
||||
# if dotnet CLI is available, set DOTNET_ROOT based on it. Otherwise set to default .NET runtime
|
||||
dotnetRootFlagsArray+=("--suffix" "PATH" ":" "$wrapperPath")
|
||||
dotnetRootFlagsArray+=("--run" "$dotnetFromEnvScript")
|
||||
dotnetRootFlagsArray+=("--set-default" "DOTNET_ROOT" "$dotnetRuntime/share/dotnet")
|
||||
dotnetRootFlagsArray+=("--suffix" "PATH" ":" "$dotnetRuntime/bin")
|
||||
else
|
||||
if [[ -n $dotnetRuntime ]]; then
|
||||
dotnetRootFlagsArray+=("--set-default" "DOTNET_ROOT" "$dotnetRuntime/share/dotnet")
|
||||
dotnetRootFlagsArray+=("--suffix" "PATH" ":" "$dotnetRuntime/bin")
|
||||
fi
|
||||
elif [[ -n $dotnetRuntime ]]; then
|
||||
dotnetRootFlagsArray+=("--set" "DOTNET_ROOT" "$dotnetRuntime/share/dotnet")
|
||||
dotnetRootFlagsArray+=("--prefix" "PATH" ":" "$dotnetRuntime/bin")
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user