From 92c3800caf7e2ab578bd3b3bce683efa0fc72c5e Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Fri, 29 Dec 2023 14:12:02 -0800 Subject: [PATCH] mockgen: change upstream to uber-go fork --- .../manual/release-notes/rl-2405.section.md | 2 + pkgs/development/tools/mockgen/default.nix | 39 ++++++++++++++----- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index a1d26f6a12f7..0e6b7b06a3d1 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -128,6 +128,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m `globalRedirect` can now have redirect codes other than 301 through `redirectCode`. +- The source of the `mockgen` package has changed to the [go.uber.org/mock](https://github.com/uber-go/mock) fork because [the original repository is no longer maintained](https://github.com/golang/mock#gomock). + - [](#opt-boot.kernel.sysctl._net.core.wmem_max_) changed from a string to an integer because of the addition of a custom merge option (taking the highest value defined to avoid conflicts between 2 services trying to set that value), just as [](#opt-boot.kernel.sysctl._net.core.rmem_max_) since 22.11. - `services.zfs.zed.enableMail` now uses the global `sendmail` wrapper defined by an email module diff --git a/pkgs/development/tools/mockgen/default.nix b/pkgs/development/tools/mockgen/default.nix index 51cd2428c2e9..ed2aa4e50d93 100644 --- a/pkgs/development/tools/mockgen/default.nix +++ b/pkgs/development/tools/mockgen/default.nix @@ -1,28 +1,49 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ buildGoModule +, fetchFromGitHub +, lib +, testers +, mockgen +}: buildGoModule rec { pname = "mockgen"; - version = "1.6.0"; + version = "0.4.0"; src = fetchFromGitHub { - owner = "golang"; + owner = "uber-go"; repo = "mock"; rev = "v${version}"; - sha256 = "sha256-5Kp7oTmd8kqUN+rzm9cLqp9nb3jZdQyltGGQDiRSWcE="; + sha256 = "sha256-3nt70xrZisK5vgQa+STZPiY4F9ITKw8PbBWcKoBn4Vc="; }; - vendorHash = "sha256-5gkrn+OxbNN8J1lbgbxM8jACtKA7t07sbfJ7gVJWpJM="; + vendorHash = "sha256-mcNVud2jzvlPPQEaar/eYZkP71V2Civz+R5v10+tewA="; + + CGO_ENABLED = 0; subPackages = [ "mockgen" ]; - preCheck = '' - export GOROOT="$(go env GOROOT)" - ''; + ldflags = [ + "-X=main.version=${version}" + "-X=main.date=1970-01-01T00:00:00Z" + "-X=main.commit=unknown" + ]; + + passthru.tests.version = testers.testVersion { + package = mockgen; + command = "mockgen -version"; + version = '' + v${version} + Commit: unknown + Date: 1970-01-01T00:00:00Z + ''; + }; meta = with lib; { description = "GoMock is a mocking framework for the Go programming language"; - homepage = "https://github.com/golang/mock"; + homepage = "https://github.com/uber-go/mock"; + changelog = "https://github.com/uber-go/mock/blob/v${version}/CHANGELOG.md"; license = licenses.asl20; maintainers = with maintainers; [ bouk ]; + mainProgram = "mockgen"; }; }