mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ buildGoModule
|
|
, fetchFromGitHub
|
|
, lib
|
|
, testers
|
|
, mockgen
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "mockgen";
|
|
version = "0.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "uber-go";
|
|
repo = "mock";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-1UlaM3IvKlplBW1pg5l+IXwirlierjDKqKsVwFt7EAw=";
|
|
};
|
|
|
|
vendorHash = "sha256-0OnK5/e0juEYrNJuVkr+tK66btRW/oaHpJSDakB32Bc=";
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
subPackages = [ "mockgen" ];
|
|
|
|
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/uber-go/mock";
|
|
changelog = "https://github.com/uber-go/mock/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ bouk ];
|
|
mainProgram = "mockgen";
|
|
};
|
|
}
|