pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / by-name / cs / csvtk / package.nix
blob9686b5fae891f43dfb30eb81c12ebb755adab259
2   lib,
3   stdenv,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7   buildPackages,
8 }:
9 let
10   version = "0.31.0";
12 buildGoModule {
13   pname = "csvtk";
14   inherit version;
16   src = fetchFromGitHub {
17     owner = "shenwei356";
18     repo = "csvtk";
19     rev = "refs/tags/v${version}";
20     hash = "sha256-RfW7SiRcsN0F/+2bixLMNsqJCOSD1BQwlm4Zm2kogXM=";
21   };
23   vendorHash = "sha256-5RqAtnGioasbQxLltglCWitzb7mQgNYIE9IFkE0AOME=";
25   nativeBuildInputs = [ installShellFiles ];
27   postInstall =
28     let
29       csvtkBin =
30         if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
31           "$out"
32         else
33           lib.getBin buildPackages.csvtk;
34     in
35     ''
36       for shell in bash zsh fish; do
37         ${csvtkBin}/bin/csvtk genautocomplete --shell $shell --file csvtk.$shell
38         installShellCompletion csvtk.$shell
39       done
40     '';
42   meta = {
43     description = "Cross-platform, efficient and practical CSV/TSV toolkit in Golang";
44     changelog = "https://github.com/shenwei356/csvtk/releases/tag/v${version}";
45     homepage = "https://github.com/shenwei356/csvtk";
46     license = lib.licenses.mit;
47     maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
48     mainProgram = "csvtk";
49   };