From 57f6447df5841b2e3dd9e541826ad8b6a3a273fd Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Sun, 6 Aug 2023 02:54:12 -0700 Subject: [PATCH] dcrd: fix tests when run on darwin --- pkgs/applications/blockchains/dcrd/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/blockchains/dcrd/default.nix b/pkgs/applications/blockchains/dcrd/default.nix index 75c00719215d..8a4369482fe6 100644 --- a/pkgs/applications/blockchains/dcrd/default.nix +++ b/pkgs/applications/blockchains/dcrd/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, fetchpatch }: buildGoModule rec { pname = "dcrd"; @@ -11,10 +11,24 @@ buildGoModule rec { hash = "sha256-ZNBSIzx07zJrBxas7bHpZ8ZPDWJ4d7jumpKYj5Qmzlo="; }; + patches = [ + (fetchpatch { + name = "dcrd-appdata-env-variable.patch"; + url = "https://github.com/decred/dcrd/pull/3152/commits/216132d7d852f3f2e2a6bf7f739f47ed62ac9387.patch"; + hash = "sha256-R1GzP0qVP5XW1GnSJqFOpJVnwrVi/62tL1L2mc33+Dw="; + }) + ]; + vendorHash = "sha256-++IPB2IadXd1LC5r6f1a0UqsTG/McAf7KQAw8WKKoaE="; subPackages = [ "." "cmd/promptsecret" ]; + __darwinAllowLocalNetworking = true; + + preCheck = '' + export DCRD_APPDATA="$TMPDIR" + ''; + meta = { homepage = "https://decred.org"; description = "Decred daemon in Go (golang)";