at master 1.7 kB view raw
1{ 2 lib, 3 buildNpmPackage, 4 buildPythonPackage, 5 fetchFromGitHub, 6 flit-core, 7 accessible-pygments, 8 beautifulsoup4, 9 pygments, 10 sphinx, 11 sphinx-basic-ng, 12}: 13 14let 15 pname = "furo"; 16 version = "2025.07.19"; 17 18 src = fetchFromGitHub { 19 owner = "pradyunsg"; 20 repo = "furo"; 21 tag = version; 22 hash = "sha256-pIF5zrh5YbkuSkrateEB/tDULSNbeVn2Qx+Fm3nOYGE="; 23 }; 24 25 web = buildNpmPackage { 26 pname = "${pname}-web"; 27 inherit version src; 28 29 npmDepsHash = "sha256-dcdHoyqF9zC/eKtEqMho7TK2E1KIvoXo0iwSPTzj+Kw="; 30 31 installPhase = '' 32 pushd src/furo/theme/furo/static 33 mkdir $out 34 cp -rv scripts styles $out/ 35 popd 36 ''; 37 }; 38in 39 40buildPythonPackage rec { 41 inherit pname version src; 42 pyproject = true; 43 44 postPatch = '' 45 # build with boring backend that does not manage a node env 46 substituteInPlace pyproject.toml \ 47 --replace-fail "sphinx-theme-builder >= 0.2.0a10" "flit-core" \ 48 --replace-fail "sphinx_theme_builder" "flit_core.buildapi" 49 50 pushd src/furo/theme/furo/static 51 cp -rv ${web}/{scripts,styles} . 52 popd 53 ''; 54 55 build-system = [ flit-core ]; 56 57 pythonRelaxDeps = [ "sphinx" ]; 58 59 dependencies = [ 60 accessible-pygments 61 beautifulsoup4 62 pygments 63 sphinx 64 sphinx-basic-ng 65 ]; 66 67 pythonImportsCheck = [ "furo" ]; 68 69 passthru = { 70 inherit web; 71 }; 72 73 meta = with lib; { 74 description = "Clean customizable documentation theme for Sphinx"; 75 homepage = "https://github.com/pradyunsg/furo"; 76 changelog = "https://github.com/pradyunsg/furo/blob/${version}/docs/changelog.md"; 77 license = licenses.mit; 78 maintainers = with maintainers; [ Luflosi ]; 79 }; 80}