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