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 rev = "refs/tags/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 nativeCheckInputs = [
43 defusedxml
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}