
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, buildGoModule
|
|
, nix-update-script
|
|
, testers
|
|
, python3
|
|
, curl
|
|
, jq
|
|
, p7zip
|
|
, dsq
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "dsq";
|
|
version = "0.23.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "multiprocessio";
|
|
repo = "dsq";
|
|
rev = "v${version}";
|
|
hash = "sha256-FZBJe+2y4HV3Pgeap4yvD0a8M/j+6pAJEFpoQVVE1ec=";
|
|
};
|
|
|
|
vendorHash = "sha256-MbBR+OC1OGhZZGcZqc+Jzmabdc5ZfFEwzqP5YMrj6mY=";
|
|
|
|
ldflags = [ "-X" "main.Version=${version}" ];
|
|
|
|
nativeCheckInputs = [ python3 curl jq p7zip ];
|
|
|
|
preCheck = ''
|
|
substituteInPlace scripts/test.py \
|
|
--replace 'dsq latest' 'dsq ${version}'
|
|
'';
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
|
|
7z e testdata/taxi.csv.7z
|
|
cp "$GOPATH/bin/dsq" .
|
|
python3 scripts/test.py
|
|
|
|
runHook postCheck
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion { package = dsq; };
|
|
};
|
|
|
|
meta = with lib; {
|
|
mainProgram = "dsq";
|
|
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 ];
|
|
};
|
|
}
|