diff --git a/flake.nix b/flake.nix index c5ea5b37..44369377 100644 --- a/flake.nix +++ b/flake.nix @@ -130,9 +130,9 @@ #doxygen = prev.doxygen; pybind11 = pythonPackages.pybind11; - #breathe = python3Packages.breathe; - #sphinx = python3Packages.sphinx; - #sphinx-rtd-theme = python3Packages.sphinx-rtd-theme; + #breathe = pythonPackages.breathe; + #sphinx = pythonPackages.sphinx; + #sphinx-rtd-theme = pythonPackages.sphinx-rtd-theme; #extras1 = { boost = boost; }; #extras2 = { boost = boost; python3Packages = python3Packages; pybind11 = pybind11; }; @@ -164,7 +164,10 @@ xo-unit = (prev.callPackage ./pkgs/xo-unit.nix { xo-cmake = xo-cmake; - xo-reflect = xo-reflect; }).overrideAttrs + xo-reflect = xo-reflect; + python = python; + pythonPackages = pythonPackages; + }).overrideAttrs (old: { src = ./.; }); # placeholder-D diff --git a/pkgs/xo-unit.nix b/pkgs/xo-unit.nix index 093c3091..e3ee6d43 100644 --- a/pkgs/xo-unit.nix +++ b/pkgs/xo-unit.nix @@ -1,8 +1,27 @@ { - # nixpkgs dependencies + # 1. nixpkgs dependencies + # 1.1. python + python, pythonPackages, + + # 1.2. particular python packages + sphinx ? pythonPackages.sphinx, + sphinx-rtd-theme ? pythonPackages.sphinx-rtd-theme, + breathe ? pythonPackages.breathe, + + # 1.3. document-generation packages + # use of makeFontsConf adapted from nixpkgs/development/libraries/gtkmm/4.x.nix + # + doxygen, graphviz, + #fontconfig, + makeFontsConf, + + # used for graphviz (dot) see docs/Doxyfile.in + helvetica-neue-lt-std, + + # 1.4. c++ build/utest chain stdenv, cmake, catch2, # ... other deps here - # xo dependencies + # 2. xo dependencies xo-cmake, xo-reflect, # args @@ -31,7 +50,32 @@ stdenv.mkDerivation (finalattrs: }); cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]; + + FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ helvetica-neue-lt-std ]; }; + + # move HOME so fontconfig can do sensible things + buildPhase = '' + set -x + + echo "FONTCONFIG_FILE=$FONTCONFIG_FILE" + + #export FONTCONFIG_FILE=$fontconfig.out/etc/fonts/fonts.conf + export HOME=$TMPDIR + export XDG_CONFIG_HOME=$TMPDIR + + mkdir $XDG_CONFIG_HOME/fontconfig + + #grep xdg $FONTCONFIG_FILE + + #$fontconfig.out/bin/fc-cache -v + + make && make docs + ''; + + # NOTE: helvetic-neue-lt-std has unfree license + #FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ helvetica-neue-lt-std ]; }; + doCheck = true; - nativeBuildInputs = [ cmake catch2 ]; - propagatedBuildInputs = [ ]; + nativeBuildInputs = [ cmake catch2 doxygen graphviz sphinx sphinx-rtd-theme breathe ]; + propagatedBuildInputs = [ xo-reflect ]; })