2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-06-18 12:17:16 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, Nuget
|
|
|
|
, dotnetCorePackages
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
deps = import ./deps.nix { inherit fetchurl; };
|
|
|
|
|
|
|
|
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";
|
2020-09-04 08:22:28 +00:00
|
|
|
version = "1.1.12";
|
2020-06-18 12:17:16 +00:00
|
|
|
|
|
|
|
projectName = "WalletWasabi.Backend";
|
|
|
|
projectConfiguration = "Release";
|
|
|
|
projectRuntime = "linux-x64";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zkSNACKs";
|
|
|
|
repo = "WalletWasabi";
|
|
|
|
rev = "v${version}";
|
2020-09-04 08:22:28 +00:00
|
|
|
sha256 = "001k43z2jxvs03csyzndlzlk034aclzc4n8ddrqxykgrq508xk1d";
|
2020-06-18 12:17:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
Nuget
|
|
|
|
dotnet-sdk
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
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"
|
|
|
|
|
|
|
|
dotnet restore \
|
|
|
|
--source ${nugetSource}/lib \
|
|
|
|
--runtime ${projectRuntime} \
|
|
|
|
${projectName}
|
|
|
|
|
|
|
|
dotnet publish \
|
|
|
|
--no-restore \
|
|
|
|
--runtime ${projectRuntime} \
|
|
|
|
--configuration ${projectConfiguration} \
|
|
|
|
${projectName}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r ${projectName}/bin/${projectConfiguration}/netcoreapp3.1/${projectRuntime}/publish $out/lib
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper $out/lib/WalletWasabi.Backend $out/bin/${pname} \
|
2021-01-15 13:21:58 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl zlib ]} \
|
2020-06-18 12:17:16 +00:00
|
|
|
--run "cd $out/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# If we don't disable stripping the executable fails to start with segfault
|
|
|
|
dontStrip = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 12:17:16 +00:00
|
|
|
description = "Backend for the Wasabi Wallet";
|
|
|
|
homepage = "https://wasabiwallet.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mmahut ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|