1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, flit-core
6, pytestCheckHook
7, sphinx
8}:
9
10buildPythonPackage rec {
11 pname = "sphinxcontrib-jquery";
12 version = "4.1";
13 format = "pyproject";
14
15 src = fetchFromGitHub {
16 owner = "sphinx-contrib";
17 repo = "jquery";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-ZQGQcVmhWREFa2KyaOKdTz5W2AS2ur7pFp8qZ2IkxSE=";
20 };
21
22 patches = [
23 (fetchpatch {
24 name = "fix-tests-with-sphinx7.1.patch";
25 url = "https://github.com/sphinx-contrib/jquery/commit/ac97ce5202b05ddb6bf4e5b77151a8964b6bf632.patch";
26 hash = "sha256-dc9bhr/af3NmrIfoVabM1lNpXbGVsJoj7jq0E1BAtHw=";
27 })
28 (fetchpatch {
29 name = "fix-tests-with-sphinx7.2.patch";
30 url = "https://github.com/sphinx-contrib/jquery/commit/03f1595b3793e087a407933fbcb757bdd3f558fc.patch";
31 hash = "sha256-4gNG1DL/63N2FwXDy5fMApZpf/AGOGBruwPuVqgnVkc=";
32 })
33 ];
34
35 nativeBuildInputs = [
36 flit-core
37 ];
38
39 pythonImportsCheck = [
40 "sphinxcontrib.jquery"
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 sphinx
46 ];
47
48 pythonNamespaces = [ "sphinxcontrib" ];
49
50 meta = with lib; {
51 description = "Extension to include jQuery on newer Sphinx releases";
52 longDescription = ''
53 A sphinx extension that ensures that jQuery is installed for use
54 in Sphinx themes or extensions
55 '';
56 homepage = "https://github.com/sphinx-contrib/jquery";
57 changelog = "https://github.com/sphinx-contrib/jquery/blob/v${version}/CHANGES.rst";
58 license = licenses.bsd0;
59 maintainers = with maintainers; [ kaction ];
60 };
61}