dotnet-jsonpointer-net-5
LOW
maintainer ChrisTX
0 votes
scanned 2026-10-31 05:57:59.662655
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
5
pkgname=dotnet-jsonpointer-net-5
6
_nugetid=JsonPointer.Net
7
pkgver=5.3.1
8
pkgrel=1
9
pkgdesc="JSON Pointer built on System.Text.Json, 5.x (NuGet package)"
10
arch=('any')
11
url='https://github.com/json-everything/json-everything'
12
license=('MIT')
13
provides=("dotnet-jsonpointer-net=$pkgver")
14
# Dependencies of the NuGet package
15
depends=(
16
dotnet-humanizer-core-2
17
dotnet-json-more-net-2
18
)
19
_dotnetsdkver="10.0"
20
makedepends=(
21
dotnet-sdk-"$_dotnetsdkver"
22
git
23
)
24
# 5.x is the last version line published under the MIT license alone, later releases on nuget.org come
25
# with the Open Source Maintenance Fee EULA (OSMFEULA.txt in the repository). It's what JsonSchema.Net 7.x
26
# (dotnet-jsonschema-net-7) needs, the version PowerShell uses. 5.3.1 wasn't tagged, this is the commit
27
# it was published from. Json.More.Net is built from this commit as well, like upstream does.
28
_commit="af4b9eaf34b783cdb51e2607ae7fddedb0664b41"
29
source=("json-everything::git+$url.git#commit=$_commit")
30
sha512sums=('2efbd8bc89545fd23c6b5710880c99ab7e46fb7e3ac348bac34ffcb6a7bcea5454c6f4fdb85bdc3ea14240e880202d843935d7712693fbc9783ed6d4c8bbef40')
31
b2sums=('3435dc951551c84ba276c65288e96618a0321beccfb5c4a42f09e28131976a6b876e535885c9817c865eb1e090d729ddef79c192e83cdd092a994320ed64dff3')
32
33
# Restores Humanizer.Core from the system feed, everything else from nuget.org
34
_nuget_config() {
35
cat >nuget.config <<EOF
36
<?xml version="1.0" encoding="utf-8"?>
37
<configuration>
38
<packageSources>
39
<clear />
40
<add key="dotnet-packages" value="/usr/share/dotnet/nuget-packages" />
41
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
42
</packageSources>
43
<packageSourceMapping>
44
<clear />
45
<packageSource key="dotnet-packages">
46
<package pattern="Humanizer.Core" />
47
</packageSource>
48
<packageSource key="nuget.org">
49
<package pattern="*" />
50
</packageSource>
51
</packageSourceMapping>
52
</configuration>
53
EOF
54
}
55
56
_dotnet_env() {
57
export NUGET_PACKAGES="$srcdir/nuget"
58
export DOTNET_CLI_HOME="$srcdir/dotnet-home"
59
export DOTNET_CLI_TELEMETRY_OPTOUT=1
60
export DOTNET_NOLOGO=1
61
}
62
63
prepare() {
64
cd json-everything || exit
65
# Source link isn't needed for this build
66
find src -name '*.csproj' -exec sed -i '/Microsoft.SourceLink.GitHub/d' {} +
67
_nuget_config
68
}
69
70
build() {
71
_dotnet_env
72
cd json-everything || exit
73
# Build first like upstream's publish workflow, the project sets GeneratePackageOnBuild, which
74
# conflicts with dotnet pack building it
75
dotnet build src/JsonPointer/JsonPointer.csproj --configuration Release -p:ContinuousIntegrationBuild=true
76
dotnet pack src/JsonPointer/JsonPointer.csproj --configuration Release --no-build -p:IncludeSymbols=false --output "$srcdir/nupkg"
77
}
78
79
check() {
80
_dotnet_env
81
cd json-everything || exit
82
# There's no test build for net10.0, run the one for net9.0 on the current runtime
83
DOTNET_ROLL_FORWARD=Major dotnet test src/JsonPointer.Tests/JsonPointer.Tests.csproj --configuration Release \
84
--framework net9.0
85
}
86
87
# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
88
# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
89
# from source
90
_check_prebuilt() {
91
local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
92
local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
93
local -A _prebuilt=()
94
while IFS= read -r -d '' _metadata; do
95
grep -qE '"source": *"https?://' "$_metadata" || continue
96
while IFS= read -r -d '' _file; do
97
_prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
98
done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
99
done < <(find "$1" -name .nupkg.metadata -print0)
100
101
rm -rf "$_extracted"
102
mkdir -p "$_extracted"
103
while IFS= read -r -d '' _file; do
104
mkdir -p "$_extracted/${_file#"$pkgdir"/}"
105
bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
106
done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
107
while IFS= read -r -d '' _file; do
108
_hash=$(sha256sum <"$_file")
109
if [[ -v "_prebuilt[$_hash]" ]]; then
110
echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
111
_found=1
112
fi
113
done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
114
rm -rf "$_extracted"
115
return "$_found"
116
}
117
118
package() {
119
install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
120
install -Dm644 json-everything/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
121
122
_check_prebuilt "$srcdir/nuget"
123
}
124
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-31 05:57:59 | Low | 1 |