2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPackages,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
ruamel-yaml,
|
|
|
|
xmltodict,
|
|
|
|
pygments,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jc";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.25.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-08-05 21:33:18 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kellyjonbrazil";
|
2021-08-05 21:33:18 +00:00
|
|
|
repo = pname;
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-yp5533CzqJ++G6nHip1281ZkB4JyfLb3inR9BwDkxSs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ruamel-yaml
|
|
|
|
xmltodict
|
|
|
|
pygments
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
emulator = stdenv.hostPlatform.emulator buildPackages;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
installShellCompletion --cmd jc \
|
|
|
|
--bash <(${emulator} $out/bin/jc --bash-comp) \
|
|
|
|
--zsh <(${emulator} $out/bin/jc --zsh-comp)
|
|
|
|
'';
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
pythonImportsCheck = [ "jc" ];
|
|
|
|
|
|
|
|
# tests require timezone to set America/Los_Angeles
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "This tool serializes the output of popular command line tools and filetypes to structured JSON output";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/kellyjonbrazil/jc";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ atemu ];
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/kellyjonbrazil/jc/blob/v${version}/CHANGELOG";
|
2023-08-10 07:59:29 +00:00
|
|
|
mainProgram = "jc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|