evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / go / gost / package.nix
blob311aa1de3bbf4168c6b4f9287f4c087b5ad7b8d9
1 { lib, fetchFromGitHub, buildGoModule, fetchpatch }:
3 buildGoModule rec {
4   pname = "gost";
5   version = "2.11.5-unstable-2024-02-02";
7   src = fetchFromGitHub {
8     owner = "ginuerzh";
9     repo = "gost";
10     rev = "fd57e80709aba9581757b1cd63b7d8f75e2385d2";
11     sha256 = "sha256-GkXsiUcH5hppgkkt4ddVMLm5riUDORVhjWBGHZXti5A=";
12   };
14   patches = [
15     # Bump quic-go to v0.41.0 for go 1.22 compatibility.
16     (fetchpatch {
17       url = "https://github.com/ginuerzh/gost/pull/1016/commits/c2e3f7e493bbb6ff1bc348f36e1a148d9d0c16ad.patch";
18       hash = "sha256-9OtuPIzzCymMAVbrDuhhPcxcac69gjAUm4ykXbH/pbo=";
19     })
20   ];
22   vendorHash = "sha256-mq95eHyW8XkqyLApSqVB3bv5VFSu6FuPap/mTQj8a9M=";
24   postPatch = ''
25     substituteInPlace http2_test.go \
26       --replace "TestH2CForwardTunnel" "SkipH2CForwardTunnel" \
27       --replace "TestH2ForwardTunnel" "SkipH2ForwardTunnel"
29     substituteInPlace resolver_test.go \
30       --replace '{NameServer{Addr: "1.1.1.1"}, "github", true},' "" \
31       --replace '{NameServer{Addr: "1.1.1.1"}, "github.com", true},' "" \
32       --replace '{NameServer{Addr: "1.1.1.1:53"}, "github.com", true},' "" \
33       --replace '{NameServer{Addr: "1.1.1.1:53", Protocol: "tcp"}, "github.com", true},' "" \
34       --replace '{NameServer{Addr: "1.1.1.1:853", Protocol: "tls"}, "github.com", true},' "" \
35       --replace '{NameServer{Addr: "1.1.1.1:853", Protocol: "tls", Hostname: "cloudflare-dns.com"}, "github.com", true},' "" \
36       --replace '{NameServer{Addr: "https://cloudflare-dns.com/dns-query", Protocol: "https"}, "github.com", true},' "" \
37       --replace '{NameServer{Addr: "https://1.0.0.1/dns-query", Protocol: "https"}, "github.com", true},' ""
39     # Skip TestShadowTCP, TestShadowUDP: #70 #71 #72 #78 #83 #85 #86 #87 #93
40     substituteInPlace ss_test.go \
41       --replace '{url.User("xchacha20"), url.UserPassword("xchacha20", "123456"), false},' "" \
42       --replace '{url.UserPassword("xchacha20", "123456"), url.User("xchacha20"), false},' "" \
43       --replace '{url.UserPassword("xchacha20", "123456"), url.UserPassword("xchacha20", "abc"), false},' "" \
44       --replace '{url.UserPassword("CHACHA20-IETF-POLY1305", "123456"), url.UserPassword("CHACHA20-IETF-POLY1305", "123456"), true},' "" \
45       --replace '{url.UserPassword("AES-128-GCM", "123456"), url.UserPassword("AES-128-GCM", "123456"), true},' "" \
46       --replace '{url.User("AES-192-GCM"), url.UserPassword("AES-192-GCM", "123456"), false},' "" \
47       --replace '{url.UserPassword("AES-192-GCM", "123456"), url.User("AES-192-GCM"), false},' "" \
48       --replace '{url.UserPassword("AES-192-GCM", "123456"), url.UserPassword("AES-192-GCM", "abc"), false},' "" \
49       --replace '{url.UserPassword("AES-256-GCM", "123456"), url.UserPassword("AES-256-GCM", "123456"), true},' ""
50   '';
52   __darwinAllowLocalNetworking = true;
54   meta = with lib; {
55     description = "Simple tunnel written in golang";
56     homepage = "https://github.com/ginuerzh/gost";
57     license = licenses.mit;
58     maintainers = with maintainers; [ pmy ];
59     mainProgram = "gost";
60   };