From 81f59ed21754119944dc8375a88840e9506ad768 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 10 May 2025 16:30:13 -0500 Subject: [PATCH] + xo-userenv --- README.md | 41 +++++++++++++++++++ default.nix | 2 +- pkgs/xo-userenv.nix | 99 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 pkgs/xo-userenv.nix diff --git a/README.md b/README.md index 1aa24fa9..09a6f261 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,44 @@ It doesn't interact with toplevel `CMakeLists.txt`. ``` $ nix-build -A xo-userenv ``` + +This builds all xo subprojects, assembles sandbox under `./result`. + +``` +$ tree -L 1 ./result +./result +├── bin +│   ├── xo-build +│   ├── xo-cmake-config +│   └── xo-cmake-lcov-harness +└── share + ├── cmake + │   └── xo_macros + │   ├── code-coverage.cmake + │   ├── xo-project-macros.cmake + │   └── xo_cxx.cmake + ├── etc + │   └── xo + │   └── subsystem-list + └── xo-macros + ├── Doxyfile.in + ├── gen-ccov.in + └── xo-bootstrap-macros.cmake +``` + +## To add a new satellite repo + +1. check clone in clean state (all local changes committed or unwound) + +2. add satellite as remote + +``` +$ git remote add xo-foo git@github.com:Rconybea/xo-foo.git +$ git fetch xo-foo +``` + +3. checkout satellite repo + +``` +$ git subtree add --prefix=xo-foo main +``` diff --git a/default.nix b/default.nix index 85998608..3c2a1aae 100644 --- a/default.nix +++ b/default.nix @@ -78,7 +78,7 @@ let # xo-kalmanfilter = self.callPackage pkgs/xo-kalmanfilter.nix {}; # xo-pykalmanfilter = self.callPackage pkgs/xo-pykalmanfilter.nix {}; # -# xo-userenv = self.callPackage pkgs/xo-userenv.nix {}; + xo-userenv = self.callPackage pkgs/xo-userenv.nix {}; # xo-userenv-slow = self.callPackage pkgs/xo-userenv-slow.nix {}; }; diff --git a/pkgs/xo-userenv.nix b/pkgs/xo-userenv.nix new file mode 100644 index 00000000..541dc999 --- /dev/null +++ b/pkgs/xo-userenv.nix @@ -0,0 +1,99 @@ +# builds environment with all xo packages, +# using combined output directory for each. +# +# parallels github actions build on stock ubuntu, +# except that we use nixpkgs for toolchain +# +# For xo development, probably prefer xo-userenv.nix instead of this xo-userenv-slow.nix: +# 1. xo-userenv.nix allows parallel build +# 2. xo-userenv.nix only rebuilds xo packages that have changed + +{ + # nixpkgs dependencies + buildEnv, + stdenv, + cmake, + catch2, + eigen, + libwebsockets, + jsoncpp, + doxygen, + sphinx, + python3Packages, + + # xo dependencies + xo-cmake, +# xo-indentlog, +# xo-subsys, +# xo-refcnt, +# xo-randomgen, +# xo-ordinaltree, +# xo-flatstring, +# xo-reflectutil, +# xo-ratio, +# xo-unit, +# xo-pyunit, +# xo-pyutil, +# xo-reflect, +# xo-pyreflect, +# xo-printjson, +# xo-pyprintjson, +# xo-callback, +# xo-webutil, +# xo-pywebutil, +# xo-reactor, +# xo-pyreactor, +# xo-simulator, +# xo-pysimulator, xo-distribution, xo-pydistribution, xo-process, xo-pyprocess, xo-statistics, xo-kalmanfilter, +# xo-pykalmanfilter, xo-websock, xo-pywebsock, xo-tokenizer, +# xo-expression, xo-pyexpression, xo-reader, +# xo-jit, +# xo-pyjit + + # other args + + # someconfigurationoption ? false +} : + +buildEnv { + name = "xo-userenv"; + paths = [ xo-cmake +# xo-indentlog +# xo-refcnt +# xo-subsys +# xo-randomgen +# xo-ordinaltree +# xo-pyutil +# xo-flatstring +# xo-reflectutil +# xo-reflect +# xo-pyreflect +# xo-ratio +# xo-unit +# xo-pyunit +# xo-expression +# xo-pyexpression +# xo-tokenizer +# xo-reader +# xo-jit +# xo-pyjit +# xo-callback +# xo-webutil +# xo-pywebutil +# xo-printjson +# xo-pyprintjson +# xo-reactor +# xo-pyreactor +# xo-websock +# xo-pywebsock +# xo-statistics +# xo-distribution +# xo-pydistribution +# xo-simulator +# xo-pysimulator +# xo-process +# xo-pyprocess +# xo-kalmanfilter +# xo-pykalmanfilter + ]; +}