2022-04-27 09:35:20 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, sq }:
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "sq";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "0.24.0";
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "neilotoole";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
sha256 = "sha256-KPH1IsvYQvyUsi4qxWKLpCQNrPCnulCqQLPK5iadm3I=";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
vendorHash = "sha256-AL4ghkeTIkXZXpGeBnWIx3hY6uO2bO7eVcH6DR/5jQc=";
|
2022-04-03 18:54:34 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
# Some tests violates sandbox constraints.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
ldflags = [
|
2022-12-28 21:21:41 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-03-08 16:32:21 +00:00
|
|
|
"-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
|
2022-04-03 18:54:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd sq \
|
|
|
|
--bash <($out/bin/sq completion bash) \
|
|
|
|
--fish <($out/bin/sq completion fish) \
|
|
|
|
--zsh <($out/bin/sq completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
2023-03-08 16:32:21 +00:00
|
|
|
version = testers.testVersion {
|
|
|
|
package = sq;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Swiss army knife for data";
|
|
|
|
homepage = "https://sq.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ raitobezarius ];
|
|
|
|
};
|
|
|
|
}
|