1{ stdenv, lib, fetchFromGitHub, buildGoModule, python3 }:
2
3buildGoModule rec {
4 pname = "cod";
5 version = "0.1.0";
6
7 src = fetchFromGitHub {
8 owner = "dim-an";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "0wi680sxpv0kp1ggy21qp4c4ms79hw4z9w9kvp278p8z3y8wwglr";
12 };
13
14 vendorSha256 = "0ann1fbh8rqys3rwbz5h9mfnvkpqiw5rgkd4c30y99706h2dzv4i";
15
16 ldflags = [ "-s" "-w" "-X main.GitSha=${src.rev}" ];
17
18 checkInputs = [ python3 ];
19
20 preCheck = ''
21 pushd test/binaries/
22 for f in *.py; do
23 patchShebangs ''$f
24 done
25 popd
26 export COD_TEST_BINARY="''${NIX_BUILD_TOP}/go/bin/cod"
27
28 substituteInPlace test/learn_test.go --replace TestLearnArgparseSubCommand SkipLearnArgparseSubCommand
29 '';
30
31 meta = with lib; {
32 description = "Tool for generating Bash/Fish/Zsh autocompletions based on `--help` output";
33 homepage = "https://github.com/dim-an/cod/";
34 license = licenses.asl20;
35 maintainers = with maintainers; [ SuperSandro2000 ];
36 broken = true;
37 };
38}