nixpkgs/pkgs/tools/misc/dsq/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.2 KiB
Nix
Raw Normal View History

2022-03-26 14:37:36 +01:00
{ lib
, stdenv
, fetchFromGitHub
, buildGoModule
, runCommand
, nix-update-script
, fetchurl
, testers
, python3
, curl
, jq
2022-06-21 15:55:51 +02:00
, p7zip
, dsq
2022-03-26 14:37:36 +01:00
}:
buildGoModule rec {
pname = "dsq";
2022-10-21 07:32:57 +02:00
version = "0.23.0";
2022-03-26 14:37:36 +01:00
src = fetchFromGitHub {
owner = "multiprocessio";
repo = "dsq";
rev = "v${version}";
2022-10-21 07:32:57 +02:00
hash = "sha256-FZBJe+2y4HV3Pgeap4yvD0a8M/j+6pAJEFpoQVVE1ec=";
2022-03-26 14:37:36 +01:00
};
2022-10-21 07:32:57 +02:00
vendorSha256 = "sha256-MbBR+OC1OGhZZGcZqc+Jzmabdc5ZfFEwzqP5YMrj6mY=";
2022-03-26 14:37:36 +01:00
ldflags = [ "-X" "main.Version=${version}" ];
nativeCheckInputs = [ python3 curl jq p7zip ];
2022-06-21 15:55:51 +02:00
preCheck = ''
substituteInPlace scripts/test.py \
--replace 'dsq latest' 'dsq ${version}'
'';
checkPhase = ''
runHook preCheck
2022-06-21 15:55:51 +02:00
7z e testdata/taxi.csv.7z
cp "$GOPATH/bin/dsq" .
python3 scripts/test.py
runHook postCheck
'';
2022-03-26 14:37:36 +01:00
passthru = {
updateScript = nix-update-script { };
2022-03-26 14:37:36 +01:00
tests.version = testers.testVersion { package = dsq; };
2022-03-26 14:37:36 +01:00
};
meta = with lib; {
description = "Commandline tool for running SQL queries against JSON, CSV, Excel, Parquet, and more";
homepage = "https://github.com/multiprocessio/dsq";
license = licenses.asl20;
maintainers = with maintainers; [ liff ];
};
}