Skip to content

Commit

Permalink
Merge pull request #206 from nix-community/pkgs/index_camera_passthro…
Browse files Browse the repository at this point in the history
…ugh/drop-fenix
  • Loading branch information
Scrumplex committed Sep 6, 2024
2 parents aad42d5 + 22c4b6e commit 4cb5e88
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 65 deletions.
40 changes: 0 additions & 40 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
fenix = {
url = "github:nix-community/fenix/73124e1356bde9411b163d636b39fe4804b7ca45";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand Down
1 change: 0 additions & 1 deletion parts/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ let
index_camera_passthrough = {
drv = ../pkgs/index_camera_passthrough;
drvArgs = source: {
inherit (inputs) fenix;
cargoLock = source.cargoLock."Cargo.lock";
};
};
Expand Down
32 changes: 12 additions & 20 deletions pkgs/index_camera_passthrough/default.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
# SPDX-FileCopyrightText: 2023 Sefa Eyeoglu <[email protected]>
# SPDX-FileCopyrightText: 2024 Sefa Eyeoglu <[email protected]>
#
# SPDX-License-Identifier: MIT
{
cmake,
lib,
system,
makeRustPlatform,
openxr-loader,
pkg-config,
rustPlatform,
shaderc,
udev,
vulkan-loader,
openvr,
openxr-loader,
shaderc,
cmake,
# nixpkgs-xr:
fenix,
cargoLock,
}:
let
toolchain = fenix.packages.${system}.minimal.toolchain;
rustPlatform = makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
in
rustPlatform.buildRustPackage {
pname = "index-camera-passthrough";
version = "0";

postPatch = ''
substituteInPlace Cargo.toml \
--replace 'openxr = "0.17.1"' 'openxr = { version = "0.17.1", features = ["linked"] }'
'';

# src will be added by the source override
inherit cargoLock;

Expand All @@ -44,10 +30,16 @@ rustPlatform.buildRustPackage {
buildInputs = [
udev
vulkan-loader
openvr
openxr-loader
];

postPatch = ''
substituteInPlace Cargo.toml \
--replace-fail \
'openxr = { version = "0.17.1", optional = true }' \
'openxr = { version = "0.17.1", optional = true, features = ["linked"] }'
'';

env.SHADERC_LIB_DIR = "${lib.getLib shaderc}/lib";

meta = with lib; {
Expand Down

0 comments on commit 4cb5e88

Please sign in to comment.