2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, cython
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchpatch
|
2023-08-22 20:05:09 +00:00
|
|
|
, jq
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jq";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.5.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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-mITk5y2AdUc9kZ/WrsnHxS1GRRmO4FDbPRgTtV2gIXI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
patches = [
|
|
|
|
# Removes vendoring
|
|
|
|
./jq-py-setup.patch
|
2023-10-09 19:29:22 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/mwilliamson/jq.py/commit/805705dde4beb9db9a1743663d415198fb02eb1a.patch";
|
|
|
|
includes = [ "tests/*" ];
|
|
|
|
hash = "sha256-AgdpwmtOTeJ4nSbM6IknKaIVqqtWkpxTTtblXjlbWeA=";
|
|
|
|
})
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildInputs = [
|
|
|
|
jq
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
preBuild = ''
|
|
|
|
cython jq.pyx
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-02 08:20:57 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +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
|
|
|
};
|
|
|
|
}
|