From 4bc6cc79c5431dd2d8d87598995bbb79fe365d45 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 12 Jun 2025 07:45:00 -0500 Subject: [PATCH] nix: xo-ratio xo-unit build docs --- default.nix | 2 +- pkgs/xo-ratio.nix | 32 +++++++++++++++++++++++--------- pkgs/xo-unit.nix | 36 +++++++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/default.nix b/default.nix index 9436fd79..fb82e250 100644 --- a/default.nix +++ b/default.nix @@ -83,8 +83,8 @@ let xo-reflectutil = self.callPackage pkgs/xo-reflectutil.nix {}; xo-reflect = self.callPackage pkgs/xo-reflect.nix {}; xo-pyreflect = self.callPackage pkgs/xo-pyreflect.nix {}; - xo-unit = self.callPackage pkgs/xo-unit.nix {}; xo-ratio = self.callPackage pkgs/xo-ratio.nix { buildDocs = true; }; + xo-unit = self.callPackage pkgs/xo-unit.nix { buildDocs = true; }; xo-pyunit = self.callPackage pkgs/xo-pyunit.nix {}; # xo-callback = self.callPackage pkgs/xo-callback.nix {}; diff --git a/pkgs/xo-ratio.nix b/pkgs/xo-ratio.nix index 35acd4fb..0a13db3d 100644 --- a/pkgs/xo-ratio.nix +++ b/pkgs/xo-ratio.nix @@ -19,14 +19,28 @@ stdenv.mkDerivation (finalattrs: src = ../xo-ratio; cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]; + + inherit buildDocs; doCheck = true; - nativeBuildInputs = [ cmake - #catch2 - doxygen - sphinx -# python3Packages.sphinx-rtd-theme - xo-cmake - xo-flatstring - xo-reflectutil - ]; + + postBuild = lib.optionalString buildDocs '' + cmake --build . -- docs + ''; + + propagatedBuildInputs = [ ]; + + nativeBuildInputs = [ + cmake + xo-cmake + xo-flatstring + xo-reflectutil + ] + ++ lib.optionals buildDocs [ + doxygen + sphinx + graphviz + python3Packages.sphinx-rtd-theme + python3Packages.breathe + python3Packages.sphinxcontrib-ditaa + ]; }) diff --git a/pkgs/xo-unit.nix b/pkgs/xo-unit.nix index aeb7798e..997df9de 100644 --- a/pkgs/xo-unit.nix +++ b/pkgs/xo-unit.nix @@ -1,11 +1,14 @@ { # dependencies - stdenv, cmake, catch2, doxygen, + lib, stdenv, cmake, catch2, python3Packages, - sphinx, + + doxygen, sphinx, graphviz, xo-cmake, xo-ratio, xo-flatstring, + + buildDocs ? false, } : stdenv.mkDerivation (finalattrs: @@ -16,13 +19,28 @@ stdenv.mkDerivation (finalattrs: src = ../xo-unit; cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]; + + inherit buildDocs; doCheck = true; + + postBuild = lib.optionalString buildDocs '' + cmake --build . -- docs + ''; + propagatedBuildInputs = [ xo-ratio xo-flatstring ]; - nativeBuildInputs = [ cmake - catch2 - doxygen - sphinx - xo-cmake - #python3Packages.sphinx-rtd-theme - ]; + + nativeBuildInputs = [ + cmake + catch2 + xo-cmake + ] + ++ lib.optionals buildDocs [ + doxygen + sphinx + graphviz + python3Packages.sphinx-rtd-theme + python3Packages.breathe + python3Packages.sphinxcontrib-ditaa + python3Packages.sphinxcontrib-plantuml + ]; })