From 77d4f098519d0bed5a19b4af81df62965ff24702 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 22 Sep 2025 12:44:01 -0400 Subject: [PATCH] nix build: xo-expression: build+install docs + examples --- default.nix | 2 +- pkgs/xo-expression.nix | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index c4578f5b..2b867d10 100644 --- a/default.nix +++ b/default.nix @@ -77,7 +77,6 @@ let in { - xo-expression = self.callPackage pkgs/xo-expression.nix {}; xo-tokenizer = self.callPackage pkgs/xo-tokenizer.nix { buildDocs = true; }; xo-reader = self.callPackage pkgs/xo-reader.nix {}; @@ -130,6 +129,7 @@ let xo-pykalmanfilter = self.callPackage pkgs/xo-pykalmanfilter.nix {}; # + xo-expression = self.callPackage pkgs/xo-expression.nix { buildExamples = true; }; xo-pyexpression = self.callPackage pkgs/xo-pyexpression.nix {}; xo-pyjit = self.callPackage pkgs/xo-pyjit.nix {}; # diff --git a/pkgs/xo-expression.nix b/pkgs/xo-expression.nix index c311fd06..561f7bf3 100644 --- a/pkgs/xo-expression.nix +++ b/pkgs/xo-expression.nix @@ -1,8 +1,11 @@ { # dependencies - stdenv, cmake, catch2, + lib, stdenv, cmake, catch2, - xo-cmake, xo-reflect, + xo-cmake, xo-reflect, xo-flatstring, + + buildDocs ? false, + buildExamples ? false, } : stdenv.mkDerivation (finalattrs: @@ -12,10 +15,19 @@ stdenv.mkDerivation (finalattrs: src = ../xo-expression; - cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]; + cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"] + ++ lib.optionals buildExamples ["-DXO_ENABLE_EXAMPLES=on"]; + + inherit buildDocs; + inherit buildExamples; + doCheck = true; - propagatedBuildInputs = [ xo-reflect ]; - nativeBuildInputs = [ cmake catch2 + + propagatedBuildInputs = [ xo-reflect + xo-flatstring + ]; + nativeBuildInputs = [ cmake + catch2 xo-cmake ]; })