depot/third_party/nixpkgs/pkgs/development/tools/sq/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

50 lines
1.1 KiB
Nix

{ lib, buildGo121Module, fetchFromGitHub, installShellFiles, testers, sq }:
buildGo121Module rec {
pname = "sq";
version = "0.42.1";
src = fetchFromGitHub {
owner = "neilotoole";
repo = pname;
rev = "v${version}";
hash = "sha256-3Hu0vMulGWyNWgNlekYuTRxxxBbRkWj2RE0MWZzNXFk=";
};
vendorHash = "sha256-qEwK40BcUetsQOIefdjM/dgjTNuHO1EZgVk53/dfOlc=";
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 ];
};
}