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 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
# Nix package for SimGrid's sphinx documentation.
# Example usage: nix-build ./default.nix -A simgrid-doc && firefox result/index.html
{ pkgs ? import (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/21.05.tar.gz";
sha256 = "1ckzhh24mgz6jd1xhfgx0i9mijk6xjqxwsshnvq789xsavrmsc36";
}) {}
}:
let
pythonPackages = pkgs.python3Packages;
buildPythonPackage = pythonPackages.buildPythonPackage;
self = rec {
# the desired package
simgrid-doc = pkgs.stdenv.mkDerivation rec {
name = "simgrid-doc";
src = ./..;
buildInputs = [
pkgs.doxygen
pythonPackages.sphinx
pythonPackages.sphinx_rtd_theme
pythonPackages.breathe
sphinx-tabs
];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
cd docs
rm -rf build # this is not done in your directory, this is on the copy made by the Nix build daemon
sphinx-build -b html source build
'';
installPhase = ''
mkdir -p $out
mv build/* $out/
'';
};
sphinx-tabs = pythonPackages.buildPythonPackage rec {
pname = "sphinx-tabs";
version = "3.1.0";
name = "${pname}-${version}";
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "0kv935qhml40mly33rk5am128g2ygqkfvizh33vf29hjkf32mvjy";
};
propagatedBuildInputs = with pythonPackages; [
docutils
pygments
sphinx
];
};
};
in
self
|