-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ultraleap-hand-tracking: init #310138
Open
Scrumplex
wants to merge
6
commits into
NixOS:master
Choose a base branch
from
Scrumplex:pkgs/ultraleap
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ultraleap-hand-tracking: init #310138
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1a720b3
ultraleap-hand-tracking-control-panel: init at 3.4.1
Scrumplex 450780c
ultraleap-hand-tracking-service: init at 5.17.1.0
Scrumplex cffcb2d
openxr-ultraleap-layer: init
Scrumplex 58b365d
monado: add Ultraleap support
Scrumplex 1e01152
nixos/ultraleap: init
Scrumplex 7a7d128
nixos/monado: add enableUltraleap option
Scrumplex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
let | ||
inherit (lib) | ||
getExe' | ||
mkDefault | ||
mkEnableOption | ||
mkIf | ||
mkPackageOption | ||
; | ||
|
||
cfg = config.services.ultraleap; | ||
in | ||
{ | ||
options.services.ultraleap = { | ||
enable = mkEnableOption "Ultraleap hand tracking service"; | ||
|
||
servicePackage = mkPackageOption pkgs "ultraleap-hand-tracking-service" { }; | ||
layerPackage = mkPackageOption pkgs "openxr-ultraleap-layer" { }; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
services.udev.packages = [ cfg.servicePackage ]; | ||
|
||
systemd.tmpfiles.settings."10-ultraleap"."/etc/ultraleap".d = { | ||
user = "leap"; | ||
group = "leap"; | ||
mode = "0755"; | ||
}; | ||
|
||
systemd.services."ultraleap-hand-tracking-service" = { | ||
description = "Ultraleap Tracking Service"; | ||
after = [ "network.target" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
environment = { | ||
"LIBTRACK_IS_SERVICE" = mkDefault "1"; | ||
}; | ||
|
||
serviceConfig = { | ||
Type = "exec"; | ||
ExecStart = getExe' cfg.servicePackage "leapd"; | ||
User = "leap"; | ||
Group = "leap"; | ||
KillMode = "process"; | ||
KillSignal = "SIGINT"; | ||
Restart = "on-failure"; | ||
LogsDirectory = "leap"; | ||
}; | ||
}; | ||
|
||
environment.systemPackages = [ | ||
cfg.servicePackage | ||
cfg.layerPackage | ||
]; | ||
environment.pathsToLink = [ "/share/openxr" ]; | ||
|
||
users.users.leap = { | ||
isSystemUser = true; | ||
group = "leap"; | ||
# udev rules from -service grant access to plugdev | ||
extraGroups = [ "plugdev" ]; | ||
}; | ||
users.groups.leap = { }; | ||
}; | ||
|
||
meta.maintainers = with lib.maintainers; [ | ||
Scrumplex | ||
pandapip1 | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
autoPatchelfHook, | ||
dpkg, | ||
fetchurl, | ||
lib, | ||
stdenv, | ||
systemdLibs, | ||
ultraleap-hand-tracking-service, | ||
}: | ||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "openxr-layer-ultraleap"; | ||
version = "1.6.5+2486adf9.CI1130164"; | ||
|
||
src = fetchurl { | ||
url = "https://repo.ultraleap.com/apt/pool/main/o/openxr-layer-ultraleap/openxr-layer-ultraleap_1.6.5%2B2486adf9.CI1130164_amd64.deb"; | ||
hash = "sha256-OWPJCk55DNnuA8kUmzqG0FIChSnbwBQhWRBUripM7Yo="; | ||
}; | ||
|
||
Scrumplex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
nativeBuildInputs = [ | ||
autoPatchelfHook | ||
dpkg | ||
]; | ||
|
||
buildInputs = [ | ||
stdenv.cc.cc | ||
systemdLibs | ||
ultraleap-hand-tracking-service | ||
]; | ||
|
||
strictDeps = true; | ||
|
||
dontBuild = true; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
install -d "$out/lib" | ||
cp -Tr "usr/lib/openxr-layer-ultraleap" "$out/lib" | ||
|
||
install -d "$out/share/doc" | ||
cp -Tr "usr/share/doc" "$out/share/doc" | ||
|
||
local layer_path="share/openxr/1/api_layers/implicit.d/XrApiLayer_Ultraleap.json" | ||
install -Dm644 "usr/$layer_path" "$out/$layer_path" | ||
substituteInPlace "$out/$layer_path" \ | ||
--replace-fail \ | ||
"/usr/lib/openxr-layer-ultraleap/libUltraleapHandTracking.so.1.6.5.0" \ | ||
"$out/lib/libUltraleapHandTracking.so.1.6.5.0" | ||
|
||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "Ultraleap Hand Tracking OpenXR layer"; | ||
license = lib.licenses.unfree; | ||
platforms = [ "x86_64-linux" ]; | ||
maintainers = with lib.maintainers; [ | ||
Scrumplex | ||
pandapip1 | ||
]; | ||
}; | ||
}) |
101 changes: 101 additions & 0 deletions
101
pkgs/by-name/ul/ultraleap-hand-tracking-control-panel/package.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
addDriverRunpath, | ||
autoPatchelfHook, | ||
dbus, | ||
dpkg, | ||
fetchurl, | ||
lib, | ||
libGL, | ||
libxkbcommon, | ||
makeBinaryWrapper, | ||
stdenv, | ||
udev, | ||
ultraleap-hand-tracking-service, | ||
vulkan-loader, | ||
wayland, | ||
xorg, | ||
zlib, | ||
}: | ||
stdenv.mkDerivation { | ||
Scrumplex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pname = "ultraleap-hand-tracking-control-panel"; | ||
version = "3.4.1"; | ||
|
||
src = fetchurl { | ||
url = "https://repo.ultraleap.com/apt/pool/main/u/ultraleap-hand-tracking-control-panel/ultraleap-hand-tracking-control-panel_1125862.deb"; | ||
hash = "sha256-Pli0ENEtzBQGvfo2nIf09b62Xt3gzML/QYXMwtrD+7Y="; | ||
}; | ||
|
||
Scrumplex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
nativeBuildInputs = [ | ||
autoPatchelfHook | ||
dpkg | ||
makeBinaryWrapper | ||
]; | ||
|
||
buildInputs = [ | ||
dbus | ||
libGL | ||
getchoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libxkbcommon | ||
stdenv.cc.cc | ||
udev | ||
ultraleap-hand-tracking-service | ||
vulkan-loader | ||
wayland | ||
xorg.libX11 | ||
xorg.libXScrnSaver | ||
xorg.libXcursor | ||
xorg.libXext | ||
xorg.libXi | ||
xorg.libXinerama | ||
xorg.libXrandr | ||
xorg.libXxf86vm | ||
zlib | ||
]; | ||
|
||
strictDeps = true; | ||
|
||
dontBuild = true; | ||
|
||
runtimeDependencies = [ | ||
"libGL.so.1" | ||
"libLeapC.so" | ||
"libX11.so.6" | ||
"libXcursor.so.1" | ||
"libXext.so.6" | ||
"libXi.so.6" | ||
"libXinerama.so.1" | ||
"libXrandr.so.2" | ||
"libXss.so.1" | ||
"libXxf86vm.so.1" | ||
"libdbus-1.so.3" | ||
"libudev.so.1" | ||
"libvulkan.so.1" | ||
"libwayland-client.so.0" | ||
"libwayland-cursor.so.0" | ||
"libwayland-egl.so.1" | ||
"libxkbcommon.so.0" | ||
]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
mkdir -p $out/bin $out/share $out/opt | ||
cp -Tr usr/share $out/share | ||
cp -Tr opt $out/opt | ||
|
||
makeWrapper $out/opt/ultraleap-hand-tracking-control-panel/ultraleap-hand-tracking-control-panel $out/bin/ultraleap-hand-tracking-control-panel \ | ||
--prefix LD_LIBRARY_PATH : "${addDriverRunpath.driverLink}/lib" | ||
|
||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "Ultraleap Hand Tracking control panel"; | ||
license = lib.licenses.unfree; | ||
platforms = [ "x86_64-linux" ]; | ||
maintainers = with lib.maintainers; [ | ||
Scrumplex | ||
pandapip1 | ||
]; | ||
mainProgram = "ultraleap-hand-tracking-control-panel"; | ||
}; | ||
} |
42 changes: 42 additions & 0 deletions
42
pkgs/by-name/ul/ultraleap-hand-tracking-service/fix-cmake-paths.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets-release.cmake b/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets-release.cmake | ||
index be4fe4e..f3f5bba 100644 | ||
--- a/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets-release.cmake | ||
+++ b/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets-release.cmake | ||
@@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1) | ||
# Import target "LeapSDK::LeapC" for configuration "release" | ||
set_property(TARGET LeapSDK::LeapC APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) | ||
set_target_properties(LeapSDK::LeapC PROPERTIES | ||
- IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/ultraleap-hand-tracking-service/libLeapC.so.5" | ||
+ IMPORTED_LOCATION_RELEASE "@out@/lib/libLeapC.so.5" | ||
IMPORTED_SONAME_RELEASE "libLeapC.so.5" | ||
) | ||
|
||
list(APPEND _IMPORT_CHECK_TARGETS LeapSDK::LeapC ) | ||
-list(APPEND _IMPORT_CHECK_FILES_FOR_LeapSDK::LeapC "${_IMPORT_PREFIX}/lib/ultraleap-hand-tracking-service/libLeapC.so.5" ) | ||
+list(APPEND _IMPORT_CHECK_FILES_FOR_LeapSDK::LeapC "@out@/lib/libLeapC.so.5" ) | ||
|
||
# Commands beyond this point should not need to know the version. | ||
set(CMAKE_IMPORT_FILE_VERSION) | ||
diff --git a/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets.cmake b/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets.cmake | ||
index 7a30c2e..38e335c 100644 | ||
--- a/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets.cmake | ||
+++ b/usr/lib/ultraleap-hand-tracking-service/cmake/LeapCTargets.cmake | ||
@@ -54,7 +54,7 @@ endif() | ||
add_library(LeapSDK::LeapC SHARED IMPORTED) | ||
|
||
set_target_properties(LeapSDK::LeapC PROPERTIES | ||
- INTERFACE_INCLUDE_DIRECTORIES "/usr/include" | ||
+ INTERFACE_INCLUDE_DIRECTORIES "@dev@/include" | ||
INTERFACE_LINK_LIBRARIES "atomic" | ||
) | ||
|
||
diff --git a/usr/lib/x86_64-linux-gnu/cmake/LeapSDK/leapsdk-config.cmake b/usr/lib/x86_64-linux-gnu/cmake/LeapSDK/leapsdk-config.cmake | ||
index f74639b..c46805d 100644 | ||
--- a/usr/lib/x86_64-linux-gnu/cmake/LeapSDK/leapsdk-config.cmake | ||
+++ b/usr/lib/x86_64-linux-gnu/cmake/LeapSDK/leapsdk-config.cmake | ||
@@ -12,4 +12,4 @@ if(IS_DIRECTORY ${PACKAGE_PREFIX_DIR}/lib/x64 OR | ||
set(_arch_folder x64) | ||
endif() | ||
|
||
-include(/usr/lib/ultraleap-hand-tracking-service//${_arch_folder}/cmake/LeapCTargets.cmake) | ||
+include(@dev@/lib/cmake/LeapCTargets.cmake) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to use
stdenvNoCC
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already pulling in
stdenv.cc.cc
in buildInputs, so we wouldn't really gain anything from usingstdenvNoCC
here.