mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 05:50:00 +00:00
xlsxsql: init at 0.4.0
This commit is contained in:
61
pkgs/by-name/xl/xlsxsql/package.nix
Normal file
61
pkgs/by-name/xl/xlsxsql/package.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
buildPackages,
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "xlsxsql";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "noborus";
|
||||
repo = "xlsxsql";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-OmNYrohWs4l7cReTBB6Ha9VuKPit1+P7a4QKhYwK5g8=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-Zrt4NMoQePvipFyYpN+Ipgl2D6j/thCPhrQy4AbXOfQ=";
|
||||
|
||||
ldflags = [
|
||||
"-X main.version=v${version}"
|
||||
"-X main.revision=${src.rev}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
|
||||
let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in
|
||||
''
|
||||
installShellCompletion --cmd xlsxsql \
|
||||
--bash <(${emulator} $out/bin/xlsxsql completion bash) \
|
||||
--fish <(${emulator} $out/bin/xlsxsql completion fish) \
|
||||
--zsh <(${emulator} $out/bin/xlsxsql completion zsh)
|
||||
''
|
||||
);
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
versionCheckProgramArg = [ "--version" ];
|
||||
doInstallCheck = true;
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "CLI tool that executes SQL queries on various files including xlsx files and outputs the results to various files";
|
||||
homepage = "https://github.com/noborus/xlsxsql";
|
||||
changelog = "https://github.com/noborus/xlsxsql/releases/tag/v${version}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
|
||||
mainProgram = "xlsxsql";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user