# Maintainer: Antoine Martin (ayakael) # Based on Archlinux PKGBUILD by: # Maxime Gauduin # Kristian Mosegaard # Max Liebkies # Krzysztof Bogacki # # Build vars # # Sets whether we use pre-built bootstraps from microsoft or repo-provided # bootstraps for building _bootstrap=false _bootstrap_sdk=5.0.12-r0 _bootstrap_runtime=3.1.20-r2 # LLVM version _llvmver=12 pkgname=dotnet-5.0 pkgdesc='The .NET Core SDK' pkgver=5.0.12 pkgrel=1 arch='x86_64' url=https://www.microsoft.com/net/core license='MIT' makedepends=" bash clang cmake git icu-dev inetutils-syslogd krb5-dev libgit2-dev libunwind-dev libunwind libxml2-dev libxml2-utils lldb-dev llvm$_llvmver-dev lttng-ust-dev nodejs openssl-dev linux-headers zlib-dev " if [ $_bootstrap != 'true' ]; then makedepends=" $makedepends dotnet-bootstrap-runtime-3.1=$_bootstrap_runtime dotnet-bootstrap-sdk-5.0=$_bootstrap_sdk " fi subpackages=" dotnet-sdk-5.0:sdk dotnet-host:host dotnet-runtime-5.0:runtime aspnet-runtime-5.0:aspnet_runtime:noarch netstandard-targeting-pack:netstandard_targeting_pack:noarch dotnet-targeting-pack-5.0:targeting_pack aspnet-targeting-pack-5.0:aspnet_targeting_pack:noarch" _gittag=v$pkgver.1-runtime _giturl=https://github.com/dotnet/source-build options="!check" source=" $pkgname-$_gittag.git.zip dotnet.sh https://dot.net/v1/dotnet-install.sh runtime_add-rid-for-alpine-315.patch runtime_link-order.patch runtime_non-portable-distrorid-fix-alpine.patch build_darc-fix-alpine.patch sdk_telemetry-optout.patch " builddir="$srcdir/$pkgname" snapshot() { mkdir -p "$srcdir" cd "$srcdir" if ! [ -d $pkgname.git ]; then git clone $_giturl $pkgname.git cd $pkgname.git else cd $pkgname.git git fetch fi echo "Repo archive" mkfifo $pkgname-$_gittag.git git bundle create - $_gittag > $pkgname-$_gittag.git & zip --fifo "$SRCDEST"/$pkgname-$_gittag.git.zip $pkgname-$_gittag.git rm $pkgname-$_gittag.git ln -s "$SRCDEST"/$pkgname-$_gittag.git.zip "$startdir"/$pkgname-$_gittag.git.zip } unpack() { default_unpack cd "$srcdir" git clone $pkgname-$_gittag.git $pkgname --branch $_gittag 1>/dev/null 2>&1 } default_prepare() { local i failed= [ -n "$builddir" -a -d "$builddir" ] && cd "$builddir" 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" if [ "$_bootstrap" == 'true' ]; then chmod +x "$srcdir"/dotnet-install.sh "$srcdir"/dotnet-install.sh --version $_bootstrap_sdk --install-dir ./ "$srcdir"/dotnet-install.sh --version $_bootstrap_runtime --install-dir ./ --runtime dotnet else cp -r /usr/share/dotnet/* ./ fi # disable warnings sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props } pkgver() { cd "$builddir" local _runtimever=$(xmllint --xpath "//Dependency[@Name='Microsoft.NETCore.App.Runtime.win-x64']/@Version" eng/Version.Details.xml | cut -d '=' -f 2 | sed 's/^"//; s/"$//') local _sdkver=$(xmllint --xpath "//Dependency[@Name='Microsoft.NET.Sdk']/@Version" eng/Version.Details.xml | cut -d '=' -f 2 | sed 's/^"//; s/"$//; s/-rtm.*//; s/-servicing.*//') echo "$_runtimever.sdk${_sdkver##*.}" } build() { msg "Building $pkgname-$pkgver" export SOURCE_BUILD_SKIP_SUBMODULE_CHECK=1 ./build.sh \ --with-sdk ../$pkgname \ /p:ArchiveDownloadedPackages=true \ /p:ContinueOnPrebuiltBaselineError=true \ /p:SkipPortableRuntimeBuild=true \ /p:SkipPrebuiltEnforcement=true \ /p:UseSystemLibraries=true \ /p:UseSystemLibunwind=true } package() { depends=' dotnet-sdk-5.0 dotnet-host dotnet-runtime-5.0 dotnet-targetting-pack-5.0 aspnet-runtime-5.0 aspnet-targeting-pack-5.0 netstandard-targeting-pack ' mkdir -p "$pkgdir" } sdk() { depends=' dotnet-runtime-5.0 dotnet-targeting-pack-5.0 musl libgcc netstandard-targeting-pack aspnet-targeting-pack-5.0 ' provides="dotnet-bootstrap-sdk-5.0=$pkgver-r$pkgrel" cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner sdk templates ln -s dotnet-host "$subpkgdir"/usr/share/licenses/dotnet-sdk-5.0 } host() { pkgdesc='A generic driver for the .NET Core Command Line Interface' depends=' gcc musl ' 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-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner dotnet host bsdtar -xf dotnet-sdk-*.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' makedepends=' icu-dev krb5-dev libunwind-dev zlib-dev openssl-dev ' depends=' dotnet-host libgcc musl icu krb5-libs libunwind zlib openssl ' provides="dotnet-bootstrap-runtime-5.0=$pkgver-r$pkgrel" cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner shared/Microsoft.NETCore.App ln -s dotnet-host "$subpkgdir"/usr/share/licenses/dotnet-runtime-5.0 } aspnet_runtime() { pkgdesc='The ASP.NET Core runtime' depends='dotnet-runtime-5.0' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner shared/Microsoft.AspNetCore.App ln -s dotnet-host "$subpkgdir"/usr/share/licenses/aspnet-runtime-5.0 } netstandard_targeting_pack() { pkgdesc='The .NET Standard targeting pack' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner packs/NETStandard.Library.Ref ln -s dotnet-host "$subpkgdir"/usr/share/licenses/netstandard-targeting-pack-5.0 } targeting_pack() { pkgdesc='The .NET Core targeting pack' depends='netstandard-targeting-pack' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.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/dotnet-targeting-pack-5.0 } aspnet_targeting_pack() { pkgdesc='The ASP.NET Core targeting pack' depends='dotnet-targeting-pack-5.0' cd "$builddir"/artifacts/x64/Release install -dm 755 "$subpkgdir"/usr/share/dotnet "$subpkgdir"/usr/share/licenses bsdtar -xf dotnet-sdk-*.tar.gz -C "$subpkgdir"/usr/share/dotnet/ --no-same-owner packs/Microsoft.AspNetCore.App.Ref ln -s dotnet-host "$subpkgdir"/usr/share/licenses/aspnet-targeting-pack-5.0 } sha512sums=" 7899483157a32012137e4ee44b03173908f6325085b7ee352ee329a208a0d1e5b434d1f24099e5b346ec9753e23c6a94553e76dc76a1ea6633392758132ed492 dotnet-5.0-v5.0.12.1-runtime.git.zip f58bd83b709dcb4b0b67830756069c34258a167b33cb290cbf30f21d69d75402d38e013fd7bbf00640fe19e397f78df6ff787cf8484ee8967d5b8809f033eafb dotnet.sh ecab4809e617e9cd30940b1c1a700e16b37b5974c850a60da7f1a25bf81516850e4533ef39d2d8786381e0e4e325d3b53fbb2377ecaa6c0813bb00fc1c92b784 dotnet-install.sh 4899175597a1d4cd14c382469fe17e6d8d4644b784dca02eb2d4f71afa8e898e60269d5b0cdfea6e3ed6dc92feb676c6db21aae3bcb206d859c02cd10cdcaca0 runtime_add-rid-for-alpine-315.patch 0d6ca9b4c6bb0999102f8a51b408c6f938d7262af552d63ef180fdc9a48bba940d0437d0d06916c3f7be7e70e2717a46a4ebc91c0f85467cbc7776b944eca83e runtime_link-order.patch 6dd3ff4db79aa95fa37ba4011da82c74d8ac83a7a92124fc4a97bd78b818b024b569df293b1edae2b16d8161c76b6a00e1c81bd421480e367925af64673b0f84 runtime_non-portable-distrorid-fix-alpine.patch 74767c34f15e0eaee3682516e093296621efaeeb6d84e62d826587db9b559fb7c00c42aafbf4fdfd34460d1cf16edad3fd5f720f2b37f8bf52b26d7f73f79d5e build_darc-fix-alpine.patch c96700138ea919c169c3a394f1bf9548c7f86b1ba42b193d6e7bb0a1e2bd6f7f202befbc61246a8720181cd40e1f7fa36a6c208eb19b03a23e21994136fb2507 sdk_telemetry-optout.patch "