2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cython,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jq,
|
|
|
|
oniguruma,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2023-08-22 20:05:09 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jq";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.6.0";
|
2023-08-22 20:05:09 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mwilliamson";
|
|
|
|
repo = "jq.py";
|
2023-08-22 20:05:09 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-c6tJI/mPlBGIYTk5ObIQ1CUTq73HouQ2quMZVWG8FFg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
env.JQPY_USE_SYSTEM_LIBS = 1;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildInputs = [
|
|
|
|
jq
|
2024-01-13 08:15:51 +00:00
|
|
|
oniguruma
|
2023-08-22 20:05:09 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
preBuild = ''
|
|
|
|
cython jq.pyx
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# intentional behavior change in jq 1.7.1 not reflected upstream
|
|
|
|
"test_given_json_text_then_strings_containing_null_characters_are_preserved"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "jq" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings for jq, the flexible JSON processor";
|
|
|
|
homepage = "https://github.com/mwilliamson/jq.py";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/mwilliamson/jq.py/blob/${version}/CHANGELOG.rst";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ benley ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|