commit:     b90e60ae105ecaf7a993a52342cfd602c32800a0
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 12 19:56:30 2025 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Sat Jul 12 20:28:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b90e60ae

dev-dotnet/dotnet-sdk: bump to 9.0.108

Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-dotnet/dotnet-sdk/Manifest                     |   2 +
 dev-dotnet/dotnet-sdk/dotnet-sdk-9.0.108.ebuild    | 303 +++++++++++++++++++++
 .../files/dotnet-sdk-9.0.108-libunwind.patch       |  37 +++
 3 files changed, 342 insertions(+)

diff --git a/dev-dotnet/dotnet-sdk/Manifest b/dev-dotnet/dotnet-sdk/Manifest
index 949661e60d70..9eb4b0fab745 100644
--- a/dev-dotnet/dotnet-sdk/Manifest
+++ b/dev-dotnet/dotnet-sdk/Manifest
@@ -2,3 +2,5 @@ DIST dotnet-sdk-8.0.107-prepared-gentoo-amd64.tar.xz 1792165680 
BLAKE2B 08d38009
 DIST dotnet-sdk-8.0.107-prepared-gentoo-musl-amd64.tar.xz 1785364676 BLAKE2B 
50782e24f48484e0e4bfb03f08e3a67060eb5eb15e03f09036147b041828c1ddd039cf1eae03e9c48e0197c78f68532ff4e74b7cbfbbeaf59e70262190868aa5
 SHA512 
b196c7fea4f75bd39093148cf4d5034773fd1aa03024ca0fddc6a117c009555b8b125d7452df071181947957ba042f964e63e8ec6d18cebb62a766add7de50db
 DIST dotnet-sdk-9.0.101-prepared-gentoo-glibc-amd64.tar.xz 1915948468 BLAKE2B 
c8acdbbec22b993e1f9a1081c610c9e35cc757cdc611a99bdacab6566b1fc47a50bdac76aba953b255b669fbe740eeff25f9e572a4997482d9b553e830e4f429
 SHA512 
bf3b3e624bf54b3d57b042f30be2b21a22abf8433036cf32e7acbb2df05fa4119066dff6cc5d3c85efcd9bb553e81c07d11c6b09e10bc4027ceff3f8d48b2fdd
 DIST dotnet-sdk-9.0.101-prepared-gentoo-musl-amd64.tar.xz 1914093068 BLAKE2B 
c5cb3ee695dd8e278c7688943befb98858f631f175fda9d49514a86f590594ebc9e86f0a6a6614a4c54f696da084f6bf9f96cbcad00745a14bbfa563525f71c8
 SHA512 
acbb21d34cfaa366b8ad17d4d7451828439f2798d3ceec5d6f5c4117418f1258ffafcef7f1eb4f53882126516248b8536a723db314b7f9a916e298a9eed43c59
+DIST dotnet-sdk-9.0.108-prepared-gentoo-glibc-amd64.tar.xz 1960484192 BLAKE2B 
e297716777ff32cdbc483193f562061e23ff6efba0f18bd7a66b1cc0eb381469feda9e119b35a6120f9dc5752fc9cf41bca541db947740e3562c2413fbbac330
 SHA512 
ba29e7a43c69db4eb98ec4b86a6eda7c415002f13f6d6ebdfb759c98d3d216548de1e2bb61a064c54b599e1e46916636220733a0da53c880d2d110d014efb139
+DIST dotnet-sdk-9.0.108-prepared-gentoo-musl-amd64.tar.xz 1960451884 BLAKE2B 
45f0ce63ef2679b99cde2d87ced347ddf63815b7c481090e8b36da114b6134bf2d96df729ad1a252bcb414d49ba6aea2f97496f3e3b657229875fa50f3ab26ea
 SHA512 
ff7b573c2a66be42da08a04ff26a0ba5c900a93ec16a54c7724728fc5592912ce31f59eaae9dfcab5aed358aac5252408b4c8d8a71f646d81b47e4957b1b059b

diff --git a/dev-dotnet/dotnet-sdk/dotnet-sdk-9.0.108.ebuild 
b/dev-dotnet/dotnet-sdk/dotnet-sdk-9.0.108.ebuild
new file mode 100644
index 000000000000..01b1f475d398
--- /dev/null
+++ b/dev-dotnet/dotnet-sdk/dotnet-sdk-9.0.108.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Pre-build (and distribution preparation)
+# Build the tarball:
+#  git clone --depth 1 -b v9.0.7 https://github.com/dotnet/dotnet 
./dotnet-sdk-9.0.7
+#  cd ./dotnet-sdk-9.0.7
+#  git rev-parse HEAD
+#  bash ./prep-source-build.sh
+#  rm -f -r ./.git
+#  cd ..
+#  tar -acf dotnet-sdk-9.0.108-prepared-gentoo-amd64.tar.xz dotnet-sdk-9.0.0
+# Upload "dotnet-sdk-9.0.108-prepared-gentoo-amd64.tar.xz".
+
+# Build ("src_compile")
+# To learn about arguments that are passed to the "build.sh" script see:
+# https://github.com/dotnet/source-build/discussions/4082
+# User variable: DOTNET_VERBOSITY - set other verbosity log level.
+
+EAPI=8
+
+COMMIT="2d8506e0fc69ec3d8e92eb3090e18fdb5f8636f5"
+SDK_SLOT="$(ver_cut 1-2)"
+RUNTIME_SLOT="${SDK_SLOT}.7"
+
+LLVM_COMPAT=( {19..20} )
+PYTHON_COMPAT=( python3_{12..14} )
+
+inherit check-reqs flag-o-matic llvm-r1 multiprocessing python-any-r1
+
+DESCRIPTION=".NET is a free, cross-platform, open-source developer platform"
+HOMEPAGE="https://dotnet.microsoft.com/
+       https://github.com/dotnet/dotnet/";
+SRC_URI="
+       amd64? (
+               elibc_glibc? (
+                       
https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}-prepared-gentoo-glibc-amd64.tar.xz
+               )
+               elibc_musl? (
+                       
https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}-prepared-gentoo-musl-amd64.tar.xz
+               )
+       )
+"
+S="${WORKDIR}/${PN}-${RUNTIME_SLOT}"
+
+LICENSE="MIT"
+SLOT="${SDK_SLOT}/${RUNTIME_SLOT}"
+KEYWORDS="~amd64"
+
+# STRIP="llvm-strip" corrupts some executables when using the patchelf hack.
+# Be safe and restrict it for source-built too, bug 
https://bugs.gentoo.org/923430
+RESTRICT="splitdebug strip"
+
+CURRENT_NUGETS_DEPEND="
+       ~dev-dotnet/dotnet-runtime-nugets-${RUNTIME_SLOT}
+"
+EXTRA_NUGETS_DEPEND="
+       ~dev-dotnet/dotnet-runtime-nugets-6.0.36
+       ~dev-dotnet/dotnet-runtime-nugets-7.0.20
+       ~dev-dotnet/dotnet-runtime-nugets-8.0.18
+"
+NUGETS_DEPEND="
+       ${CURRENT_NUGETS_DEPEND}
+       ${EXTRA_NUGETS_DEPEND}
+"
+PDEPEND="
+       ${NUGETS_DEPEND}
+"
+RDEPEND="
+       app-arch/brotli
+       app-crypt/mit-krb5:0/0
+       dev-libs/icu
+       dev-libs/openssl:=
+       dev-libs/rapidjson
+       dev-util/lttng-ust:=
+       sys-libs/libunwind
+       sys-libs/zlib:0/1
+"
+DEPEND="
+       ${RDEPEND}
+"
+BDEPEND="
+       ${PYTHON_DEPS}
+       dev-build/cmake
+       dev-vcs/git
+       $(llvm_gen_dep '
+               llvm-core/clang:${LLVM_SLOT}
+               llvm-core/lld:${LLVM_SLOT}
+               llvm-core/llvm:${LLVM_SLOT}
+       ')
+"
+IDEPEND="
+       app-eselect/eselect-dotnet
+"
+
+CHECKREQS_DISK_BUILD="20G"
+CHECKREQS_DISK_USR="1200M"
+
+PATCHES=(
+       "${FILESDIR}/dotnet-sdk-9.0.108-libunwind.patch"
+)
+
+# Created by dotnet itself:
+QA_PREBUILT="
+.*/dotnet
+.*/ilc
+"
+
+# .NET runtime, better to not touch it if they want some specific flags.
+QA_FLAGS_IGNORED="
+.*/apphost
+.*/createdump
+.*/dotnet
+.*/ilc
+.*/libSystem.Globalization.Native.so
+.*/libSystem.IO.Compression.Native.so
+.*/libSystem.Native.so
+.*/libSystem.Net.Security.Native.so
+.*/libSystem.Security.Cryptography.Native.OpenSsl.so
+.*/libclrgc.so
+.*/libclrgcexp.so
+.*/libclrjit.so
+.*/libclrjit_universal_arm64_x64.so
+.*/libclrjit_universal_arm_x64.so
+.*/libclrjit_unix_x64_x64.so
+.*/libclrjit_win_x64_x64.so
+.*/libclrjit_win_x86_x64.so
+.*/libcoreclr.so
+.*/libcoreclrtraceptprovider.so
+.*/libhostfxr.so
+.*/libhostpolicy.so
+.*/libjitinterface_x64.so
+.*/libmscordaccore.so
+.*/libmscordbi.so
+.*/libnethost.so
+.*/singlefilehost
+"
+
+check_requirements_locale() {
+       if [[ "${MERGE_TYPE}" != binary ]] ; then
+               if use elibc_glibc ; then
+                       local locales
+                       locales="$(locale -a)"
+
+                       if has en_US.utf8 ${locales} ; then
+                               LC_ALL="en_US.utf8"
+                       elif has en_US.UTF-8 ${locales} ; then
+                               LC_ALL="en_US.UTF-8"
+                       else
+                               eerror "The locale en_US.utf8 or en_US.UTF-8 is 
not available."
+                               eerror "Please generate en_US.UTF-8 before 
building ${CATEGORY}/${P}."
+
+                               die "Could not switch to the en_US.UTF-8 
locale."
+                       fi
+               else
+                       LC_ALL="en_US.UTF-8"
+               fi
+
+               export LC_ALL
+               einfo "Successfully switched to the ${LC_ALL} locale."
+       fi
+}
+
+pkg_pretend() {
+       check-reqs_pkg_pretend
+
+       check_requirements_locale
+}
+
+pkg_setup() {
+       check-reqs_pkg_setup
+       llvm-r1_pkg_setup
+       python-any-r1_pkg_setup
+
+       check_requirements_locale
+}
+
+src_prepare() {
+       default
+
+       filter-flags -Werror=lto-type-mismatch  # Not implemented by Clang, bug 
946334
+       filter-flags -Wlto-type-mismatch
+       filter-lto
+
+       local llvm_prefix="$(get_llvm_prefix -b)"
+       export CC="${llvm_prefix}/bin/clang-${LLVM_SLOT}"
+       export CXX="${llvm_prefix}/bin/clang++-${LLVM_SLOT}"
+       export LD="${llvm_prefix}/bin/lld"
+
+       unset DOTNET_ROOT
+       unset NUGET_PACKAGES
+       unset CLR_ICU_VERSION_OVERRIDE
+       unset USER_CLR_ICU_VERSION_OVERRIDE
+
+       export DOTNET_CLI_TELEMETRY_OPTOUT="1"
+       export DOTNET_NUGET_SIGNATURE_VERIFICATION="false"
+       export DOTNET_SKIP_FIRST_TIME_EXPERIENCE="1"
+       export MSBUILDDISABLENODEREUSE="1"
+       export MSBUILDTERMINALLOGGER="off"
+       export UseSharedCompilation="false"
+
+       local dotnet_sdk_tmp_directory="${WORKDIR}/dotnet-sdk-tmp"
+       mkdir -p "${dotnet_sdk_tmp_directory}" || die
+
+       # This should fix the "PackageVersions.props" problem,
+       # see below, in src_compile.
+       sed -e "s|/tmp|${dotnet_sdk_tmp_directory}|g" -i build.sh || die
+
+       # Some .NET SDK build scripts use "nproc" to determine
+       # a number of processors. So, we create fake "nproc" command that in 
fact
+       # reports the number of "--jobs" value.
+       local fake_bin="${T}/fake_bin"
+       mkdir -p "${fake_bin}" || die
+       export PATH="${fake_bin}:${PATH}"
+
+       cat <<-EOF > "${fake_bin}/nproc" || die
+#!/bin/sh
+echo "$(makeopts_jobs)"
+EOF
+       chmod +x "${fake_bin}/nproc" || die
+
+       # Overwrite "init-compiler" scripts.
+       # TODO: Consider - this probably overshadows CCache.
+       cat <<EOF > ./init-compiler.sh || die
+export CC="${CC}"
+export CXX="${CXX}"
+export LDFLAGS="${LDFLAGS} -fuse-ld=lld"
+export SCAN_BUILD_COMMAND="scan-build"
+EOF
+       local init_compiler=""
+       for init_compiler in diagnostics runtime ; do
+               mv 
"./src/${init_compiler}/eng/common/native/init-compiler.sh"{,.orig} || die
+               cp ./init-compiler.sh 
"./src/${init_compiler}/eng/common/native/" || die
+       done
+}
+
+src_compile() {
+       # Remove .NET leftover files that can be blocking the build.
+       # Keep this nonfatal!
+       local package_versions_path="/tmp/PackageVersions.props"
+       if [[ -f "${package_versions_path}" ]] ; then
+               rm "${package_versions_path}" ||
+                       ewarn "Failed to remove ${package_versions_path}, build 
may fail!"
+       fi
+
+       local -x EXTRA_CFLAGS="${CFLAGS}"
+       local -x EXTRA_CXXFLAGS="${CXXFLAGS}"
+       local -x EXTRA_LDFLAGS="${LDFLAGS}"
+
+       # The "source_repository" should always be the same.
+       local source_repository="https://github.com/dotnet/dotnet";
+       local verbosity="${DOTNET_VERBOSITY:-minimal}"
+
+       ebegin "Building the .NET SDK ${SDK_SLOT}"
+       local -a buildopts=(
+               # URLs, version specification, etc. ...
+               --source-repository "${source_repository}"
+               --source-version "${COMMIT}"
+
+               # How it should be built.
+               --source-build
+               --clean-while-building
+               --with-system-libs "+brotli+icu+libunwind+rapidjson+zlib+"
+               --configuration "Release"
+
+               # Auxiliary options.
+               --
+               -maxCpuCount:"$(makeopts_jobs)"
+               -p:MaxCpuCount="$(makeopts_jobs)"
+               -p:ContinueOnPrebuiltBaselineError="true"
+
+               # Verbosity settings.
+               -verbosity:"${verbosity}"
+               -p:LogVerbosity="${verbosity}"
+               -p:verbosity="${verbosity}"
+               -p:MinimalConsoleLogOutput="false"
+       )
+       bash ./build.sh "${buildopts[@]}"
+       eend ${?} || die "build failed"
+}
+
+src_install() {
+       local dest="/usr/$(get_libdir)/${PN}-${SDK_SLOT}"
+       dodir "${dest}"
+
+       ebegin "Extracting the .NET SDK archive"
+       tar xzf ./artifacts/*/Release/${PN}-${SDK_SLOT}.*.tar.gz -C 
"${ED}/${dest}"
+       eend ${?} || die "extraction failed"
+
+       fperms 0755 "${dest}"
+       dosym -r "${dest}/dotnet" "/usr/bin/dotnet-${SDK_SLOT}"
+
+       # Fix permissions again for what is already marked as executable.
+       find "${ED}" -type f -executable -exec chmod +x {} + || die
+}
+
+pkg_postinst() {
+       eselect dotnet update ifunset
+}
+
+pkg_postrm() {
+       eselect dotnet update ifunset
+}

diff --git a/dev-dotnet/dotnet-sdk/files/dotnet-sdk-9.0.108-libunwind.patch 
b/dev-dotnet/dotnet-sdk/files/dotnet-sdk-9.0.108-libunwind.patch
new file mode 100644
index 000000000000..b08d442f9e00
--- /dev/null
+++ b/dev-dotnet/dotnet-sdk/files/dotnet-sdk-9.0.108-libunwind.patch
@@ -0,0 +1,37 @@
+Comment out if-defs that cause build falure.
+
+Suggested-by: Armas Spann <[email protected]>
+
+--- a/src/runtime/src/native/external/llvm-libunwind/src/Registers.hpp
++++ b/src/runtime/src/native/external/llvm-libunwind/src/Registers.hpp
+@@ -318,11 +318,13 @@
+ class _LIBUNWIND_HIDDEN Registers_x86_64;
+ extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
+ 
++/* not applicable if libunwind is used
+ #if defined(_LIBUNWIND_USE_CET)
+ extern "C" void *__libunwind_cet_get_jump_target() {
+   return reinterpret_cast<void *>(&__libunwind_Registers_x86_64_jumpto);
+ }
+ #endif
++*/
+ 
+ class _LIBUNWIND_HIDDEN Registers_x86_64 {
+ public:
+--- a/src/runtime/src/native/external/llvm-libunwind/src/UnwindCursor.hpp
++++ b/src/runtime/src/native/external/llvm-libunwind/src/UnwindCursor.hpp
+@@ -3022,12 +3022,14 @@
+ }
+ #endif
+ 
++/* not applicable if libunwind is used
+ #if defined(_LIBUNWIND_USE_CET)
+ extern "C" void *__libunwind_cet_get_registers(unw_cursor_t *cursor) {
+   AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
+   return co->get_registers();
+ }
+ #endif
++*/
+ } // namespace libunwind
+ 
+ #endif // __UNWINDCURSOR_HPP__

Reply via email to