mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 14:19:58 +03:00
nbxplorer: use fetch-deps instead of custom create-deps.sh
This commit is contained in:
parent
4a816921a6
commit
5c924eeb21
@ -8,5 +8,4 @@ echo "Updating nbxplorer"
|
||||
../nbxplorer/update.sh
|
||||
echo
|
||||
echo "Updating btcpayserver"
|
||||
# Include Razor SDK packages in deps.nix
|
||||
../nbxplorer/util/update-common.sh btcpayserver deps.nix '"/p:Configuration="Altcoins-Release" /p:RazorCompileOnBuild=false'
|
||||
../nbxplorer/util/update-common.sh btcpayserver deps.nix
|
||||
|
@ -3,4 +3,4 @@ set -euo pipefail
|
||||
|
||||
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
||||
|
||||
getVersionFromTags=1 "$scriptDir"/util/update-common.sh nbxplorer "$scriptDir"/deps.nix ''
|
||||
getVersionFromTags=1 "$scriptDir"/util/update-common.sh nbxplorer "$scriptDir"/deps.nix
|
||||
|
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p dotnet-sdk_6
|
||||
set -euo pipefail
|
||||
|
||||
# Writes deps for dotnet package in $pkgSrc to $depsFile.
|
||||
# Expects $pkgSrc to contain a single .sln file.
|
||||
|
||||
pkgSrc=$1
|
||||
depsFile=$(realpath "$2")
|
||||
customFlags=$3
|
||||
|
||||
sln=$(cd "$pkgSrc"; find * -maxdepth 0 -name '*.sln' | head -1)
|
||||
[[ $sln ]] || { echo "No .sln file in $pkgSrc" ; exit 1; }
|
||||
|
||||
tmpdir=$(mktemp -d /tmp/$pkgName-src.XXX)
|
||||
echo "Using tmp dir: $tmpdir"
|
||||
cp -rT "$pkgSrc" "$tmpdir"
|
||||
chmod -R +w "$tmpdir"
|
||||
|
||||
pushd "$tmpdir" > /dev/null
|
||||
mkdir home
|
||||
echo "Running dotnet restore for $sln"
|
||||
HOME=home DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
||||
dotnet restore $customFlags -v normal --no-cache "$sln" > restore_log
|
||||
|
||||
echo "{ fetchNuGet }: [" > "$depsFile"
|
||||
while read pkgSpec; do
|
||||
{ read pname; read version; } < <(
|
||||
# Ignore build version part: 1.0.0-beta2+77df2220 -> 1.0.0-beta2
|
||||
sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkgSpec"
|
||||
)
|
||||
sha256=$(nix-hash --type sha256 --flat --base32 "$(dirname "$pkgSpec")"/*.nupkg)
|
||||
cat >> "$depsFile" <<EOF
|
||||
(fetchNuGet {
|
||||
pname = "$pname";
|
||||
version = "$version";
|
||||
sha256 = "$sha256";
|
||||
})
|
||||
EOF
|
||||
done < <(find home/.nuget/packages -name '*.nuspec' | LC_ALL=C sort)
|
||||
echo "]" >> "$depsFile"
|
||||
|
||||
echo "Created $depsFile"
|
||||
|
||||
popd > /dev/null
|
||||
rm -r $tmpdir
|
@ -10,7 +10,6 @@ trap 'echo "Error at ${BASH_SOURCE[0]}:$LINENO"' ERR
|
||||
|
||||
pkgName=$1
|
||||
depsFile=$2
|
||||
customFlags=$3
|
||||
|
||||
: ${getVersionFromTags:=}
|
||||
: ${refetch:=}
|
||||
@ -75,5 +74,4 @@ fi
|
||||
echo
|
||||
|
||||
# Create deps file
|
||||
storeSrc="$(nix-build "$nixpkgs" -A $pkgName.src --no-out-link)"
|
||||
. "$scriptDir"/create-deps.sh "$storeSrc" "$depsFile" "$customFlags"
|
||||
$(nix-build "$nixpkgs" -A $pkgName.fetch-deps --no-out-link) "$depsFile"
|
||||
|
Loading…
Reference in New Issue
Block a user