dotnet8-sdk: upgrade for diff

This commit is contained in:
Antoine Martin 2024-01-08 22:01:40 -05:00
parent 596d3b6b7a
commit 34e084db82
Signed by: forge
GPG key ID: D62A472A4AA7D541
3 changed files with 143 additions and 171 deletions

View file

@ -1,87 +1,34 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net> # Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net> # Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# secfixes: pkgname=dotnet8-sdk
# 7.0.3-r0: pkgver=8.0.100
# - CVE-2023-21808 _bldver=8.0.0-r0
# 7.0.5-r0:
# - CVE-2023-28260
# 7.0.7-r0:
# - CVE-2023-24895
# - CVE-2023-24897
# - CVE-2023-24936
# - CVE-2023-29331
# - CVE-2023-29337
# - CVE-2023-32032
# - CVE-2023-33126
# - CVE-2023-33128
# - CVE-2023-33135
# 7.0.9-r0:
# - CVE-2023-33127
# - CVE-2023-33170
# 7.0.10-r0:
# - CVE-2023-38178
# - CVE-2023-35390
# - CVE-2023-38180
# - CVE-2023-35391
# 7.0.11-r0:
# - CVE-2023-36792
# - CVE-2023-36793
# - CVE-2023-36794
# - CVE-2023-36796
# - CVE-2023-36799
# 7.0.12-r0:
# - CVE-2023-36435
# - CVE-2023-38171
# - CVE-2023-44487
# 7.0.13-r0:
# - CVE-2023-36792
# - CVE-2023-36793
# - CVE-2023-36794
# - CVE-2023-36796
# - CVE-2023-36799
# - CVE-2023-44487
# - CVE-2023-38171
# - CVE-2023-36435
# 7.0.14-r0:
# - CVE-2023-36049
# - CVE-2023-36558
pkgname=dotnet7-runtime
pkgver=7.0.14
_bldver=7.0.114-r0
pkgrel=0 pkgrel=0
# Following for dotnet build version 6.0 and up # Following for dotnet build version 6.0 and up
_pkgver_macro=${pkgver%.*} _pkgver_macro=${pkgver%.*}
_pkgver_name=${_pkgver_macro//[.0]} _pkgver_name=${_pkgver_macro//[.0]}
_bldver_ver=${_bldver%%-*} _bldver_ver=${_bldver%%-*}
pkgdesc="The .NET $_pkgver_macro Core runtime" _bldver_ver=${_bldver_ver/0./0.10}
pkgdesc="The .NET $_pkgver_macro SDK"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667 # x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663 # armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# riscv64: port WIP https://github.com/dotnet/runtime/issues/36748 # riscv64: blocked by https://github.com/dotnet/runtime/issues/84834
# s390x: no diskspace arch="all !x86 !armhf !riscv64"
arch="x86_64 armv7 aarch64"
url=https://dotnet.microsoft.com url=https://dotnet.microsoft.com
license="MIT" license="MIT"
depends=" makedepends="dotnet$_pkgver_name-runtime-bootstrap=$_bldver"
dotnet$_pkgver_name-hostfxr
icu-data-full
icu-libs
"
makedepends="dotnet$_pkgver_name-build=$_bldver"
subpackages=" subpackages="
aspnetcore$_pkgver_name-runtime:aspnetcore_runtime:noarch dotnet$_pkgver_name-templates:templates:noarch
aspnetcore$_pkgver_name-targeting-pack:aspnetcore_targeting_pack:noarch dotnet$_pkgver_name-sdk-dbg:dbg:noarch
dotnet$_pkgver_name-apphost-pack:apphost_pack dotnet-zsh-completion:zshcomp:noarch
dotnet$_pkgver_name-hostfxr dotnet-bash-completion:bashcomp:noarch
dotnet$_pkgver_name-targeting-pack:targeting_pack:noarch dotnet-doc
dotnet-host:host netstandard21-targeting-pack:netstandard_targeting_pack:noarch
" "
provides="dotnet$_pkgver_name=$pkgver-r$pkgrel" provides="dotnet$_pkgver_name=$pkgver-r$pkgrel"
options="!check" # No test suite options="!check" # No test suite
source="dotnet.sh.in"
builddir="$srcdir" builddir="$srcdir"
_libdir="/usr/lib" _libdir="/usr/lib"
@ -93,80 +40,113 @@ case $CARCH in
*) _dotnet_arch="$CARCH";; *) _dotnet_arch="$CARCH";;
esac esac
build() {
sed "s|%LIBDIR%|$_libdir/dotnet|" "$srcdir"/dotnet.sh.in > "$srcdir"/dotnet.sh
}
package() { package() {
install -dm 755 "$pkgdir"/$_libdir/dotnet/shared # 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
"
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.NETCore.App "$pkgdir"/$_libdir/dotnet/shared/. 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/.
} }
host() { dbg() {
pkgdesc="A generic driver for the .NET Core Command Line Interface" pkgdesc="The .NET $_pkgver_macro SDK - debug pdb files"
depends="" depends="dotnet$_pkgver_name-sdk"
provides="dotnet-sdk-pdb-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 \
"$subpkgdir"/etc/profile.d \
"$subpkgdir"/etc/dotnet \
"$subpkgdir"/usr/bin \
"$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/dotnet "$subpkgdir"/$_libdir/dotnet/.
ln -s $_libdir/dotnet/dotnet "$subpkgdir"/usr/bin/dotnet
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location_$_dotnet_arch
install -Dm 644 "$srcdir"/dotnet.sh -t "$subpkgdir"/etc/profile.d/
}
hostfxr() {
pkgdesc="The .NET host resolver contains the logic to resolve and select the right version of the .NET SDK or runtime to use."
depends="dotnet-host"
provides="dotnet-hostfxr-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet install -dm 755 "$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/host "$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
} }
aspnetcore_runtime() { netstandard_targeting_pack() {
pkgdesc="The ASP.NET $_pkgver_macro Core runtime" pkgdesc="The .NET 2.1 Standard targeting pack"
depends="dotnet$_pkgver_name-runtime" depends="dotnet-host"
provides="aspnetcore-runtime-$_pkgver_macro=$pkgver-r$pkgrel" provides="netstandard-targeting-pack-2.1=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/shared
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.AspNetCore.App "$subpkgdir"/$_libdir/dotnet/shared/.
}
apphost_pack() {
pkgdesc="The .NET $_pkgver_macro Core apphost pack"
provides="dotnet-apphost-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Host.* "$subpkgdir"/$_libdir/dotnet/packs/. cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/NETStandard.Library.Ref "$subpkgdir"/$_libdir/dotnet/packs/
# remove pdb files
find "$subpkgdir" -type f -name '*.pdb' -delete
} }
targeting_pack() { templates() {
pkgdesc="The .NET $_pkgver_macro Core targeting pack" pkgdesc="The .NET $_pkgver_macro templates"
provides="dotnet-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel" depends="dotnet-host"
provides="dotnet-templates-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs install -dm 755 "$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/. cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/templates "$subpkgdir"/$_libdir/dotnet/.
# remove pdb files
find "$subpkgdir" -type f -name '*.pdb' -delete
} }
aspnetcore_targeting_pack() { zshcomp() {
pkgdesc="The ASP.NET $_pkgver_macro Core targeting pack" depends=""
provides="aspnetcore-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel" 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"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs install -dm 755 "$subpkgdir"/usr/share/zsh/site-functions
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.AspNetCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/. install -m 755 "$_libdir"/dotnet/bootstrap/$_bldver_ver/register-completions.zsh "$subpkgdir"/usr/share/zsh/site-functions/_dotnet
} }
sha512sums=" bashcomp() {
c3f31956976b77198e72a3fef3427338b6b2961f8c121416040c1105de0ce8073e46f4c2e9ef22a001aee69cbe39621c2ddac988522693110071dfae42f2e2b7 dotnet.sh.in 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"
install -dm 755 "$subpkgdir"/usr/share/bash-completion/completions
install -m 755 "$_libdir"/dotnet/bootstrap/$_bldver_ver/register-completions.bash "$subpkgdir"/usr/share/bash-completion/completions/_dotnet
}
doc() {
default_doc
pkgdesc="Docs for .NET"
# 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/.
}

View file

@ -1,21 +1,20 @@
# dotnet7-runtime # dotnet8-sdk
This is the .NET 7.0 package for Alpine Linux. This is the .NET 8.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info # Building info
## Generated packages ## Generated packages
* `aspnetcore7-runtime` * `dotnet8-sdk`
* `aspnetcore7-targeting-pack` * `dotnet8-templates` (required by sdk)
* `dotnet7-apphost-pack` (used by dotnet7-runtime) * `dotnet-zsh-completion`
* `dotnet7-hostfxr` (used by dotnet-host) * `dotnet-bash-completion`
* `dotnet7-runtime` * `dotnet-doc`
* `dotnet7-targeting-pack` * `netstandard21-targeting-pack`
* `dotnet-host`
## How to build dotnet7 on Alpine ## How to build dotnet8 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E) follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
@ -26,17 +25,22 @@ builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms. platforms.
In summary, dotnet7 is built using three different aports. In summary, dotnet8 is built using three different aports.
* `community/dotnet7-stage0` * `community/dotnet8-stage0`
Builds minimum components for full build of dotnet7, and packages these in an initial Builds minimum components for full build of dotnet8, and packages these in an initial
`dotnet7-stage0-bootstrap` package that `dotnet7-build` pulls. `dotnet8-stage0-bootstrap` package that `dotnet8-runtime` pulls.
* `community/dotnet7-build` * `community/dotnet8-runtime
Builds full and packages dotnet7 fully using either stage0 or previoulsy built Builds full and packages dotnet8 fully using either stage0 or previoulsy built
dotnet7 build. dotnet8 build.
* `community/dotnet7-runtime` * `community/dotnet8-sdk`
As abuild does not allow different versions for subpackages, a different aport As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet7-build. is required to package runtime bits from dotnet8-runtime. dotnet8-runtime only
builds 8.0.1xx feature branch of SDK. Thus, when a new feature branch of sdk is
released, the updated components are to be built on dotnet8-sdk rather than
simply repackaging dotnet8-runtime artifacts.
## Crossbuilding with `stage0` ## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process: Crossbuilding `stage0` is a three step process:
@ -48,7 +52,7 @@ Crossbuilding `stage0` is a three step process:
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required `$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos be pulled from package repos
3. Crossbuild `dotnet7-stage0` via: 3. Crossbuild `dotnet8-stage0` via:
``` ```
CHOST=$CTARGET_ARCH abuild -r CHOST=$CTARGET_ARCH abuild -r
``` ```
@ -57,7 +61,7 @@ CHOST=$CTARGET_ARCH abuild -r
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging), This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`). with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet7` as opposed to `dotnet-7.0` In addition, the package is named `dotnet8` as opposed to `dotnet-8.0`
to match Alpine Linux naming conventions for packages with many installable versions to match Alpine Linux naming conventions for packages with many installable versions
# Contributing # Contributing
@ -73,7 +77,7 @@ follow.
2. Checkout the forked repository. 2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports` - `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build` - `cd community/dotnet8-sdk`
3. Make your changes. Don't forget to add a changelog. 3. Make your changes. Don't forget to add a changelog.
@ -85,15 +89,15 @@ follow.
6. Commit the changes to the git repo in a git branch 6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet7/<name>` - `git checkout -b dotnet8/<name>`
- `git add` any new patches - `git add` any new patches
- `git remove` any now-unnecessary patches - `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: descriptive description'` - `git commit -m 'community/dotnet8-sdk: descriptive description'`
- `git push` - `git push`
7. Create a merge request with your changes, tagging @ayakael for review. 7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the pull-request pass, and reviewers are happy, your changes 8. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged. will be merged.
## Updating to an new upstream release ## Updating to an new upstream release
@ -103,7 +107,7 @@ follow.
2. Checkout the forked repository. 2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports` - `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build` - `cd community/dotnet8-sdk`
3. Build the new upstream source tarball. Update the versions in the 3. Build the new upstream source tarball. Update the versions in the
@ -124,15 +128,15 @@ follow.
7. Commit the changes to the git repo in a git branch. 7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet7/<name>` - `git checkout -b dotnet8/<name>`
- `git add` any new patches - `git add` any new patches
- `git remove` any now-unnecessary patches - `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: upgrade to <new-version>` - `git commit -m 'community/dotnet8-sdk: upgrade to <new-version>`
- `git push` - `git push`
8. Create a merge request with your changes, tagging @ayakael for review. 8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the pull-request pass, and reviewers are happy, your changes 9. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged. will be merged.
# Testing # Testing

View file

@ -1,12 +0,0 @@
# Set location for AppHost lookup
[ -z "$DOTNET_ROOT" ] && export DOTNET_ROOT=%LIBDIR%
# Add dotnet tools directory to PATH
DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"
case "$PATH" in
*"$DOTNET_TOOLS_PATH"* ) true ;;
* ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;;
esac
# Extract self-contained executables under HOME to avoid multi-user issues from using the default '/var/tmp'
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract"