From 499aa2be28be546287bf228e8edc3643b09e4016 Mon Sep 17 00:00:00 2001 From: Nova Date: Wed, 21 Aug 2024 00:49:11 -0400 Subject: [PATCH] fix(nix): FINALLY --- Cargo.lock | 4 ++-- Cargo.toml | 26 +++++++++++++------------- nix/sk_gpu.nix | 4 ++-- nix/stardust-xr-server.nix | 36 ++++++++++++++++++++++++++---------- 4 files changed, 43 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7643fc5..780791b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2528,12 +2528,12 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stereokit-macros" version = "0.1.0" -source = "git+https://github.com/mvvvv/StereoKit-rust.git#2bfa9a812422a2b5b98db9979b5a4cc28cea151e" +source = "git+https://github.com/technobaboo/StereoKit-rust.git#93829181d5eea954e15dba9d9bfb0ec62e98d400" [[package]] name = "stereokit-rust" version = "0.1.0" -source = "git+https://github.com/mvvvv/StereoKit-rust.git#2bfa9a812422a2b5b98db9979b5a4cc28cea151e" +source = "git+https://github.com/technobaboo/StereoKit-rust.git#93829181d5eea954e15dba9d9bfb0ec62e98d400" dependencies = [ "android-activity", "android_logger", diff --git a/Cargo.toml b/Cargo.toml index 1855a9b..2a09525 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,16 +21,17 @@ default = ["wayland"] wayland = ["dep:smithay"] profile_tokio = ["dep:console-subscriber", "tokio/tracing"] profile_app = ["dep:tracing-tracy"] +local_deps = ["stereokit-rust/force-local-deps"] [package.metadata.appimage] auto_link = true auto_link_exclude_list = [ - "libc*", - "libdl*", - "libpthread*", - "ld-linux*", - "libGL*", - "libEGL*", + "libc*", + "libdl*", + "libpthread*", + "ld-linux*", + "libGL*", + "libEGL*", ] [profile.dev.package."*"] @@ -97,20 +98,19 @@ git = "https://github.com/smithay/smithay.git" # path = "../smithay" default-features = false features = [ - "desktop", - "backend_drm", - "backend_egl", - "renderer_gl", - "wayland_frontend", + "desktop", + "backend_drm", + "backend_egl", + "renderer_gl", + "wayland_frontend", ] optional = true [dependencies.stereokit-rust] # path = "../StereoKit-rust" # git = "https://github.com/mvvvv/StereoKit-rust.git" -# features = ["no-event-loop"] git = "https://github.com/technobaboo/StereoKit-rust.git" -# features = ["force-local-deps"] +features = ["no-event-loop"] default-features = false [dependencies.stardust-xr] diff --git a/nix/sk_gpu.nix b/nix/sk_gpu.nix index 74ff777..8ca967e 100644 --- a/nix/sk_gpu.nix +++ b/nix/sk_gpu.nix @@ -3,8 +3,8 @@ let sk_gpu_zip = fetchurl { url = - "https://github.com/StereoKit/sk_gpu/releases/download/v2024.8.12/sk_gpu.v2024.8.12.zip"; - sha256 = "sha256-NPjOFzu7AlpQKJ8PZYeUuegrR6TXtRyg+Hm2BxIAMLI="; + "https://github.com/StereoKit/sk_gpu/releases/download/v2024.8.16/sk_gpu.v2024.8.16.zip"; + sha256 = "sha256-Wk3PZFlWqhrsQ8xG0sQaV2xSasdg2D7TMiPvl/CgtGU="; }; in stdenv.mkDerivation rec { name = "sk_gpu"; diff --git a/nix/stardust-xr-server.nix b/nix/stardust-xr-server.nix index cd69132..f31975c 100644 --- a/nix/stardust-xr-server.nix +++ b/nix/stardust-xr-server.nix @@ -1,6 +1,26 @@ -{ rustPlatform, src, name, libGL, mesa, xorg, fontconfig, libxkbcommon, libclang -, cmake, cpm-cmake, pkg-config, llvmPackages, fetchFromGitHub, sk_gpu, libXau -, libXdmcp, stdenv, lib }: +{ rustPlatform +, src +, name +, libGL +, mesa +, xorg +, fontconfig +, libxkbcommon +, libclang + +, cmake +, cpm-cmake +, pkg-config +, llvmPackages +, fetchFromGitHub +, sk_gpu +, libXau + +, libXdmcp +, stdenv +, lib +, openxr-loader +}: rustPlatform.buildRustPackage rec { inherit src name; @@ -8,18 +28,13 @@ rustPlatform.buildRustPackage rec { lockFile = (src + "/Cargo.lock"); allowBuiltinFetchGit = true; }; + buildFeatures = [ "local_deps" ]; FORCE_LOCAL_DEPS = true; CPM_LOCAL_PACKAGES_ONLY = true; CPM_SOURCE_CACHE = "./build"; CPM_USE_LOCAL_PACKAGES = true; CPM_DOWNLOAD_ALL = false; - openxr_loader = fetchFromGitHub { - owner = "KhronosGroup"; - repo = "OpenXR-SDK"; - rev = "288d3a7ebc1ad959f62d51da75baa3d27438c499"; - sha256 = "sha256-RdmnBe26hqPmqwCHIJolF6bSmZRmIKVlGF+TXAY35ig="; - }; meshoptimizer = fetchFromGitHub { owner = "zeux"; repo = "meshoptimizer"; @@ -33,9 +48,9 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-zBRAXgG5Fi6+5uPQCI/RCGatY6O4ELuYBoKrPNn4K+8="; }; - DEP_OPENXR_LOADER_SOURCE = "${openxr_loader}"; DEP_MESHOPTIMIZER_SOURCE = "${meshoptimizer}"; DEP_BASIS_UNIVERSAL_SOURCE = "${basis_universal}"; + DEP_SK_GPU_SOURCE = "${sk_gpu}"; postPatch = let libPath = lib.makeLibraryPath [ stdenv.cc.cc.lib ]; in '' @@ -65,6 +80,7 @@ rustPlatform.buildRustPackage rec { libxkbcommon libXau libXdmcp + openxr-loader ]; LIBCLANG_PATH = "${libclang.lib}/lib"; }