Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / tools / sq / default.nix
blob75e18ba664b39978c42cadf2b6d062afac031f11
1 { lib, buildGo121Module, fetchFromGitHub, installShellFiles, testers, sq }:
3 buildGo121Module rec {
4   pname = "sq";
5   version = "0.42.1";
7   src = fetchFromGitHub {
8     owner = "neilotoole";
9     repo = pname;
10     rev = "v${version}";
11     hash = "sha256-3Hu0vMulGWyNWgNlekYuTRxxxBbRkWj2RE0MWZzNXFk=";
12   };
14   vendorHash = "sha256-qEwK40BcUetsQOIefdjM/dgjTNuHO1EZgVk53/dfOlc=";
16   proxyVendor = true;
18   nativeBuildInputs = [ installShellFiles ];
20   # Some tests violates sandbox constraints.
21   doCheck = false;
23   ldflags = [
24     "-s"
25     "-w"
26     "-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
27   ];
29   postInstall = ''
30     installShellCompletion --cmd sq \
31       --bash <($out/bin/sq completion bash) \
32       --fish <($out/bin/sq completion fish) \
33       --zsh <($out/bin/sq completion zsh)
34   '';
36   passthru.tests = {
37     version = testers.testVersion {
38       package = sq;
39       version = "v${version}";
40     };
41   };
43   meta = with lib; {
44     description = "Swiss army knife for data";
45     homepage = "https://sq.io/";
46     license = licenses.mit;
47     platforms = platforms.all;
48     maintainers = with maintainers; [ raitobezarius ];
49   };