nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 46 lines 911 B view raw
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 testers, 6 gopatch, 7}: 8 9buildGoModule rec { 10 pname = "gopatch"; 11 version = "0.4.0"; 12 13 src = fetchFromGitHub { 14 owner = "uber-go"; 15 repo = "gopatch"; 16 rev = "v${version}"; 17 hash = "sha256-zP5zC71icrVvzKzBBlxfX9h5JlKd89cf32Q6eZatX44="; 18 }; 19 20 vendorHash = "sha256-ZHXzaR8pd6kApY3PBl9GV1iRc2jdDHMfewDn1j9npjc="; 21 22 subPackages = [ 23 "." 24 ]; 25 26 ldflags = [ 27 "-s" 28 "-w" 29 "-X=main._version=${version}" 30 ]; 31 32 passthru.tests = { 33 version = testers.testVersion { 34 package = gopatch; 35 }; 36 }; 37 38 meta = with lib; { 39 description = "Refactoring and code transformation tool for Go"; 40 mainProgram = "gopatch"; 41 homepage = "https://github.com/uber-go/gopatch"; 42 changelog = "https://github.com/uber-go/gopatch/blob/${src.rev}/CHANGELOG.md"; 43 license = licenses.mit; 44 maintainers = with maintainers; [ figsoda ]; 45 }; 46}