-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
63 lines (51 loc) · 1.54 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
monado = pkgs.callPackage ./monado.nix {
serviceSupport = true;
gst-plugins-base = pkgs.gst_all_1.gst-plugins-base;
gstreamer = pkgs.gst_all_1.gstreamer;
};
nsBuildMonadoIncremental = pkgs.writeShellScriptBin "nsBuildMonadoIncremental" ''
#!/usr/bin/env bash
set -e
mkdir -p build
cd build
if [ ! -f CMakeCache.txt ]; then
cmake .. \
-DXRT_FEATURE_SERVICE=ON \
-DXRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH=ON \
-DXRT_BUILD_DRIVER_SIMULAVR=ON \
-DXRT_HAVE_XVISIO=ON \
-DXRT_HAVE_LIBUVC=OFF \
-DXVSDK_INCLUDE_DIR=${monado.xvsdk}/include \
-DXVSDK_LIBRARY_DIR=${monado.xvsdk}/lib
fi
cmake --build . -- -j$(nproc)
ln -sf "$(pwd)/src/xrt/targets/service/monado-service" ../monado-service
echo "Monado incremental build completed successfully"
'';
rmBuilds = pkgs.writeShellScriptBin "rmBuilds" ''
#!/usr/bin/env bash
set -e
find . -name build -type d -exec rm -rf {} +
echo "All build directories have been cleaned."
'';
in
pkgs.mkShell {
buildInputs = monado.buildInputs ++ monado.nativeBuildInputs ++ [
nsBuildMonadoIncremental
rmBuilds
monado
] ++ (with pkgs; [
cmake
pkg-config
python3
]);
shellHook = ''
echo "Monado development environment loaded.."
echo "Use 'nsBuildMonadoIncremental' to perform an incremental build.."
export XVSDK_INCLUDE_DIR="${monado.xvsdk}/include"
export XVSDK_LIBRARY_DIR="${monado.xvsdk}/lib"
'';
}