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