2023-03-24 00:07:29 +00:00
|
|
|
dotnetPackages:
|
2022-09-09 14:08:57 +00:00
|
|
|
{ buildEnv, makeWrapper, lib }:
|
|
|
|
# TODO: Rethink how we determine and/or get the CLI.
|
|
|
|
# Possible options raised in #187118:
|
|
|
|
# 1. A separate argument for the CLI (as suggested by IvarWithoutBones
|
|
|
|
# 2. Use the highest version SDK for the CLI (as suggested by GGG)
|
|
|
|
# 3. Something else?
|
2023-03-24 00:07:29 +00:00
|
|
|
let cli = builtins.head dotnetPackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2023-03-24 00:07:29 +00:00
|
|
|
assert lib.assertMsg ((builtins.length dotnetPackages) > 0)
|
2020-04-24 23:36:52 +00:00
|
|
|
''You must include at least one package, e.g
|
2021-03-23 19:22:30 +00:00
|
|
|
`with dotnetCorePackages; combinePackages [
|
2023-03-30 22:05:00 +00:00
|
|
|
sdk_6_0 aspnetcore_7_0
|
2021-03-23 19:22:30 +00:00
|
|
|
];`'' ;
|
2020-04-24 23:36:52 +00:00
|
|
|
buildEnv {
|
|
|
|
name = "dotnet-core-combined";
|
2023-03-24 00:07:29 +00:00
|
|
|
paths = dotnetPackages;
|
2022-09-09 14:08:57 +00:00
|
|
|
pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
ignoreCollisions = true;
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
postBuild = ''
|
2022-10-30 15:09:59 +00:00
|
|
|
cp -R ${cli}/{dotnet,share,nix-support} $out/
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir $out/bin
|
2022-09-09 14:08:57 +00:00
|
|
|
ln -s $out/dotnet $out/bin/dotnet
|
|
|
|
wrapProgram $out/bin/dotnet \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${cli.icu}/lib
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2022-09-09 14:08:57 +00:00
|
|
|
passthru = {
|
2023-03-24 00:07:29 +00:00
|
|
|
inherit (cli) icu;
|
|
|
|
|
|
|
|
versions = lib.catAttrs "version" dotnetPackages;
|
|
|
|
packages = lib.remove null (lib.catAttrs "packages" dotnetPackages);
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
inherit (cli) meta;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|