1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, pythonRelaxDepsHook
6, sphinx
7, beautifulsoup4
8, sphinx-basic-ng
9}:
10
11buildPythonPackage rec {
12 pname = "furo";
13 version = "2023.9.10";
14 format = "wheel";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchPypi {
19 inherit pname version format;
20 dist = "py3";
21 python = "py3";
22 hash = "sha256-UTCSU4U33FxZZpHaBuPDcHFOyZvEOGgO3B3r/7c+W/w=";
23 };
24
25 nativeBuildInputs = [
26 pythonRelaxDepsHook
27 ];
28
29 pythonRelaxDeps = [
30 "sphinx"
31 ];
32
33 propagatedBuildInputs = [
34 sphinx
35 beautifulsoup4
36 sphinx-basic-ng
37 ];
38
39 installCheckPhase = ''
40 # furo was built incorrectly if this directory is empty
41 # Ignore the hidden file .gitignore
42 cd "$out/lib/python"*
43 if [ "$(ls 'site-packages/furo/theme/furo/static/' | wc -l)" -le 0 ]; then
44 echo 'static directory must not be empty'
45 exit 1
46 fi
47 cd -
48 '';
49
50 pythonImportsCheck = [
51 "furo"
52 ];
53
54 meta = with lib; {
55 description = "A clean customizable documentation theme for Sphinx";
56 homepage = "https://github.com/pradyunsg/furo";
57 changelog = "https://github.com/pradyunsg/furo/blob/${version}/docs/changelog.md";
58 license = licenses.mit;
59 maintainers = with maintainers; [ Luflosi ];
60 };
61}