summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/sphinxcontrib-jquery/default.nix
blob: 46f48ee831617abe734f21ef15ab776b21f1829e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  flit-core,
  defusedxml,
  pytestCheckHook,
  sphinx,
}:

buildPythonPackage rec {
  pname = "sphinxcontrib-jquery";
  version = "4.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "sphinx-contrib";
    repo = "jquery";
    tag = "v${version}";
    hash = "sha256-ZQGQcVmhWREFa2KyaOKdTz5W2AS2ur7pFp8qZ2IkxSE=";
  };

  patches = [
    (fetchpatch {
      name = "fix-tests-with-sphinx7.1.patch";
      url = "https://github.com/sphinx-contrib/jquery/commit/ac97ce5202b05ddb6bf4e5b77151a8964b6bf632.patch";
      hash = "sha256-dc9bhr/af3NmrIfoVabM1lNpXbGVsJoj7jq0E1BAtHw=";
    })
    (fetchpatch {
      # https://github.com/sphinx-contrib/jquery/pull/28
      name = "fix-tests-with-sphinx7.2-and-python312.patch";
      url = "https://github.com/sphinx-contrib/jquery/commit/3318a82854fccec528cd73e12ab2ab96d8e71064.patch";
      hash = "sha256-pNeKE50sm4b/KhNDAEQ3oJYGV4I8CVHnbR76z0obT3E=";
    })
  ];

  nativeBuildInputs = [ flit-core ];

  pythonImportsCheck = [ "sphinxcontrib.jquery" ];

  dependencies = [
    sphinx
  ];

  nativeCheckInputs = [
    defusedxml
    pytestCheckHook
  ];

  pythonNamespaces = [ "sphinxcontrib" ];

  meta = {
    description = "Extension to include jQuery on newer Sphinx releases";
    longDescription = ''
      A sphinx extension that ensures that jQuery is installed for use
      in Sphinx themes or extensions
    '';
    homepage = "https://github.com/sphinx-contrib/jquery";
    changelog = "https://github.com/sphinx-contrib/jquery/blob/v${version}/CHANGES.rst";
    license = lib.licenses.bsd0;
    maintainers = with lib.maintainers; [ kaction ];
  };
}