2023-08-26 11:17:36 +00:00
|
|
|
{ lib, buildGo121Module, fetchFromGitHub, installShellFiles, testers, sq }:
|
2022-12-27 01:06:49 +00:00
|
|
|
|
2023-08-26 11:17:36 +00:00
|
|
|
buildGo121Module rec {
|
2022-03-05 00:55:43 +00:00
|
|
|
pname = "sq";
|
2023-09-26 11:16:00 +00:00
|
|
|
version = "0.42.1";
|
2022-03-05 00:55:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "neilotoole";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-09-26 11:16:00 +00:00
|
|
|
hash = "sha256-3Hu0vMulGWyNWgNlekYuTRxxxBbRkWj2RE0MWZzNXFk=";
|
2022-03-05 00:55:43 +00:00
|
|
|
};
|
|
|
|
|
2023-09-26 11:16:00 +00:00
|
|
|
vendorHash = "sha256-qEwK40BcUetsQOIefdjM/dgjTNuHO1EZgVk53/dfOlc=";
|
2022-03-05 00:55:43 +00:00
|
|
|
|
2022-12-27 01:06:49 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2022-03-05 00:55:43 +00:00
|
|
|
|
|
|
|
# Some tests violates sandbox constraints.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
ldflags = [
|
2022-12-27 01:06:49 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-03-04 10:56:08 +00:00
|
|
|
"-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
|
2022-03-05 00:55:43 +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-04 10:56:08 +00:00
|
|
|
version = testers.testVersion {
|
|
|
|
package = sq;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
2022-03-05 00:55:43 +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 ];
|
|
|
|
};
|
|
|
|
}
|