dotnet-wcf

LOW
maintainer ChrisTX 0 votes scanned 2026-10-31 07:58:04.077835
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-wcf
6pkgver=10.1.0
7pkgrel=2
8pkgdesc="WCF client libraries for .NET, System.ServiceModel.* and System.Web.Services.Description (NuGet packages)"
9arch=('any')
10url='https://github.com/dotnet/wcf'
11license=('MIT')
12_dotnetsdkver="10.0"
13makedepends=(
14 dotnet-sdk-"$_dotnetsdkver"
15 jq
16)
17# The commit the packages were published from, and the official build of them, see the file version
18# 10.100.26.51601 of their assemblies (Arcade encodes the date and build number in it)
19_commit="12702d51d9758687726bc4056729aeb58fbbf717"
20_officialbuildid="20261016.1"
21_packages=(
22 System.ServiceModel.Primitives
23 System.ServiceModel.NetFramingBase
24 System.ServiceModel.Http
25 System.ServiceModel.NetTcp
26 System.Web.Services.Description
27)
28source=("wcf-$_commit.tar.gz::$url/archive/$_commit.tar.gz")
29sha512sums=('6d9f45dc7ae2495c34256ca91528761e55ae30a671c801608041ce007365a4772b71002739929c7f181a8ed7209a2fab16ac4d8bf35f8f8d7212697434f5aaec')
30b2sums=('d9f8df046cdc539b77b82ef8c16293ca4eaa50fcc949411c38895eed8e909e7bf525bd0e69eb2bd6150b6c8d4317528414a1d49e645666049d58f26356146385')
31
32_dotnet_env() {
33 export NUGET_PACKAGES="$srcdir/nuget"
34 export DOTNET_CLI_HOME="$srcdir/dotnet-home"
35 export DOTNET_CLI_TELEMETRY_OPTOUT=1
36 export DOTNET_NOLOGO=1
37 # Arcade looks for a .NET installed into the repository otherwise, e.g. for the test host
38 DOTNET_INSTALL_DIR="$(dirname "$(readlink -f /usr/bin/dotnet)")"
39 export DOTNET_INSTALL_DIR
40
41 # The .NET Framework builds would need prebuilt reference assemblies, and package validation the
42 # previous release from nuget.org. The repository information usually comes from
43 # git, which would find the repository this PKGBUILD is in instead.
44 _build_arguments=(
45 --configuration Release
46 -p:NetFrameworkVersion=
47 -p:EnablePackageValidation=false
48 -p:RepositoryCommit="$_commit"
49 -p:RepositoryUrl="$url"
50 -p:SourceRevisionId="$_commit"
51 -p:EnableSourceControlManagerQueries=false
52 )
53 if [[ -f "$srcdir/syndication-version" ]]; then
54 _build_arguments+=(-p:SystemServiceModelSyndicationPackageVersion="$(<"$srcdir/syndication-version")")
55 fi
56}
57
58# Writes NuGet.config with the given feeds ($@, as key=url) for everything but Arcade, the build SDK
59# of the repository, and the .NET runtime packages. They're taken from the source-built artifacts if
60# prepare() found them there, otherwise from Microsoft's dotnet-eng feed and nuget.org like upstream.
61_nuget_config() {
62 local _arcade=(Microsoft.DotNet.Arcade.Sdk Microsoft.DotNet.XliffTasks) _local=() _feed
63 local _dotneteng=("dotnet-eng=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json")
64 # dotnet-eng is among the given feeds for everything, or only used for Arcade
65 if [[ " $* " == *" dotnet-eng="* ]]; then
66 _dotneteng=()
67 _arcade=()
68 fi
69 if [[ -f "$srcdir/arcade-version" ]]; then
70 _local+=("${_arcade[@]}")
71 _arcade=()
72 fi
73 [[ -f "$srcdir/syndication-version" ]] && _local+=("${_runtimepackages[@]}")
74 {
75 cat <<EOF
76<?xml version="1.0" encoding="utf-8"?>
77<configuration>
78 <packageSources>
79 <clear />
80 <add key="dotnet-source-built" value="$srcdir/nuget-local" />
81EOF
82 for _feed in "${_dotneteng[@]}" "$@"; do
83 echo " <add key=\"${_feed%%=*}\" value=\"${_feed#*=}\" />"
84 done
85 echo ' </packageSources>'
86 echo ' <packageSourceMapping>'
87 echo ' <clear />'
88 _nuget_mapping dotnet-source-built "${_local[@]}"
89 _nuget_mapping dotnet-eng "${_arcade[@]}"
90 for _feed in "$@"; do
91 _nuget_mapping "${_feed%%=*}" '*'
92 done
93 echo ' </packageSourceMapping>'
94 echo '</configuration>'
95 } >NuGet.config
96}
97
98# Prints the package source mapping of the feed $1 for the package patterns $2..., if there are any
99_nuget_mapping() {
100 (($# > 1)) || return 0
101 echo " <packageSource key=\"$1\">"
102 shift
103 printf ' <package pattern="%s" />\n' "$@"
104 echo ' </packageSource>'
105}
106
107# .NET runtime packages the WCF packages are built against
108_runtimepackages=(
109 Microsoft.Extensions.ObjectPool
110 System.Security.Cryptography.Pkcs
111 System.Security.Cryptography.Xml
112 System.ServiceModel.Syndication
113)
114
115prepare() {
116 # Arcade and the runtime packages are part of the source-built .NET of Arch Linux
117 # (dotnet-source-built-artifacts), which Arch Linux ARM doesn't have. It can't be a makedepends of an
118 # arch=any package, so it's used when it's installed, and they come from upstream's feeds otherwise.
119 mkdir -p nuget-local
120 local _artifacts _nupkg _package
121 for _artifacts in /usr/share/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz; do
122 [[ -f "$_artifacts" ]] || continue
123 bsdtar -xf "$_artifacts" -C nuget-local 'Microsoft.DotNet.Arcade.Sdk.*.nupkg' 'Microsoft.DotNet.XliffTasks.*.nupkg' \
124 "${_runtimepackages[@]/%/.*.nupkg}"
125 done
126 for _nupkg in nuget-local/Microsoft.DotNet.Arcade.Sdk.*.nupkg; do
127 [[ -f "$_nupkg" ]] || continue
128 _package="${_nupkg##*/Microsoft.DotNet.Arcade.Sdk.}"
129 echo "${_package%.nupkg}" >arcade-version
130 done
131 for _nupkg in nuget-local/System.ServiceModel.Syndication.*.nupkg; do
132 [[ -f "$_nupkg" ]] || continue
133 _package="${_nupkg##*/System.ServiceModel.Syndication.}"
134 echo "${_package%.nupkg}" >syndication-version
135 done
136
137 # Upstream builds with a preview of the next .NET SDK, the libraries target .NET 10 though.
138 # dotnet only works outside the repository until its global.json is updated.
139 local _sdkver _arcadever
140 _sdkver=$(dotnet --version)
141
142 cd "wcf-$_commit" || exit
143 # Upstream's NuGet.config, which has the feeds the tests need
144 mv NuGet.config NuGet.config.upstream
145 _arcadever=$(jq -r '."msbuild-sdks"."Microsoft.DotNet.Arcade.Sdk"' global.json)
146 [[ -f "$srcdir/arcade-version" ]] && _arcadever=$(<"$srcdir/arcade-version")
147 jq --arg sdk "$_sdkver" --arg arcade "$_arcadever" \
148 '.sdk.version = $sdk | .tools.dotnet = $sdk | ."msbuild-sdks"."Microsoft.DotNet.Arcade.Sdk" = $arcade' \
149 global.json >global.json.new
150 mv global.json.new global.json
151 # GenAPI regenerates the reference sources (ref/*.cs), which are part of the repository already
152 sed -i '/<PackageReference Include="Microsoft.DotNet.GenAPI"/,/\/>/d' eng/GenRefAssembly.targets
153}
154
155build() {
156 _dotnet_env
157 cd "wcf-$_commit" || exit
158 # Versions as in the official build, see eng/Versions.props. The assemblies are public signed with
159 # Microsoft's keys, giving them the same strong names as upstream's.
160 _nuget_config "nuget.org=https://api.nuget.org/v3/index.json"
161 local _package
162 for _package in "${_packages[@]}"; do
163 dotnet pack "src/$_package/src/$_package.csproj" "${_build_arguments[@]}" \
164 -p:OfficialBuildId="$_officialbuildid" -p:DotNetFinalVersionKind=release --output "$srcdir/nupkg"
165 done
166}
167
168check() {
169 _dotnet_env
170 cd "wcf-$_commit" || exit
171 # The tests need packages from the feeds upstream uses
172 local _feeds=()
173 mapfile -t _feeds < <(sed -n -E 's|.*<add key="([^"]+)" value="(https[^"]+)".*|\1=\2|p' NuGet.config.upstream)
174 _nuget_config "${_feeds[@]}" "nuget.org=https://api.nuget.org/v3/index.json"
175 # The unit tests. The scenario tests need WCF's test service running, which upstream starts with
176 # Windows scripts.
177 local _package
178 for _package in System.ServiceModel.Primitives System.ServiceModel.Http System.ServiceModel.NetTcp; do
179 dotnet test "src/$_package/tests/$_package.Tests.csproj" "${_build_arguments[@]}"
180 done
181}
182
183# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
184# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
185# from source
186_check_prebuilt() {
187 local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
188 local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
189 local -A _prebuilt=()
190 while IFS= read -r -d '' _metadata; do
191 grep -qE '"source": *"https?://' "$_metadata" || continue
192 while IFS= read -r -d '' _file; do
193 _prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
194 done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
195 done < <(find "$1" -name .nupkg.metadata -print0)
196
197 rm -rf "$_extracted"
198 mkdir -p "$_extracted"
199 while IFS= read -r -d '' _file; do
200 mkdir -p "$_extracted/${_file#"$pkgdir"/}"
201 bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
202 done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
203 while IFS= read -r -d '' _file; do
204 _hash=$(sha256sum <"$_file")
205 if [[ -v "_prebuilt[$_hash]" ]]; then
206 echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
207 _found=1
208 fi
209 done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
210 rm -rf "$_extracted"
211 return "$_found"
212}
213
214package() {
215 local _package
216 for _package in "${_packages[@]}"; do
217 install -Dm644 "$srcdir/nupkg/$_package.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
218 done
219 install -Dm644 "wcf-$_commit/LICENSE.TXT" -t "$pkgdir/usr/share/licenses/$pkgname/"
220
221 _check_prebuilt "$srcdir/nuget"
222}
223

Scan history

Scanned at (UTC)SeverityRules
2026-10-31 07:58:04 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