1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pythonImportsCheckHook
6, sphinx
7, sphinxHook
8, sphinx-autoapi
9, sphinx-rtd-theme
10, sphinx-tabs
11, sphinx-prompt
12, sphinxemoji
13}:
14
15# Latest tagged release release "1.1.2" (Nov 2018) does not contain
16# documenation, it was added in commits Aug 10, 2019. Repository does not have
17# any activity since then.
18buildPythonPackage rec {
19 pname = "sphinx-version-warning";
20 version = "unstable-2019-08-10";
21 outputs = [ "out" "doc" ];
22
23 src = fetchFromGitHub {
24 owner = "humitos";
25 repo = "sphinx-version-warning";
26 rev = "a82156c2ea08e5feab406514d0ccd9d48a345f48";
27 hash = "sha256-WnJYMk1gPLT0dBn7lmxVDNVkLYkDCgQOtM9fQ3kc6k0=";
28 };
29
30 # It tries to write to file relative to it own location at runtime
31 # and gets permission denied, since Nix store is immutable.
32 patches = [
33 (fetchpatch {
34 url = "https://github.com/humitos/sphinx-version-warning/commit/cb1b47becf2a0d3b2570ca9929f42f7d7e472b6f.patch";
35 hash = "sha256-Vj0QAHIBmc0VxE+TTmJePzvr5nc45Sn2qqM+C/pkgtM=";
36 })
37 ];
38
39 nativeBuildInputs = [
40 pythonImportsCheckHook
41 sphinxHook
42 sphinx-autoapi
43 sphinx-rtd-theme
44 sphinx-tabs
45 sphinx-prompt
46 sphinxemoji
47 ];
48
49 propagatedBuildInputs = [ sphinx ];
50
51 pythonImportsCheck = [ "versionwarning" ];
52
53 meta = with lib; {
54 description = "A sphinx extension to show a warning banner at the top of your documentation";
55 homepage = "https://github.com/humitos/sphinx-version-warning";
56 license = licenses.mit;
57 maintainers = with maintainers; [ kaction ];
58 };
59}