wasabibackend: 1.1.12 -> 1.1.13.0, use buildDotnetModule
This commit is contained in:
parent
0e57783d3a
commit
59da9130e8
@ -1,98 +0,0 @@
|
|||||||
#! /usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p dotnet-sdk_3 jq xmlstarlet curl nixpkgs-fmt
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Run this script to generate deps.nix
|
|
||||||
|
|
||||||
# TODO: consolidate with other dotnet deps generation scripts by which
|
|
||||||
# this script is inspired:
|
|
||||||
# - pkgs/servers/nosql/eventstore/create-deps.sh
|
|
||||||
# - pkgs/development/dotnet-modules/python-language-server/create_deps.sh
|
|
||||||
# - pkgs/misc/emulators/ryujinx/updater.sh
|
|
||||||
|
|
||||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
||||||
|
|
||||||
deps_file="$(realpath "./deps.nix")"
|
|
||||||
|
|
||||||
exec 2>&1 6> "$deps_file"
|
|
||||||
|
|
||||||
store_src="$( nix-build ../../../.. -A wasabibackend.src --no-out-link )"
|
|
||||||
src="$(mktemp -d)"
|
|
||||||
cp -rT "$store_src" "$src"
|
|
||||||
chmod -R +w "$src"
|
|
||||||
pushd "$src"
|
|
||||||
|
|
||||||
URLBASE="https://www.nuget.org/api/v2/package"
|
|
||||||
|
|
||||||
DEPS_HEADER="
|
|
||||||
{ fetchurl }:
|
|
||||||
let
|
|
||||||
nugetUrlBase = \"$URLBASE\";
|
|
||||||
fetchNuGet = { name, version, sha256 }: fetchurl {
|
|
||||||
inherit sha256;
|
|
||||||
url = \"\${nugetUrlBase}/\${name}/\${version}\";
|
|
||||||
};
|
|
||||||
in ["
|
|
||||||
|
|
||||||
DEPS_FOOTER="]"
|
|
||||||
|
|
||||||
DEPS_TEMPLATE="
|
|
||||||
(fetchNuGet {
|
|
||||||
name = \"%s\";
|
|
||||||
version = \"%s\";
|
|
||||||
sha256 = \"%s\";
|
|
||||||
})"
|
|
||||||
|
|
||||||
tmpdir="$(mktemp -d -p "$(pwd)")" # must be under source root
|
|
||||||
trap 'rm -rf "$tmpdir"' EXIT
|
|
||||||
|
|
||||||
HOME="$tmpdir" dotnet restore --packages "$tmpdir"/.nuget/packages \
|
|
||||||
--no-cache --force --runtime linux-x64 \
|
|
||||||
WalletWasabi.Backend/WalletWasabi.Backend.csproj >&2
|
|
||||||
|
|
||||||
mapfile -t repos < <(
|
|
||||||
xmlstarlet sel -t -v 'configuration/packageSources/add/@value' -n NuGet.config "$tmpdir"/.nuget/NuGet/NuGet.Config |
|
|
||||||
while IFS= read index
|
|
||||||
do
|
|
||||||
curl --compressed -fsL "$index" | \
|
|
||||||
jq -r '.resources[] | select(."@type" == "PackageBaseAddress/3.0.0")."@id"'
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
echo $DEPS_HEADER >&6
|
|
||||||
|
|
||||||
cd "$tmpdir/.nuget/packages"
|
|
||||||
for package in *
|
|
||||||
do
|
|
||||||
cd "$package"
|
|
||||||
for version in *
|
|
||||||
do
|
|
||||||
found=false
|
|
||||||
for repo in "${repos[@]}"
|
|
||||||
do
|
|
||||||
url="$repo$package/$version/$package.$version.nupkg"
|
|
||||||
if curl -fsL "$url" -o /dev/null
|
|
||||||
then
|
|
||||||
found=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if ! $found
|
|
||||||
then
|
|
||||||
echo "couldn't find $package $version" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
sha256=$(nix-prefetch-url "$url" 2>/dev/null)
|
|
||||||
|
|
||||||
printf "$DEPS_TEMPLATE" $package $version $sha256 >&6
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
done
|
|
||||||
|
|
||||||
echo $DEPS_FOOTER >&6
|
|
||||||
|
|
||||||
exec 6>&-
|
|
||||||
|
|
||||||
nixpkgs-fmt "$deps_file"
|
|
@ -1,95 +1,45 @@
|
|||||||
{ lib, stdenv
|
{ lib
|
||||||
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchurl
|
, buildDotnetModule
|
||||||
, makeWrapper
|
|
||||||
, Nuget
|
|
||||||
, dotnetCorePackages
|
, dotnetCorePackages
|
||||||
, openssl
|
, autoPatchelfHook
|
||||||
, zlib
|
, zlib
|
||||||
|
, openssl
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
buildDotnetModule rec {
|
||||||
deps = import ./deps.nix { inherit fetchurl; };
|
pname = "wasabibackend";
|
||||||
|
version = "1.1.13.0";
|
||||||
dotnet-sdk = dotnetCorePackages.sdk_3_1;
|
|
||||||
dotnet-aspnetcore = dotnetCorePackages.aspnetcore_3_1;
|
|
||||||
|
|
||||||
nugetSource = stdenv.mkDerivation {
|
|
||||||
pname = "${pname}-nuget-deps";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
dontInstall = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ Nuget ];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
export HOME=$(mktemp -d)
|
|
||||||
mkdir -p $out/lib
|
|
||||||
|
|
||||||
nuget sources Disable -Name "nuget.org"
|
|
||||||
for package in ${toString deps}; do
|
|
||||||
nuget add $package -Source $out/lib
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
pname = "WasabiBackend";
|
|
||||||
version = "1.1.12";
|
|
||||||
|
|
||||||
projectName = "WalletWasabi.Backend";
|
|
||||||
projectConfiguration = "Release";
|
|
||||||
projectRuntime = "linux-x64";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
inherit pname version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "zkSNACKs";
|
owner = "zkSNACKs";
|
||||||
repo = "WalletWasabi";
|
repo = "WalletWasabi";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "001k43z2jxvs03csyzndlzlk034aclzc4n8ddrqxykgrq508xk1d";
|
sha256 = "sha256-zDOk8MurT5NXOr4kvm5mnsphY+eDFWuVBcpeTZpcHOo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
projectFile = "WalletWasabi.Backend/WalletWasabi.Backend.csproj";
|
||||||
Nuget
|
nugetDeps = ./deps.nix;
|
||||||
dotnet-sdk
|
|
||||||
makeWrapper
|
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase = ''
|
dotnet-sdk = dotnetCorePackages.sdk_3_1;
|
||||||
export HOME=$(mktemp -d)
|
dotnet-runtime = dotnetCorePackages.aspnetcore_3_1;
|
||||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
||||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
|
||||||
export DOTNET_ROOT="${dotnet-sdk}/bin"
|
|
||||||
|
|
||||||
nuget sources Disable -Name "nuget.org"
|
nativeBuildInputs = [ autoPatchelfHook ];
|
||||||
|
buildInputs = [ stdenv.cc.cc.lib zlib ];
|
||||||
|
|
||||||
dotnet restore \
|
runtimeDeps = [ openssl zlib ];
|
||||||
--source ${nugetSource}/lib \
|
|
||||||
--runtime ${projectRuntime} \
|
|
||||||
${projectName}
|
|
||||||
|
|
||||||
dotnet publish \
|
preConfigure = ''
|
||||||
--no-restore \
|
makeWrapperArgs+=(
|
||||||
--runtime ${projectRuntime} \
|
--run "cd $out/lib/${pname}"
|
||||||
--configuration ${projectConfiguration} \
|
)
|
||||||
${projectName}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
postInstall = ''
|
||||||
mkdir -p $out
|
mv $out/bin/WalletWasabi.Backend $out/bin/WasabiBackend
|
||||||
cp -r ${projectName}/bin/${projectConfiguration}/netcoreapp3.1/${projectRuntime}/publish $out/lib
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper $out/lib/WalletWasabi.Backend $out/bin/${pname} \
|
|
||||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl zlib ]} \
|
|
||||||
--run "cd $out/lib"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# If we don't disable stripping the executable fails to start with segfault
|
|
||||||
dontStrip = true;
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Backend for the Wasabi Wallet";
|
description = "Backend for the Wasabi Wallet";
|
||||||
homepage = "https://wasabiwallet.io/";
|
homepage = "https://wasabiwallet.io/";
|
||||||
|
1154
pkgs/applications/blockchains/wasabibackend/deps.nix
generated
1154
pkgs/applications/blockchains/wasabibackend/deps.nix
generated
File diff suppressed because it is too large
Load Diff
@ -30145,7 +30145,7 @@ with pkgs;
|
|||||||
|
|
||||||
wasabiwallet = callPackage ../applications/blockchains/wasabiwallet { };
|
wasabiwallet = callPackage ../applications/blockchains/wasabiwallet { };
|
||||||
|
|
||||||
wasabibackend = callPackage ../applications/blockchains/wasabibackend { Nuget = dotnetPackages.Nuget; };
|
wasabibackend = callPackage ../applications/blockchains/wasabibackend { };
|
||||||
|
|
||||||
wownero = callPackage ../applications/blockchains/wownero {
|
wownero = callPackage ../applications/blockchains/wownero {
|
||||||
boost = boost175;
|
boost = boost175;
|
||||||
|
Loading…
Reference in New Issue
Block a user