dotnet-system-clientmodel

LOW
maintainer ChrisTX 0 votes scanned 2026-10-31 05:57:59.662655
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2# shellcheck disable=SC2034,SC2154
3# shellcheck shell=bash
4
5pkgname=dotnet-system-clientmodel
6_nugetid=System.ClientModel
7pkgver=1.16.0
8pkgrel=1
9pkgdesc="Building blocks for .NET clients that call cloud services, System.ClientModel (NuGet package)"
10arch=('any')
11url='https://github.com/Azure/azure-sdk-for-net'
12license=('MIT')
13_dotnetsdkver="10.0"
14makedepends=(
15 dotnet-sdk-"$_dotnetsdkver"
16 jq
17)
18# The commit the package was published from (tag System.ClientModel_1.16.0), and the official build
19# of it, see the file version 1.1600.26.46705 of its assemblies (encoding the date and build number)
20_commit="dcd5b3aadd7fe3ebc73a22408cb514bd18ec3e6f"
21_officialbuildid="20260917.5"
22source=("azure-sdk-for-net-$_commit.tar.gz::$url/archive/$_commit.tar.gz")
23sha512sums=('fe251bbbd7ad8e7cf41388d0e86df322fe9bd97db021e1ee125fa53cf0a7cc062c80ab9dd91d0a376321d678d8959d76743a5d024feec178de64cb7dae51290d')
24b2sums=('3be2e64c9e9f7c110447a2eda26a2140fd24536255185fc145212897a544ddbfad83479a6c4c33205346ea3d12a1afd1d130a1f98ca5d38ca9db16cd25d7ab7c')
25
26_dotnet_env() {
27 export NUGET_PACKAGES="$srcdir/nuget"
28 export DOTNET_CLI_HOME="$srcdir/dotnet-home"
29 export DOTNET_CLI_TELEMETRY_OPTOUT=1
30 export DOTNET_NOLOGO=1
31
32 # The checks of the API listing, the analyzers and API compatibility with the previous release
33 # (from nuget.org) don't change the build. Source Link needs git, so the repository information is
34 # passed in. The runtime packages from the source-built artifacts are newer than the versions
35 # referenced (NU1603).
36 _build_arguments=(
37 --configuration Release
38 -p:GenerateAPIListing=false
39 -p:EnableClientSdkAnalyzers=false
40 -p:EnableMicrosoftCodeAnalysisNetAnalyzers=false
41 -p:EnableBannedApiAnalyzers=false
42 -p:EnableStyleCopAnalyzers=false
43 -p:RunApiCompat=false
44 -p:ValidateRunApiCompat=false
45 -p:ApiCompatVersion=
46 -p:EnableSourceLink=false
47 -p:SourceRevisionId="$_commit"
48 -p:RepositoryCommit="$_commit"
49 -p:RepositoryUrl="$url"
50 -p:SkipDevBuildNumber=true
51 -p:WarningsNotAsErrors=NU1603
52 )
53}
54
55# .NET runtime packages System.ClientModel is built against
56_runtimepackages=(
57 Microsoft.Bcl.AsyncInterfaces
58 Microsoft.Extensions.Configuration.Abstractions
59 Microsoft.Extensions.DependencyInjection.Abstractions
60 Microsoft.Extensions.Diagnostics.Abstractions
61 Microsoft.Extensions.FileProviders.Abstractions
62 Microsoft.Extensions.Hosting.Abstractions
63 Microsoft.Extensions.Logging.Abstractions
64 Microsoft.Extensions.Options
65 Microsoft.Extensions.Primitives
66 System.Diagnostics.DiagnosticSource
67 System.IO.Pipelines
68 System.Memory.Data
69 System.Net.ServerSentEvents
70 System.Text.Encodings.Web
71 System.Text.Json
72)
73
74# Writes NuGet.config with the feed $1 (as key=url) for everything but the runtime packages, which
75# are taken from the source-built artifacts if prepare() found them there
76_nuget_config() {
77 local _package
78 {
79 cat <<EOF
80<?xml version="1.0" encoding="utf-8"?>
81<configuration>
82 <packageSources>
83 <clear />
84 <add key="dotnet-source-built" value="$srcdir/nuget-local" />
85 <add key="${1%%=*}" value="${1#*=}" />
86 </packageSources>
87 <packageSourceMapping>
88 <clear />
89EOF
90 if [[ -f "$srcdir/runtime-packages" ]]; then
91 echo ' <packageSource key="dotnet-source-built">'
92 for _package in "${_runtimepackages[@]}"; do
93 echo " <package pattern=\"$_package\" />"
94 done
95 echo ' </packageSource>'
96 fi
97 cat <<EOF
98 <packageSource key="${1%%=*}">
99 <package pattern="*" />
100 </packageSource>
101 </packageSourceMapping>
102</configuration>
103EOF
104 } >NuGet.Config
105}
106
107prepare() {
108 # The runtime packages are part of the source-built .NET of Arch Linux
109 # (dotnet-source-built-artifacts), which Arch Linux ARM doesn't have. It can't be a makedepends of
110 # an arch=any package, so it's used when it's installed, and they come from nuget.org otherwise.
111 mkdir -p nuget-local
112 local _artifacts
113 for _artifacts in /usr/share/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz; do
114 [[ -f "$_artifacts" ]] || continue
115 bsdtar -xf "$_artifacts" -C nuget-local "${_runtimepackages[@]/%/.*.nupkg}"
116 touch runtime-packages
117 done
118
119 # Upstream builds with a newer feature band of the .NET SDK, which isn't needed. dotnet only works
120 # outside the repository until its global.json is updated.
121 local _sdkver
122 _sdkver=$(dotnet --version)
123
124 cd "azure-sdk-for-net-$_commit" || exit
125 # Upstream's NuGet.Config, which has the feed the tests need
126 mv NuGet.Config NuGet.Config.upstream
127 jq --arg sdk "$_sdkver" '.sdk.version = $sdk | .sdk.rollForward = "latestPatch"' global.json >global.json.new
128 mv global.json.new global.json
129 # Release builds have to check the API listing, which is turned off above
130 sed -i '/<Target Name="_CheckGenerateAPIListingValue"/,/<\/Target>/d' eng/ApiListing.targets
131}
132
133build() {
134 _dotnet_env
135 cd "azure-sdk-for-net-$_commit" || exit
136 # Version as in the official build. On Linux, it builds for all frameworks but the .NET Framework.
137 # The assemblies are public signed with Microsoft's key, giving them the same strong names as
138 # upstream's.
139 _nuget_config "nuget.org=https://api.nuget.org/v3/index.json"
140 dotnet pack "sdk/core/$_nugetid/src/$_nugetid.csproj" "${_build_arguments[@]}" \
141 -p:OfficialBuildId="$_officialbuildid" --output "$srcdir/nupkg"
142}
143
144check() {
145 _dotnet_env
146 cd "azure-sdk-for-net-$_commit" || exit
147 # The tests need packages from the feed upstream uses, which mirrors nuget.org
148 local _feed
149 _feed=$(sed -n -E 's|.*<add key="([^"]+)" value="(https[^"]+)".*|\1=\2|p' NuGet.Config.upstream)
150 _nuget_config "$_feed"
151 # Only on the .NET runtime that's installed, the tests target older ones, too
152 dotnet test "sdk/core/$_nugetid/tests/$_nugetid.Tests.csproj" "${_build_arguments[@]}" --framework net10.0
153}
154
155# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
156# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
157# from source
158_check_prebuilt() {
159 local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
160 local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
161 local -A _prebuilt=()
162 while IFS= read -r -d '' _metadata; do
163 grep -qE '"source": *"https?://' "$_metadata" || continue
164 while IFS= read -r -d '' _file; do
165 _prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
166 done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
167 done < <(find "$1" -name .nupkg.metadata -print0)
168
169 rm -rf "$_extracted"
170 mkdir -p "$_extracted"
171 while IFS= read -r -d '' _file; do
172 mkdir -p "$_extracted/${_file#"$pkgdir"/}"
173 bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
174 done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
175 while IFS= read -r -d '' _file; do
176 _hash=$(sha256sum <"$_file")
177 if [[ -v "_prebuilt[$_hash]" ]]; then
178 echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
179 _found=1
180 fi
181 done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
182 rm -rf "$_extracted"
183 return "$_found"
184}
185
186package() {
187 install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
188 install -Dm644 "azure-sdk-for-net-$_commit/LICENSE.txt" -t "$pkgdir/usr/share/licenses/$pkgname/"
189
190 _check_prebuilt "$srcdir/nuget"
191}
192

Scan history

Scanned at (UTC)SeverityRules
2026-10-31 05:57:59 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion