uhh yes
This commit is contained in:
parent
8226f5b933
commit
371db9222f
4 changed files with 59 additions and 17 deletions
33
overlays/opentrack.nix
Normal file
33
overlays/opentrack.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# ./overlays/opentrack.nix
|
||||
self: super: {
|
||||
opentrack = super.opentrack.overrideAttrs (oldAttrs: {
|
||||
# 1. Add dependencies for building (onnxruntime) and wrapping (makeWrapper)
|
||||
nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ super.makeWrapper ];
|
||||
buildInputs = oldAttrs.buildInputs or [] ++ [ self.onnxruntime ];
|
||||
|
||||
# 2. Enable the neuralnet tracker feature during compile time
|
||||
cmakeFlags = oldAttrs.cmakeFlags or [] ++ [ "-DSDK_NEURALNET=ON" ];
|
||||
|
||||
# 3. After installation, create a wrapper around the main binary
|
||||
postInstall = (oldAttrs.postInstall or "") + ''
|
||||
# Construct the full library path from all runtime dependencies
|
||||
lib_path="${super.lib.makeLibraryPath [
|
||||
super.qt5.qtbase
|
||||
super.qt5.qtwayland
|
||||
super.opencv
|
||||
self.onnxruntime
|
||||
super.procps
|
||||
super.libevdev
|
||||
]}"
|
||||
|
||||
# Construct the full Qt plugin path
|
||||
qt_plugin_path="${super.qt5.qtbase.bin}/lib/qt-${super.qt5.qtbase.version}/plugins:${super.qt5.qtwayland}/lib/qt-${super.qt5.qtwayland.version}/plugins"
|
||||
|
||||
# Use makeWrapper to prepend the environment variables to the executable
|
||||
# This modifies the binary at $out/bin/opentrack so it ALWAYS runs with this environment
|
||||
wrapProgram $out/bin/opentrack \
|
||||
--prefix LD_LIBRARY_PATH : "$lib_path" \
|
||||
--prefix QT_PLUGIN_PATH : "$qt_plugin_path"
|
||||
'';
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue