Skip to content

Commit

Permalink
nix: add builds of visr and visr_bear without python support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjnixon committed Dec 5, 2023
1 parent fd839dd commit c26f5db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@

# same as bear, but without the VISR module
bear_no_visr = pkgs.callPackage ./nix/bear.nix { inherit python src ear numpy_quaternion; };

# builds without python
visr_nopython = visr.override { enable_python = false; };
visr_bear_nopython = visr_bear.override { visr = visr_nopython; visr_python = null; enable_python = false; };
} // {
# for checking source filter
src = pkgs.runCommand "src" { } "cp -r ${src} $out";
Expand Down
6 changes: 3 additions & 3 deletions nix/visr.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ stdenv, cmake, python, boost, fetchzip, src }:
{ lib, stdenv, cmake, python, boost, fetchzip, src, enable_python ? true }:
stdenv.mkDerivation rec {
name = "VISR";
inherit src;
nativeBuildInputs = [ cmake boost python.buildEnv ];
nativeBuildInputs = [ cmake boost ] ++ lib.optional enable_python python.buildEnv;
cmakeFlags = [
"-DBUILD_AUDIOINTERFACES_PORTAUDIO=FALSE"
"-DBUILD_USE_SNDFILE_LIBRARY=FALSE"
"-DBUILD_DOCUMENTATION=FALSE"
"-DBUILD_STANDALONE_APPLICATIONS=false"
];
] ++ lib.optional (!enable_python) "-DBUILD_PYTHON_BINDINGS=false";
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "\''${VISR_TOPLEVEL_INSTALL_DIRECTORY}/python" "$out/${python.sitePackages}"
Expand Down
13 changes: 10 additions & 3 deletions nix/visr_bear.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{ stdenv, src, cmake, boost, python, visr_python, data_files, eigen, libear, rapidjson }:
{ lib, stdenv, src, cmake, boost, python, visr ? null, visr_python ? null, data_files, eigen, libear, rapidjson, enable_python ? true }:
stdenv.mkDerivation rec {
name = "visr_bear";
inherit src;
nativeBuildInputs = [ cmake boost python.buildEnv visr_python eigen libear rapidjson ];
nativeBuildInputs = [
cmake
boost
visr
eigen
libear
rapidjson
] ++ (if enable_python then [ python.buildEnv visr_python ] else [ visr ]);
cmakeFlags = [
"-DBEAR_UNIT_TESTS=true"
"-DBEAR_DATA_PATH_DEFAULT=${data_files.default.file}"
"-DBEAR_DATA_PATH_DEFAULT_SMALL=${data_files.default_small.file}"
"-DBEAR_SYMLINK_DATA_FILES=true"
"-DBEAR_USE_INTERNAL_LIBEAR=false"
"-DBEAR_USE_INTERNAL_RAPIDJSON=false"
];
] ++ lib.optional (!enable_python) "-DBUILD_PYTHON_BINDINGS=false";
preConfigure = ''cmakeFlags="$cmakeFlags -DBEAR_PYTHON_SITE_PACKAGES=$out/${python.sitePackages}"'';

doCheck = true;
Expand Down

0 comments on commit c26f5db

Please sign in to comment.