ayaports/community/dotnet7-runtime/APKBUILD

153 lines
4.6 KiB
Text
Raw Permalink Normal View History

2023-02-21 23:49:07 -05:00
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
2024-01-08 22:01:40 -05:00
pkgname=dotnet8-sdk
pkgver=8.0.100
_bldver=8.0.0-r0
2023-02-21 23:49:07 -05:00
pkgrel=0
# Following for dotnet build version 6.0 and up
_pkgver_macro=${pkgver%.*}
_pkgver_name=${_pkgver_macro//[.0]}
_bldver_ver=${_bldver%%-*}
2024-01-08 22:01:40 -05:00
_bldver_ver=${_bldver_ver/0./0.10}
pkgdesc="The .NET $_pkgver_macro SDK"
2023-02-21 23:49:07 -05:00
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
2024-01-08 22:01:40 -05:00
# riscv64: blocked by https://github.com/dotnet/runtime/issues/84834
arch="all !x86 !armhf !riscv64"
2023-02-21 23:49:07 -05:00
url=https://dotnet.microsoft.com
license="MIT"
2024-01-08 22:01:40 -05:00
makedepends="dotnet$_pkgver_name-runtime-bootstrap=$_bldver"
2023-02-21 23:49:07 -05:00
subpackages="
2024-01-08 22:01:40 -05:00
dotnet$_pkgver_name-templates:templates:noarch
dotnet$_pkgver_name-sdk-dbg:dbg:noarch
dotnet-zsh-completion:zshcomp:noarch
dotnet-bash-completion:bashcomp:noarch
dotnet-doc
netstandard21-targeting-pack:netstandard_targeting_pack:noarch
2023-02-21 23:49:07 -05:00
"
provides="dotnet$_pkgver_name=$pkgver-r$pkgrel"
options="!check" # No test suite
builddir="$srcdir"
_libdir="/usr/lib"
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
package() {
2024-01-08 22:01:40 -05:00
# libucontext isn't automatically detected on all platforms
depends="
aspnetcore$_pkgver_name-runtime
aspnetcore$_pkgver_name-targeting-pack
dotnet$_pkgver_name-apphost-pack
dotnet$_pkgver_name-targeting-pack
dotnet$_pkgver_name-templates
netstandard21-targeting-pack
libucontext
"
provides="
dotnet-sdk-$_pkgver_macro=$pkgver-r$pkgrel
dotnet$_pkgver_name-dev=$pkgver-r$pkgrel
"
install -dm 755 "$pkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/sdk "$pkgdir"/$_libdir/dotnet/.
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/sdk-manifests "$pkgdir"/$_libdir/dotnet/.
# See https://github.com/dotnet/source-build/issues/2579
find "$pkgdir" -type f -name 'vstest.console' -delete
find "$pkgdir" -type f -name 'testhost.x86' -delete
# docs
install -dm 755 "$pkgdir"/usr/share/man/man1
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/docs/* "$pkgdir"/usr/share/man/man1/.
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
dbg() {
pkgdesc="The .NET $_pkgver_macro SDK - debug pdb files"
depends="dotnet$_pkgver_name-sdk"
provides="dotnet-sdk-pdb-$_pkgver_macro=$pkgver-r$pkgrel"
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -dm 755 "$subpkgdir"/$_libdir/dotnet
# move pdb files
cd "$pkgdir" || return 0
find . -type f ! -name "$(printf "*\n*")" -name '*.pdb' > tmp
while IFS= read -r i; do
d="$subpkgdir/${i%/*}" # dirname $i
mkdir -p "$d"
mv "$pkgdir/$i" "$d"
rmdir "$pkgdir/${i%/*}" 2>/dev/null || :
done < tmp
rm tmp
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
netstandard_targeting_pack() {
pkgdesc="The .NET 2.1 Standard targeting pack"
2023-02-21 23:49:07 -05:00
depends="dotnet-host"
2024-01-08 22:01:40 -05:00
provides="netstandard-targeting-pack-2.1=$pkgver-r$pkgrel"
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/NETStandard.Library.Ref "$subpkgdir"/$_libdir/dotnet/packs/
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
# remove pdb files
find "$subpkgdir" -type f -name '*.pdb' -delete
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
templates() {
pkgdesc="The .NET $_pkgver_macro templates"
depends="dotnet-host"
provides="dotnet-templates-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/templates "$subpkgdir"/$_libdir/dotnet/.
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
# remove pdb files
find "$subpkgdir" -type f -name '*.pdb' -delete
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
zshcomp() {
depends=""
pkgdesc="zsh completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack zsh"
depends="dotnet-host"
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -dm 755 "$subpkgdir"/usr/share/zsh/site-functions
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -m 755 "$_libdir"/dotnet/bootstrap/$_bldver_ver/register-completions.zsh "$subpkgdir"/usr/share/zsh/site-functions/_dotnet
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
bashcomp() {
depends=""
pkgdesc="bash completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack bash-completion"
depends="dotnet-host"
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -dm 755 "$subpkgdir"/usr/share/bash-completion/completions
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
install -m 755 "$_libdir"/dotnet/bootstrap/$_bldver_ver/register-completions.bash "$subpkgdir"/usr/share/bash-completion/completions/_dotnet
2023-02-21 23:49:07 -05:00
}
2024-01-08 22:01:40 -05:00
doc() {
default_doc
pkgdesc="Docs for .NET"
2023-02-21 23:49:07 -05:00
2024-01-08 22:01:40 -05:00
# licenses
install -dm 755 "$subpkgdir"/usr/share/licenses/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/LICENSE.txt "$subpkgdir"/usr/share/licenses/dotnet/.
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/ThirdPartyNotices.txt "$subpkgdir"/usr/share/licenses/dotnet/.
2023-02-21 23:49:07 -05:00
}