Commit 899f5444 authored by Winter's avatar Winter
Browse files

wireguard-go: 0.0.20230223 -> 0-unstable-2023-12-11; unbreak

9e2f3860220280a5630971478b53c8ad9a991ca8 [0] fixed the compilation on
Go >1.22, but there are a bunch of fixes after the latest tag that
I think make sense to pull in at this point.

[0]: https://git.zx2c4.com/wireguard-go/commit/?id=9e2f3860220280a5630971478b53c8ad9a991ca8
parent a00c210b
Loading
Loading
Loading
Loading
+52 −45
Original line number Diff line number Diff line
@@ -6,21 +6,30 @@
  wireguard-go,
}:

buildGoModule rec {
buildGoModule (
  finalAttrs:
  let
    rev = "12269c2761734b15625017d8565745096325392f";
    shortVer = "${finalAttrs.version} (${lib.substring 0 7 rev})";
  in
  {
    pname = "wireguard-go";
  version = "0.0.20230223";
    version = "0-unstable-2023-12-11";

    src = fetchzip {
    url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz";
    sha256 = "sha256-ZVWbZwSpxQvxwySS3cfzdRReFtHWk6LT2AuIe10hyz0=";
      url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${rev}.tar.xz";
      hash = "sha256-br7/dwr/e4HvBGJXh+6lWqxBUezt5iZNy9BFqEA1bLk=";
    };

    postPatch = ''
      # Skip formatting tests
      rm -f format_test.go

      # Inject version
      printf 'package main\n\nconst Version = "${shortVer}"' > version.go
    '';

  vendorHash = "sha256-i6ncA71R0hi1SzqCLphhtF3yRAHDmOdYJQ6pf3UDBg8=";
    vendorHash = "sha256-RqZ/3+Xus5N1raiUTUpiKVBs/lrJQcSwr1dJib2ytwc=";

    subPackages = [ "." ];

@@ -35,7 +44,7 @@ buildGoModule rec {

    passthru.tests.version = testers.testVersion {
      package = wireguard-go;
    version = "v${version}";
      version = "v${shortVer}";
    };

    meta = with lib; {
@@ -47,8 +56,6 @@ buildGoModule rec {
        zx2c4
      ];
      mainProgram = "wireguard-go";
    # Doesn't build with Go toolchain >1.22, build error:
    # 'link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg'.
    broken = true;
    };
  }
)