btcpayserver: init at 1.0.5.4

This commit is contained in:
Calvin Kim 2020-08-11 03:52:53 +09:00 committed by Erik Arvstedt
parent 2724f7be54
commit 2f55d6f697
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
4 changed files with 2011 additions and 0 deletions

View File

@ -0,0 +1,66 @@
{ lib, stdenv, fetchFromGitHub, fetchurl, linkFarmFromDrvs, makeWrapper,
dotnetPackages, dotnetCorePackages, writeScript, bash
}:
let
deps = import ./deps.nix {
fetchNuGet = { name, version, sha256 }: fetchurl {
name = "nuget-${name}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${name}/${version}";
inherit sha256;
};
};
dotnetSdk = dotnetCorePackages.sdk_3_1;
in
stdenv.mkDerivation rec {
pname = "btcpayserver";
version = "1.0.5.5";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "11h1nrmb7f44msbhhiz9ddqh5ss2kz6d8ysnvd070x3xj5krgnxz";
};
nativeBuildInputs = [ dotnetSdk dotnetPackages.Nuget ];
# Due to a bug in btcpayserver, we can't just `dotnet publish` to create a binary.
# Build with `dotnet build` instead and add a custom `dotnet run` script.
buildPhase = ''
export HOME=$TMP/home
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
nuget sources Add -Name tmpsrc -Source $TMP/nuget
nuget init ${linkFarmFromDrvs "deps" deps} $TMP/nuget
dotnet restore --source $TMP/nuget BTCPayServer/BTCPayServer.csproj
dotnet build -c Release BTCPayServer/BTCPayServer.csproj
'';
runScript = ''
#!${bash}/bin/bash
DOTNET_CLI_TELEMETRY_OPTOUT=1 exec ${dotnetSdk}/bin/dotnet run --no-launch-profile --no-build \
-c Release -p @@SHARE@@/BTCPayServer/BTCPayServer.csproj -- "$@"
'';
installPhase = ''
cd ..
share=$out/share/$pname
mkdir -p $share
mv -T source $share
install -D -m500 <(echo "$runScript" | sed "s|@@SHARE@@|$share|") $out/bin/$pname
'';
dontStrip = true;
meta = with lib; {
description = "Self-hosted, open-source cryptocurrency payment processor";
homepage = "https://btcpayserver.org";
maintainers = with maintainers; [ kcalvinalvin earvstedt ];
license = lib.licenses.mit;
platforms = lib.platforms.linux;
};
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
"$scriptDir"/../nbxplorer/util/update-common.sh btcpayserver "$scriptDir"/deps.nix

View File

@ -24377,6 +24377,8 @@ in
};
btc1d = btc1.override { withGui = false; };
btcpayserver = callPackage ../applications/blockchains/btcpayserver { };
cryptop = python3.pkgs.callPackage ../applications/blockchains/cryptop { };
dashpay = callPackage ../applications/blockchains/dashpay.nix { };