ayaports/apk/v3.15/main/dotnet6/source-build-reference-packages_musl-check.patch
build@apk-groulx c1ad1ccbc7 update
2022-01-23 02:53:35 +00:00

24 lines
1.3 KiB
Diff

diff --git a/src/targetPacks/Directory.Build.targets b/src/targetPacks/Directory.Build.targets
index 3289635d..34f9af45 100644
--- a/src/targetPacks/Directory.Build.targets
+++ b/src/targetPacks/Directory.Build.targets
@@ -59,9 +59,19 @@
</Target>
<Target Name="GetILToolPackageReferences">
+ <Exec IgnoreExitCode="true" Command="ldd --version 2&gt;&amp;1 | grep -q musl">
+ <Output TaskParameter="ExitCode" PropertyName="OSPlatformIsMuslCheck" />
+ </Exec>
+
+ <PropertyGroup>
+ <OSPlatformIsMusl Condition="$(OSPlatformIsMuslCheck) == '0'">true</OSPlatformIsMusl>
+ <OSPlatformIsMusl Condition="$(OSPlatformIsMusl) == ''">false</OSPlatformIsMusl>
+ </PropertyGroup>
+
<PropertyGroup>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('windows'))">win</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</_OSPlatform>
+ <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux')) and '$(OSPlatformIsMusl)' == 'true'">linux-musl</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('freebsd'))">freebsd</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('netbsd'))">netbsd</_OSPlatform>