fix: upgrade stereokit-rust and attempt nix upgrade

This commit is contained in:
Nova
2024-08-07 14:36:19 -04:00
parent 14ebe85493
commit e0a7d4f44a
6 changed files with 64 additions and 87 deletions

39
Cargo.lock generated
View File

@@ -34,14 +34,13 @@ checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937"
[[package]] [[package]]
name = "android_logger" name = "android_logger"
version = "0.13.3" version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c494134f746c14dc653a35a4ea5aca24ac368529da5370ecf41fe0341c35772f" checksum = "05b07e8e73d720a1f2e4b6014766e6039fd2e96a4fa44e2a78d0e1fa2ff49826"
dependencies = [ dependencies = [
"android_log-sys", "android_log-sys",
"env_logger", "env_filter",
"log", "log",
"once_cell",
] ]
[[package]] [[package]]
@@ -828,10 +827,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "env_logger" name = "env_filter"
version = "0.10.2" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab"
dependencies = [ dependencies = [
"log", "log",
"regex", "regex",
@@ -1065,9 +1064,9 @@ dependencies = [
[[package]] [[package]]
name = "glam" name = "glam"
version = "0.27.0" version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94"
dependencies = [ dependencies = [
"mint", "mint",
"serde", "serde",
@@ -1359,7 +1358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.6", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@@ -1413,11 +1412,6 @@ dependencies = [
"tracing-subscriber", "tracing-subscriber",
] ]
[[package]]
name = "macros"
version = "0.1.0"
source = "git+https://github.com/technobaboo/StereoKit-rust.git#1182bd13fcfcd149c8e02c1c3e04f0db1e963a68"
[[package]] [[package]]
name = "manifest-dir-macros" name = "manifest-dir-macros"
version = "0.1.18" version = "0.1.18"
@@ -1665,7 +1659,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.72", "syn 2.0.72",
@@ -1688,9 +1682,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]] [[package]]
name = "openxr-sys" name = "openxr-sys"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1534b2c14b56564e58b91f5015817e1d87bd43ca12a188eda6a9ea3859b0ec25" checksum = "f10e7e38c47f2175fc39363713b656db899fa0b4a14341029702cbdfa6f44d05"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@@ -2452,10 +2446,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "stereokit-macros"
version = "0.1.0"
source = "git+https://github.com/technobaboo/StereoKit-rust.git#e6e3b15f173208d7a7564852b526d6323bac6f43"
[[package]] [[package]]
name = "stereokit-rust" name = "stereokit-rust"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/technobaboo/StereoKit-rust.git#1182bd13fcfcd149c8e02c1c3e04f0db1e963a68" source = "git+https://github.com/technobaboo/StereoKit-rust.git#e6e3b15f173208d7a7564852b526d6323bac6f43"
dependencies = [ dependencies = [
"android_logger", "android_logger",
"bitflags 2.6.0", "bitflags 2.6.0",
@@ -2463,11 +2462,11 @@ dependencies = [
"glam", "glam",
"jni", "jni",
"log", "log",
"macros",
"ndk", "ndk",
"ndk-context", "ndk-context",
"ndk-sys", "ndk-sys",
"openxr-sys", "openxr-sys",
"stereokit-macros",
"thiserror", "thiserror",
] ]

View File

@@ -71,7 +71,7 @@ serde_repr = "0.1.19"
toml = "0.8.14" toml = "0.8.14"
# mathy stuffs # mathy stuffs
glam = { version = "0.27.0", features = ["mint", "serde"] } glam = { version = "0.28.0", features = ["mint", "serde"] }
mint = "0.5.9" mint = "0.5.9"
tokio = { version = "1.38.0", features = ["rt-multi-thread", "signal", "time"] } tokio = { version = "1.38.0", features = ["rt-multi-thread", "signal", "time"] }
prisma = "0.1.1" prisma = "0.1.1"
@@ -104,6 +104,8 @@ features = [
optional = true optional = true
[dependencies.stereokit-rust] [dependencies.stereokit-rust]
# path = "../StereoKit-rust"
# git = "https://github.com/mvvvv/StereoKit-rust.git"
git = "https://github.com/technobaboo/StereoKit-rust.git" git = "https://github.com/technobaboo/StereoKit-rust.git"
default-features = false default-features = false

98
flake.lock generated
View File

@@ -1,24 +1,23 @@
{ {
"nodes": { "nodes": {
"fenix": { "crane": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"flatland", "flatland",
"nixpkgs" "nixpkgs"
], ]
"rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1700115779, "lastModified": 1712681629,
"narHash": "sha256-oajhxEBg+16/KH74CaygAQ6b5KUHS7DwBoL9ecD9qeI=", "narHash": "sha256-bMDXn4AkTXLCpoZbII6pDGoSeSe9gI87jxPsHRXgu/E=",
"owner": "nix-community", "owner": "ipetkov",
"repo": "fenix", "repo": "crane",
"rev": "4378e7e5f5bdef438eee5ce967f37593b9b5cd16", "rev": "220387ac8e99cbee0ca4c95b621c4bc782b6a235",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "ipetkov",
"repo": "fenix", "repo": "crane",
"type": "github" "type": "github"
} }
}, },
@@ -27,11 +26,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1709336216, "lastModified": 1722555600,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", "rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -48,11 +47,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701473968, "lastModified": 1712014858,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -62,15 +61,15 @@
}, },
"flatland": { "flatland": {
"inputs": { "inputs": {
"fenix": "fenix", "crane": "crane",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1709774755, "lastModified": 1713050562,
"narHash": "sha256-6tSG4G+SB+l71101XNyEHN/J8pSuJvbNPhKgzqP5sVU=", "narHash": "sha256-m7c6XpmpTM1URuqMG2KqtaWbL2Vt8vJFJtmvq123BmY=",
"owner": "StardustXR", "owner": "StardustXR",
"repo": "flatland", "repo": "flatland",
"rev": "fef8c317928a1d1798d8cee9af94d219a7c09e8c", "rev": "b3b0f29c4ea1b82c96cf9de507837bf15a5e4c0e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -85,11 +84,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1708547820, "lastModified": 1719226092,
"narHash": "sha256-xU/KC1PWqq5zL9dQ9wYhcdgxAwdeF/dJCLPH3PNZEBg=", "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "0ca27bd58e4d5be3135a4bef66b582e57abe8f4a", "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -100,11 +99,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1699781429, "lastModified": 1712791164,
"narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=", "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e44462d6021bfe23dfb24b775cc7c390844f773d", "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -116,29 +115,23 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"dir": "lib", "lastModified": 1722555339,
"lastModified": 1709237383, "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
"repo": "nixpkgs",
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
"type": "github"
}, },
"original": { "original": {
"dir": "lib", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1703637592, "lastModified": 1713714899,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=", "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8", "rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -150,11 +143,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1709479366, "lastModified": 1722813957,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -171,23 +164,6 @@
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
} }
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1700077026,
"narHash": "sha256-Vf7ykubXsriSjBbeYAm8bzBIvSOYVUmRiCQ3iLL/E+U=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "58de0b130a763f3a2d373f508ac0c18a8e7d0acd",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -22,15 +22,15 @@ rustPlatform.buildRustPackage rec {
}; };
CPM_SOURCE_CACHE = "./build"; CPM_SOURCE_CACHE = "./build";
postPatch = '' postPatch = ''
sk=$(echo $cargoDepsCopy/stereokit-sys-*/StereoKit) sk=$(echo $cargoDepsCopy/stereokit-rust-*/StereoKit)
mkdir -p $sk/build/cpm mkdir -p $sk/build/cpm
# This is not ideal, the original approach was to fetch the exact cmake # This is not ideal, the original approach was to fetch the exact cmake
# file version that was wanted from GitHub directly, but at least this way it comes from Nixpkgs.. so meh # file version that was wanted from GitHub directly, but at least this way it comes from Nixpkgs.. so meh
cp ${cpm-cmake}/share/cpm/CPM.cmake $sk/build/cpm/CPM_0.32.2.cmake cp ${cpm-cmake}/share/cpm/CPM.cmake $sk/build/cpm/CPM_0.38.7.cmake
''; '';
nativeBuildInputs = [ nativeBuildInputs = [
cmake pkg-config llvmPackages.libcxxClang cmake cpm-cmake pkg-config llvmPackages.libcxxClang
]; ];
buildInputs = [ buildInputs = [
openxr-loader libGL mesa xorg.libX11 fontconfig libxkbcommon openxr-loader libGL mesa xorg.libX11 fontconfig libxkbcommon

View File

@@ -82,7 +82,7 @@ pub struct ModelPart {
impl ModelPart { impl ModelPart {
fn create_for_model(model: &Arc<Model>, sk_model: &SKModel) { fn create_for_model(model: &Arc<Model>, sk_model: &SKModel) {
HOLDOUT_MATERIAL.get_or_init(|| { HOLDOUT_MATERIAL.get_or_init(|| {
let mut mat = Material::copy(Material::unlit()); let mut mat = Material::copy(&Material::unlit());
mat.transparency(Transparency::None); mat.transparency(Transparency::None);
mat.color_tint(Color128::BLACK_TRANSPARENT); mat.color_tint(Color128::BLACK_TRANSPARENT);
Arc::new(MaterialWrapper(mat)) Arc::new(MaterialWrapper(mat))

View File

@@ -56,7 +56,7 @@ impl SkController {
)?); )?);
let model_nodes = model.get_nodes(); let model_nodes = model.get_nodes();
let mut model_node = model_nodes.visuals().next().unwrap(); let mut model_node = model_nodes.visuals().next().unwrap();
let material = Material::copy(model_node.get_material().unwrap()); let material = Material::copy(&model_node.get_material().unwrap());
model_node.material(&material); model_node.material(&material);
let tip = InputDataType::Tip(Tip::default()); let tip = InputDataType::Tip(Tip::default());
let input = InputMethod::add_to( let input = InputMethod::add_to(