biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / regclient / default.nix
blob9016f4704bc5b19630d29064109fed357f5871b5
1 { stdenv
2 , lib
3 , buildGoModule
4 , fetchFromGitHub
5 , installShellFiles
6 , lndir
7 , testers
8 , regclient
9 }:
11 let bins = [ "regbot" "regctl" "regsync" ]; in
13 buildGoModule rec {
14   pname = "regclient";
15   version = "0.5.7";
16   tag = "v${version}";
18   src = fetchFromGitHub {
19     owner = "regclient";
20     repo = "regclient";
21     rev = tag;
22     sha256 = "sha256-GT8SJg24uneEbV8WY8Wl2w3lxqLJ7pFCa+654ksBfG4=";
23   };
24   vendorHash = "sha256-cxydurN45ovb4XngG4L/K6L+QMfsaRBZhfLYzKohFNY=";
26   outputs = [ "out" ] ++ bins;
28   ldflags = [
29     "-s"
30     "-w"
31     "-X github.com/regclient/regclient/internal/version.vcsTag=${tag}"
32   ];
34   nativeBuildInputs = [ installShellFiles lndir ];
36   postInstall = lib.concatMapStringsSep "\n"
37     (bin: ''
38       export bin=''$${bin}
39       export outputBin=bin
41       mkdir -p $bin/bin
42       mv $out/bin/${bin} $bin/bin
44       installShellCompletion --cmd ${bin} \
45         --bash <($bin/bin/${bin} completion bash) \
46         --fish <($bin/bin/${bin} completion fish) \
47         --zsh <($bin/bin/${bin} completion zsh)
49       lndir -silent $bin $out
51       unset bin outputBin
52     '')
53     bins;
55   passthru.tests = lib.mergeAttrsList (
56     map
57       (bin: {
58         "${bin}Version" = testers.testVersion {
59           package = regclient;
60           command = "${bin} version";
61           version = tag;
62         };
63       })
64       bins
65   );
67   __darwinAllowLocalNetworking = true;
69   meta = with lib; {
70     description = "Docker and OCI Registry Client in Go and tooling using those libraries";
71     homepage = "https://github.com/regclient/regclient";
72     license = licenses.asl20;
73     maintainers = with maintainers; [ maxbrunet ];
74   };