summaryrefslogtreecommitdiff
path: root/docs/.nix/derivation.nix
blob: 9780f524c9e49938d2f9610f4a7145d3d2aac089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib
, stdenvNoCC
, python3
, python3Packages
, doxygen
, gasp
, version
}:

stdenvNoCC.mkDerivation {
  pname = "forstio-docs";
	inherit version;

  src = ../../.;

  nativeBuildInputs = [
    python3
    python3Packages.sphinx
    python3Packages.sphinx-rtd-theme
    doxygen
    gasp
  ];

  buildPhase = ''
    # C++ API generation
    doxygen docs/Doxygen.in
    python3 ${gasp.outPath}/bin/gasp.py xml --namespace duke > cpp_map.json
    # C++ and C template generation
    python3 ${gasp.outPath}/bin/make_rst.py --title="C++" -t ${gasp.outPath}/templates/rst -m cpp_map.json -o source/cpp_api
    make html
  '';

  installPhase = ''
    mkdir -p $out
    mv build/html $out/html
  '';
}