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

dotnetCorePackages.combinePackages: refactor

authored by Ivv and committed by GitHub 3da5fb3f e1240fb9

+19 -5
+19 -5
pkgs/development/compilers/dotnet/combine-packages.nix
··· 1 1 packages: 2 - { buildEnv, lib }: 2 + { buildEnv, makeWrapper, lib }: 3 + # TODO: Rethink how we determine and/or get the CLI. 4 + # Possible options raised in #187118: 5 + # 1. A separate argument for the CLI (as suggested by IvarWithoutBones 6 + # 2. Use the highest version SDK for the CLI (as suggested by GGG) 7 + # 3. Something else? 3 8 let cli = builtins.head packages; 4 9 in 5 - assert lib.assertMsg ((builtins.length packages) != 0) 10 + assert lib.assertMsg ((builtins.length packages) < 1) 6 11 ''You must include at least one package, e.g 7 12 `with dotnetCorePackages; combinePackages [ 8 13 sdk_3_1 aspnetcore_5_0 ··· 10 15 buildEnv { 11 16 name = "dotnet-core-combined"; 12 17 paths = packages; 13 - pathsToLink = [ "/host" "/packs" "/sdk" "/shared" "/templates" ]; 18 + pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ]; 14 19 ignoreCollisions = true; 20 + nativeBuildInputs = [ 21 + makeWrapper 22 + ]; 15 23 postBuild = '' 16 - cp ${cli}/dotnet $out/dotnet 24 + cp -R ${cli}/{dotnet,LICENSE.txt,nix-support,ThirdPartyNotices.txt} $out/ 25 + 17 26 mkdir $out/bin 18 - ln -s $out/dotnet $out/bin/ 27 + ln -s $out/dotnet $out/bin/dotnet 28 + wrapProgram $out/bin/dotnet \ 29 + --prefix LD_LIBRARY_PATH : ${cli.icu}/lib 19 30 ''; 31 + passthru = { 32 + inherit (cli) icu packages; 33 + }; 20 34 }