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 hash = "sha256-mT7OkR8fXXTE3TPx9AmH6ehKGLk4CP9euBPs2zVAJnI=";
12 };
13
14 vendorHash = "sha256-kezfBDTgpOTBYKTNlwuP+M5tXU2w/MXz0B5nBJcL1io=";
15
16 ldflags = [ "-s" "-w" "-X main.GitSha=${src.rev}" ];
17
18 nativeCheckInputs = [ 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 = stdenv.isDarwin;
37 };
38}