nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchFromGitHub,
6 jq,
7 oniguruma,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "jq";
13 version = "1.11.0";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "mwilliamson";
18 repo = "jq.py";
19 tag = version;
20 hash = "sha256-v5Hi3SkLKX7KrCHiXDuEThSLghDU5VVhNGt1KpMEqC4=";
21 };
22
23 env.JQPY_USE_SYSTEM_LIBS = 1;
24
25 nativeBuildInputs = [ cython ];
26
27 buildInputs = [
28 jq
29 oniguruma
30 ];
31
32 preBuild = ''
33 cython jq.pyx
34 '';
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 disabledTests = [
39 # tries to match exact error text, fails with jq 1.8
40 "test_value_error_is_raised_if_program_is_invalid"
41 ];
42
43 pythonImportsCheck = [ "jq" ];
44
45 meta = {
46 description = "Python bindings for jq, the flexible JSON processor";
47 homepage = "https://github.com/mwilliamson/jq.py";
48 changelog = "https://github.com/mwilliamson/jq.py/blob/${version}/CHANGELOG.rst";
49 license = lib.licenses.bsd2;
50 maintainers = with lib.maintainers; [ benley ];
51 };
52}