Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildGoModule
3, fetchFromGitHub
4, testers
5, gopatch
6}:
7
8buildGoModule rec {
9 pname = "gopatch";
10 version = "0.2.0";
11
12 src = fetchFromGitHub {
13 owner = "uber-go";
14 repo = "gopatch";
15 rev = "v${version}";
16 hash = "sha256-RodRDP7n1hxez+9xpRlguuArJDVaYxVTpnXKqsyqnUw=";
17 };
18
19 vendorHash = "sha256-vygEVVh/bBhV/FCrehDumrw2c1SdSZSdFjVSRoJsIig=";
20
21 subPackages = [
22 "."
23 ];
24
25 ldflags = [
26 "-s"
27 "-w"
28 "-X=main._version=${version}"
29 ];
30
31 passthru.tests = {
32 version = testers.testVersion {
33 package = gopatch;
34 };
35 };
36
37 meta = with lib; {
38 description = "Refactoring and code transformation tool for Go";
39 homepage = "https://github.com/uber-go/gopatch";
40 changelog = "https://github.com/uber-go/gopatch/blob/${src.rev}/CHANGELOG.md";
41 license = licenses.mit;
42 maintainers = with maintainers; [ figsoda ];
43 };
44}