slimevr: 18.2.0 -> 20.1.0 (#511205)
This commit is contained in:
Generated
+407
-436
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
diff --git a/gui/public/i18n/en/translation.ftl b/gui/public/i18n/en/translation.ftl
|
||||
index fd804a0e..35762e45 100644
|
||||
--- a/gui/public/i18n/en/translation.ftl
|
||||
+++ b/gui/public/i18n/en/translation.ftl
|
||||
@@ -1034,7 +1034,7 @@ onboarding-reset_tutorial-2 = Tap the highlighted tracker { $taps } times to tri
|
||||
|
||||
## Install info
|
||||
install-info_udev-rules_modal_title = Hardware udev access rules not found
|
||||
-install-info_udev-rules_warning = Access rules via udev are required for serial console access & dongle connection. Paste the following command into your terminal to add the udev rules.
|
||||
+install-info_udev-rules_warning = Access rules via udev are required for serial console access & dongle connection. Add the following to your NixOS config to install the udev rules.
|
||||
install-info_udev-rules_modal_button = Close
|
||||
install-info_udev-rules_modal-dont-show-again_checkbox = Don't show again
|
||||
## Setup start
|
||||
diff --git a/gui/src/components/onboarding/UdevRulesModal.tsx b/gui/src/components/onboarding/UdevRulesModal.tsx
|
||||
index b89af1e7..00955544 100644
|
||||
--- a/gui/src/components/onboarding/UdevRulesModal.tsx
|
||||
+++ b/gui/src/components/onboarding/UdevRulesModal.tsx
|
||||
@@ -25,7 +25,7 @@ export function UdevRulesModal() {
|
||||
const dir = await electron.api.getInstallDir();
|
||||
const rulesPath = `${dir}/69-slimevr-devices.rules`;
|
||||
setUdevContent(
|
||||
- `cat ${rulesPath} | sudo sh -c 'tee /etc/udev/rules.d/69-slimevr-devices.rules >/dev/null && udevadm control --reload-rules && udevadm trigger'`
|
||||
+ `{\n services.udev.packages = [ pkgs.slimevr ];\n}`
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
diff --git a/gui/src-tauri/src/main.rs b/gui/src-tauri/src/main.rs
|
||||
index 8191f0ed..01e764d8 100644
|
||||
--- a/gui/src-tauri/src/main.rs
|
||||
+++ b/gui/src-tauri/src/main.rs
|
||||
@@ -188,7 +188,7 @@ fn setup_webview2() -> Result<()> {
|
||||
diff --git a/gui/electron/main/index.ts b/gui/electron/main/index.ts
|
||||
index 0210e5eb..a52bbb5b 100644
|
||||
--- a/gui/electron/main/index.ts
|
||||
+++ b/gui/electron/main/index.ts
|
||||
@@ -361,7 +361,7 @@ function createWindow() {
|
||||
}
|
||||
|
||||
fn check_environment_variables() {
|
||||
use itertools::Itertools;
|
||||
- const ENVS_TO_CHECK: &[&str] = &["_JAVA_OPTIONS", "JAVA_TOOL_OPTIONS"];
|
||||
+ const ENVS_TO_CHECK: &[&str] = &["_JAVA_OPTIONS"];
|
||||
let checked_envs = ENVS_TO_CHECK
|
||||
.into_iter()
|
||||
.filter_map(|e| {
|
||||
const checkEnvironmentVariables = () => {
|
||||
- const to_check = ['_JAVA_OPTIONS', 'JAVA_TOOL_OPTIONS'];
|
||||
+ const to_check = ['_JAVA_OPTIONS'];
|
||||
|
||||
const set = to_check.filter((env) => !!process.env[env]);
|
||||
if (set.length > 0) {
|
||||
|
||||
@@ -1,74 +1,40 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchPnpmDeps,
|
||||
replaceVars,
|
||||
nodejs,
|
||||
pnpmConfigHook,
|
||||
pnpm_9,
|
||||
electron,
|
||||
makeWrapper,
|
||||
slimevr-server,
|
||||
nodejs,
|
||||
pnpm_9,
|
||||
fetchPnpmDeps,
|
||||
pnpmConfigHook,
|
||||
rustPlatform,
|
||||
cargo-tauri,
|
||||
wrapGAppsHook3,
|
||||
pkg-config,
|
||||
openssl,
|
||||
glib-networking,
|
||||
webkitgtk_4_1,
|
||||
gst_all_1,
|
||||
libayatana-appindicator,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
udevCheckHook,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "slimevr";
|
||||
version = "18.2.0";
|
||||
version = "20.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "SlimeVR";
|
||||
repo = "SlimeVR-Server";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-7QU+xQ72t722DOhrurI1XXpILLNnk8lE0yrD1P5XJbA=";
|
||||
hash = "sha256-8ti1uyDtgf9JuWurAkE0Twj3/ROOd9ai94htEvoVo50=";
|
||||
# solarxr
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
buildAndTestSubdir = "gui/src-tauri";
|
||||
|
||||
cargoHash = "sha256-X5IgWZlkvsstMN3YS4r+NJl6RVfREfZqKUrfsrUPQuU=";
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
pname = "${finalAttrs.pname}-pnpm-deps";
|
||||
inherit (finalAttrs) version src;
|
||||
pnpm = pnpm_9;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-deVfRZcMFkOVWXmNUiixmd5WBfIFKxG2Gw3CfshspYo=";
|
||||
hash = "sha256-gGBwE6QxJsbVmQc1e390SSXAjs/T992ju8y9wz1H1QQ=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpmConfigHook
|
||||
pnpm_9
|
||||
cargo-tauri.hook
|
||||
pkg-config
|
||||
wrapGAppsHook3
|
||||
makeWrapper
|
||||
udevCheckHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-bad
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
glib-networking
|
||||
libayatana-appindicator
|
||||
webkitgtk_4_1
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Upstream code uses Git to find the program version.
|
||||
(replaceVars ./gui-no-git.patch {
|
||||
@@ -76,20 +42,20 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
})
|
||||
# By default, SlimeVR will give a big warning about our `JAVA_TOOL_OPTIONS` changes.
|
||||
./no-java-tool-options-warning.patch
|
||||
# Correct udev instructions for NixOS.
|
||||
./nixos-udev-instructions.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# Tauri bundler expects slimevr.jar to exist.
|
||||
mkdir -p server/desktop/build/libs
|
||||
touch server/desktop/build/libs/slimevr.jar
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
# Both libappindicator-rs and SlimeVR need to know where Nix's appindicator lib is.
|
||||
substituteInPlace $cargoDepsCopy/*/libappindicator-sys-*/src/lib.rs \
|
||||
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||
substituteInPlace gui/src-tauri/src/tray.rs \
|
||||
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||
'';
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpmConfigHook
|
||||
pnpm_9
|
||||
makeWrapper
|
||||
copyDesktopItems
|
||||
udevCheckHook
|
||||
];
|
||||
|
||||
# solarxr needs to be installed after compiling its Typescript files. This isn't
|
||||
# done the first time, because `pnpmConfigHook` ignores `package.json` scripts.
|
||||
@@ -100,23 +66,62 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
doCheck = false; # No tests
|
||||
doInstallCheck = true; # Check udev
|
||||
|
||||
# Get rid of placeholder slimevr.jar
|
||||
postInstall = ''
|
||||
rm $out/share/slimevr/slimevr.jar
|
||||
rm -d $out/share/slimevr
|
||||
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||
|
||||
install -Dm644 -t $out/lib/udev/rules.d/ gui/src-tauri/69-slimevr-devices.rules
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pushd gui
|
||||
pnpm build
|
||||
pnpm exec electron-builder \
|
||||
--dir \
|
||||
-c.electronDist=${electron.dist} \
|
||||
-c.electronVersion=${electron.version}
|
||||
popd
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
# `JAVA_HOME`, `JAVA_TOOL_OPTIONS`, and `--launch-from-path` are so the GUI can
|
||||
# launch the server.
|
||||
postFixup = ''
|
||||
wrapProgram "$out/bin/slimevr" \
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/slimevr
|
||||
cp -r gui/dist/artifacts/*/*-unpacked/{locales,resources{,.pak}} $out/share/slimevr/
|
||||
# `JAVA_HOME`, `JAVA_TOOL_OPTIONS`, and `--path` are so the GUI can
|
||||
# launch the server.
|
||||
makeWrapper ${lib.getExe electron} $out/bin/slimevr \
|
||||
--add-flags $out/share/slimevr/resources/app.asar \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true --wayland-text-input-version=3}}" \
|
||||
--set JAVA_HOME "${slimevr-server.passthru.java.home}" \
|
||||
--set JAVA_TOOL_OPTIONS "${slimevr-server.passthru.javaOptions}" \
|
||||
--add-flags "--launch-from-path ${slimevr-server}/share/slimevr"
|
||||
--add-flags "--path ${slimevr-server}/share/slimevr" \
|
||||
--inherit-argv0
|
||||
|
||||
install -Dm444 gui/electron/resources/icons/icon.png $out/share/icons/hicolor/512x512/apps/slimevr.png
|
||||
install -Dm644 -t $out/lib/udev/rules.d/ gui/electron/resources/69-slimevr-devices.rules
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "slimevr";
|
||||
desktopName = "SlimeVR";
|
||||
genericName = "Full-body tracking";
|
||||
comment = finalAttrs.meta.description;
|
||||
categories = [ "Game" ];
|
||||
keywords = [
|
||||
"FBT"
|
||||
"VR"
|
||||
"Steam"
|
||||
"VRChat"
|
||||
"IMU"
|
||||
];
|
||||
icon = "slimevr";
|
||||
exec = "slimevr";
|
||||
})
|
||||
];
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
|
||||
Reference in New Issue
Block a user