depot/third_party/nixpkgs/pkgs/development/tools/sq/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

50 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, sq }:
buildGoModule rec {
pname = "sq";
version = "0.35.0";
src = fetchFromGitHub {
owner = "neilotoole";
repo = pname;
rev = "v${version}";
sha256 = "sha256-yCV/vn6c1FeHhPM+YCS6tr8M45SZiytrDjdocKVJ5Mk=";
};
vendorHash = "sha256-SOnYK9JtP1V8Y6/GszU26kYM1e2xupBmHsJrVpRT2vc=";
proxyVendor = true;
nativeBuildInputs = [ installShellFiles ];
# Some tests violates sandbox constraints.
doCheck = false;
ldflags = [
"-s"
"-w"
"-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
];
postInstall = ''
installShellCompletion --cmd sq \
--bash <($out/bin/sq completion bash) \
--fish <($out/bin/sq completion fish) \
--zsh <($out/bin/sq completion zsh)
'';
passthru.tests = {
version = testers.testVersion {
package = sq;
version = "v${version}";
};
};
meta = with lib; {
description = "Swiss army knife for data";
homepage = "https://sq.io/";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ raitobezarius ];
};
}