Merge pull request #187118 from GGG-KILLER/dotnet-combine-packages

dotnetCorePackages.combinePackages: refactor
This commit is contained in:
Ivv 2022-08-22 16:11:03 +02:00 committed by GitHub
commit 3da5fb3fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,13 @@
packages: packages:
{ buildEnv, lib }: { 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?
let cli = builtins.head packages; let cli = builtins.head packages;
in in
assert lib.assertMsg ((builtins.length packages) != 0) assert lib.assertMsg ((builtins.length packages) < 1)
''You must include at least one package, e.g ''You must include at least one package, e.g
`with dotnetCorePackages; combinePackages [ `with dotnetCorePackages; combinePackages [
sdk_3_1 aspnetcore_5_0 sdk_3_1 aspnetcore_5_0
@ -10,11 +15,20 @@ assert lib.assertMsg ((builtins.length packages) != 0)
buildEnv { buildEnv {
name = "dotnet-core-combined"; name = "dotnet-core-combined";
paths = packages; paths = packages;
pathsToLink = [ "/host" "/packs" "/sdk" "/shared" "/templates" ]; pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ];
ignoreCollisions = true; ignoreCollisions = true;
nativeBuildInputs = [
makeWrapper
];
postBuild = '' postBuild = ''
cp ${cli}/dotnet $out/dotnet cp -R ${cli}/{dotnet,LICENSE.txt,nix-support,ThirdPartyNotices.txt} $out/
mkdir $out/bin mkdir $out/bin
ln -s $out/dotnet $out/bin/ ln -s $out/dotnet $out/bin/dotnet
wrapProgram $out/bin/dotnet \
--prefix LD_LIBRARY_PATH : ${cli.icu}/lib
''; '';
passthru = {
inherit (cli) icu packages;
};
} }