# Maintainer: Antoine Martin (ayakael) # Based on Archlinux PKGBUILD by: # Maxime Gauduin # Kristian Mosegaard # Max Liebkies # Krzysztof Bogacki _llvmver=12 pkgname=dotnet31 pkgdesc='The .NET Core SDK' pkgver=3.1.120 pkgrel=0 arch='x86_64 armv7 aarch64' url=https://www.microsoft.com/net/core license='MIT' makedepends=" bash clang cmake git icu-dev inetutils-syslogd krb5-dev libgit2-dev libunwind-dev libxml2-dev libxml2-utils libintl lldb-dev llvm$_llvmver-dev lttng-ust-dev linux-headers nodejs openssl-dev zlib-dev dotnet31-bootstrap-sdk dotnet31-bootstrap-runtime " subpackages=" dotnet31-host:host dotnet31-sdk:sdk dotnet31-runtime:runtime aspnet31-runtime:aspnet_runtime:noarch dotnet31-targeting-pack:targeting_pack aspnet31-targeting-pack:aspnet_targeting_pack:noarch netstandard31-targeting-pack:netstandard_targeting_pack:noarch " _gittag=v$pkgver-SDK _giturl=https://github.com/dotnet/source-build options="!check !archcheck !tracedeps" source=" $pkgname-$_gittag.tar.gz::$_giturl/archive/refs/tags/$_gittag.tar.gz https://dot.net/v1/dotnet-install.sh dotnet.sh application-insights_fix-net40-location.patch build_coreclr-tools-path.patch build_darc-fix-alpine.patch coreclr_fix-build-on-Alpine-edge-45352.patch coreclr_non-portable-distrorid-fix-alpine.patch core-setup_rid-plat-generation-on-alpine-fix.patch corefx_fix-build-clang10.patch corefx_added-alpine-315-rid.patch core-sdk_generate-layout-core-setup-blob-path-fix.patch " _srcbld="source-build-$(echo $_gittag | sed 's|v||')" builddir="$srcdir/$_srcbld" default_prepare() { local i failed= if [ -n "$builddir"] && [ -d "$builddir" ]; then cd "$builddir"; fi if ! have_patches; then return 0 fi [ -d "$builddir" ] || { error "Is \$builddir set correctly?"; return 1; } msg "Deploying patches" for i in $source; do case ${i%::*} in build_*.patch) patch ${patch_args:--p1} -i "$srcdir/$(filename_from_uri $i)" || failed="$failed $i" ;; *.patch) local _package=$(echo $i | sed 's|_.*||') local _patch=$(echo $i | sed "s|$_package_||") echo "cp $_patch -> $_package" [ -d patches/$_package ] || mkdir patches/$_package cp "$srcdir"/"$i" patches/$_package/$_patch ;; esac done if [ -z "$failed" ]; then return 0 fi error "The following patches failed to apply:" for i in $failed; do printf " %s\n" "$i" done return 1 } prepare() { default_prepare msg "Settings up bootstrap SDK" cp -r /usr/share/dotnet/* ./ if [ $(find sdk -type d -not -name '3.1.*' -maxdepth 1 -mindepth 1) ]; then find sdk -type d -not -name '3.1.*' -maxdepth 1 -mindepth 1 -print0 | xargs -0 rm -R -- fi # disable warnings sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.common.props # darc git init git init } build() { msg "Building $pkgname-$pkgver" export SOURCE_BUILD_SKIP_SUBMODULE_CHECK=1 ./build.sh \ --with-sdk ../$_srcbld \ /p:ArchiveDownloadedPackages=true \ /p:ContinueOnPrebuiltBaselineError=true \ /p:SkipPortableRuntimeBuild=true \ /p:SkipPrebuiltEnforcement=true \ /p:UseSystemLibraries=true \ /p:UseSystemLibunwind=true } package() { depends=' dotnet31-sdk dotnet-host dotnet31-runtime dotnet31-targetting-pack aspnet31-runtime aspnet31-targeting-pack netstandard21-targeting-pack ' export _runtimever=$(xmllint --xpath "//Dependency[@Name='Microsoft.NETCore.App.Runtime.linux-x64']/@Version" "$builddir"/eng/Version.Details.xml | cut -d '=' -f 2 | sed 's/^"//; s/"$//') export _sdkver=$(xmllint --xpath "//Dependency[@Name='Microsoft.NET.Sdk']/@Version" "$builddir"/eng/Version.Details.xml | cut -d '=' -f 2 | sed 's/^"//; s/"$//; s/-rtm.*//; s/-servicing.*//') mkdir -p "$pkgdir" } sdk() { depends=' dotnet31-runtime dotnet31-targeting-pack musl libgcc netstandard21-targeting-pack aspnet31-targeting-pack ' pkgver=$_sdkver provider_priority=100 provides="dotnet31-bootstrap-sdk" cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner sdk templates ln -s dotnet-host "$subpkgdir"/usr/share/licenses/dotnet31-sdk } host() { pkgdesc='A generic driver for the .NET Core Command Line Interface' pkgver=$_runtimever depends=' gcc musl ' provides="dotnet-host" provider_priority=2 cd $builddir/artifacts/x64/Release install -dm 755 "$subpkgdir"/etc/profile.d "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses/dotnet-host bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner dotnet host bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/licenses/dotnet-host/ --no-same-owner LICENSE.txt ThirdPartyNotices.txt ln -s /usr/share/dotnet/dotnet "$subpkgdir"/usr/bin/dotnet ln -s /usr/share/dotnet/host/fxr/$pkgver/libhostfxr.so "$subpkgdir"/usr/lib/libhostfxr.so install -Dm 644 "$srcdir"/dotnet.sh -t "$subpkgdir"/etc/profile.d/ } runtime() { pkgdesc='The .NET Core runtime' pkgver=$_runtimever makedepends=' icu-dev krb5-dev libunwind-dev zlib-dev openssl-dev ' depends=' dotnet-host libgcc musl icu krb5-libs libunwind zlib openssl ' provider_priority=100 provides="dotnet31-bootstrap-runtime" cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner shared/Microsoft.NETCore.App ln -s dotnet-host "$subpkgdir"/usr/share/licenses/dotnet31-runtime } aspnet_runtime() { pkgdesc='The ASP.NET Core runtime' pkgver=$_runtimever depends='dotnet31-runtime' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner shared/Microsoft.AspNetCore.App ln -s dotnet-host "$subpkgdir"/usr/share/licenses/aspnet31-runtime } targeting_pack() { pkgdesc='The .NET Core targeting pack' pkgver=$_runtimever depends='netstandard21-targeting-pack' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner packs/Microsoft.NETCore.App.Host.* packs/Microsoft.NETCore.App.Ref ln -s dotnet-host "$subpkgdir"/usr/share/licenses/dotnet31-targeting-pack } netstandard_targeting_pack() { pkgdesc='The .NET Standard targeting pack' pkgver=$_runtimever provides="netstandard21-targeting-pack" provider_priority=1 cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner packs/NETStandard.Library.Ref ln -s dotnet-host "$subpkgdir"/usr/share/licenses/netstandard21-targeting-pack } aspnet_targeting_pack() { pkgdesc='The ASP.NET Core targeting pack' pkgver=$_runtimever depends='dotnet31-targeting-pack' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-3.1*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner packs/Microsoft.AspNetCore.App.Ref ln -s dotnet-host "$subpkgdir"/usr/share/licenses/aspnet31-targeting-pack } sha512sums=" 33b0f76ca72e6b2ebef50338b6c4208e02f513ebfc67525481f945c12359ea030fe48017971d9f64522dc2f829beff790f10ba79e3b579c2ef90703fe9b4b27d dotnet31-v3.1.120-SDK.tar.gz ecab4809e617e9cd30940b1c1a700e16b37b5974c850a60da7f1a25bf81516850e4533ef39d2d8786381e0e4e325d3b53fbb2377ecaa6c0813bb00fc1c92b784 dotnet-install.sh e61b9e3e5a2305646a616d598378230c9755c5dd5363692cc363f8f4add3807563c324dd86f3a7ae9d358c82d730608e7b293935a2b6c81c0c0f62d752a0a1cf dotnet.sh 0469d571d0f7634d3794761f04e1cbff9d27d642d134a11a13560574280e5cab6f366eb8820e61a449eca99470fdea8d9f6a7d97b633059b2fe25257ed1579e6 application-insights_fix-net40-location.patch 2334e36d5bb24b9b834800407c6110c09262af20a4353e92ef1897855f27eab117270dda0637071010a7a5ac8c4a5d4032240a7b659d8576801b503b66b14ab7 build_coreclr-tools-path.patch 74767c34f15e0eaee3682516e093296621efaeeb6d84e62d826587db9b559fb7c00c42aafbf4fdfd34460d1cf16edad3fd5f720f2b37f8bf52b26d7f73f79d5e build_darc-fix-alpine.patch b3475c0b727c5258c7bc6f4c53305f9ced991e57f9f46a2ad323bed40627662eb8bf57286bf6a22d9a22bfdea9282da4630dd094166f0805c783aece5df5dff3 coreclr_fix-build-on-Alpine-edge-45352.patch 6ac9bdbc47b24cafbb3386e21756c540313680fed6994791ff5a3c75b422742ecf102d7736ac79de6d7f1a0892464f83cbab181ed505e4d827dc7f113e3a4017 coreclr_non-portable-distrorid-fix-alpine.patch 720fefc20ef4985917cfd243bbef427862af9ea0156cc6c78502daf8da5f6293bba0a1a5180c88dc145921592d533a8508b30eab2f388be1be7d6d10b6ab91d0 core-setup_rid-plat-generation-on-alpine-fix.patch eb107ae9765d9eebe2f2ab4cebda4d3f76d683e21d88f806bb008e29051ad196ea637d410075b7ed61f4997a22085e4c36021860b82c4c0822c23ba9ded9656a corefx_fix-build-clang10.patch 72092a7323bb91e8d011ad09cefcc3fd0e4ebfc7c258895d454cc1d015eda36c7de97b09af76a492fa689f39b9216435faace77edd0ca75d8e39a34ed6641840 corefx_added-alpine-315-rid.patch e67f4f92659892aa65de7192dfbbf2cafab17e1a4ef60e4981507c7309da61b866864a18b0452e47cee2ce9253032c3f4c39e4426b7b2216ffa73236239c9669 core-sdk_generate-layout-core-setup-blob-path-fix.patch "