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

View File

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

98
flake.lock generated
View File

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

View File

@@ -22,15 +22,15 @@ rustPlatform.buildRustPackage rec {
};
CPM_SOURCE_CACHE = "./build";
postPatch = ''
sk=$(echo $cargoDepsCopy/stereokit-sys-*/StereoKit)
sk=$(echo $cargoDepsCopy/stereokit-rust-*/StereoKit)
mkdir -p $sk/build/cpm
# 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
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 = [
cmake pkg-config llvmPackages.libcxxClang
cmake cpm-cmake pkg-config llvmPackages.libcxxClang
];
buildInputs = [
openxr-loader libGL mesa xorg.libX11 fontconfig libxkbcommon

View File

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

View File

@@ -56,7 +56,7 @@ impl SkController {
)?);
let model_nodes = model.get_nodes();
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);
let tip = InputDataType::Tip(Tip::default());
let input = InputMethod::add_to(