about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/gopatch/default.nix
blob: 162f60cb30c1e52649e6ae98fdfe65845dbaaf1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib
, buildGoModule
, fetchFromGitHub
, testers
, gopatch
}:

buildGoModule rec {
  pname = "gopatch";
  version = "0.3.0";

  src = fetchFromGitHub {
    owner = "uber-go";
    repo = "gopatch";
    rev = "v${version}";
    hash = "sha256-iiVp/Aa4usShTQD/15zYk7/WQoQL/ZxVDPWYoi3JLW4=";
  };

  vendorHash = "sha256-Pm5RNOx54IW7L9atfVTiMkvvzFt7yjqnYu99YiWFhPA=";

  subPackages = [
    "."
  ];

  ldflags = [
    "-s"
    "-w"
    "-X=main._version=${version}"
  ];

  passthru.tests = {
    version = testers.testVersion {
      package = gopatch;
    };
  };

  meta = with lib; {
    description = "Refactoring and code transformation tool for Go";
    homepage = "https://github.com/uber-go/gopatch";
    changelog = "https://github.com/uber-go/gopatch/blob/${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
  };
}