summaryrefslogtreecommitdiff
path: root/docs/.nix/derivation.nix
blob: a6dee7db539c177b0d3254c528fc0f805d79928d (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
38
39
40
41
42
{ 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
		pushd docs
    doxygen Doxygen.in
    python3 ${gasp.outPath}/bin/gasp.py xml --namespace saw > cpp_map.json
		# C++ and C template generation
		mkdir -p source/cpp_api
		python3 ${gasp.outPath}/bin/make_rst.py --title="C++" -t ${gasp.outPath}/templates/rst -m cpp_map.json -o source/cpp_api
		make html
		popd
  '';

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