From db6a3b620a2b4e9432af7824e8ee851d38423328 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Wed, 13 Apr 2022 07:13:11 -0300 Subject: [PATCH] cloudflared: 2022.4.0 -> 2022.4.1 + fix tests for linux (#167419) Co-authored-by: Sandro --- .../networking/cloudflared/default.nix | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/cloudflared/default.nix b/pkgs/applications/networking/cloudflared/default.nix index 015612983c29..566178d8305e 100644 --- a/pkgs/applications/networking/cloudflared/default.nix +++ b/pkgs/applications/networking/cloudflared/default.nix @@ -1,22 +1,33 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, stdenv }: buildGoModule rec { pname = "cloudflared"; - version = "2022.4.0"; + version = "2022.4.1"; src = fetchFromGitHub { owner = "cloudflare"; repo = "cloudflared"; rev = version; - hash = "sha256-+40OK2q4WdvlLhoPfZH6q+pghgS7ZLmaZl2VbZK4rdA="; + hash = "sha256-dgvXbWtLP6sXBlqcx/xpw9LIbcE4VlYZQO5rrS34+9I="; }; vendorSha256 = null; - doCheck = false; - ldflags = [ "-X main.Version=${version}" ]; + preCheck = '' + # Workaround for: sshgen_test.go:74: mkdir /homeless-shelter/.cloudflared: no such file or directory + export HOME="$(mktemp -d)"; + + # Workaround for: protocol_test.go:11: + # lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:51876->[::1]:53: read: connection refused + + substituteInPlace "edgediscovery/protocol_test.go" \ + --replace "TestProtocolPercentage" "SkipProtocolPercentage" + ''; + + doCheck = !stdenv.isDarwin; + meta = with lib; { description = "CloudFlare Tunnel daemon (and DNS-over-HTTPS client)"; homepage = "https://www.cloudflare.com/products/tunnel";