fixup the shell so that binaries can be run as expected under it
This commit is contained in:
33
flake.nix
33
flake.nix
@@ -21,7 +21,14 @@
|
|||||||
# docs: https://github.com/oxalica/rust-overlay
|
# docs: https://github.com/oxalica/rust-overlay
|
||||||
coremem-wavefront = pkgs.rustPlatform.buildRustPackage {
|
coremem-wavefront = pkgs.rustPlatform.buildRustPackage {
|
||||||
name = "coremem-wavefront";
|
name = "coremem-wavefront";
|
||||||
nativeBuildInputs = [ rust-toolchain ];
|
# buildInputs = [ pkgs.vulkan-loader ];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
pkgconfig
|
||||||
|
mesa
|
||||||
|
xlibsWrapper xorg.libXcursor xorg.libXrandr xorg.libXi
|
||||||
|
vulkan-tools vulkan-headers vulkan-loader vulkan-validation-layers
|
||||||
|
];
|
||||||
|
nativeBuildInputs = [ rust-toolchain pkgs.pkgconfig pkgs.mesa pkgs.vulkan-loader ];
|
||||||
src = self;
|
src = self;
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
@@ -32,18 +39,38 @@
|
|||||||
# rgpu tests expectedly fail due to a lack of spirv adapter exposed to the builder.
|
# rgpu tests expectedly fail due to a lack of spirv adapter exposed to the builder.
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
hardeningDisable = [ "fortify" ];
|
||||||
|
|
||||||
# i guess the proper fix for this is to split rustc_codegen_spirv into its own
|
# i guess the proper fix for this is to split rustc_codegen_spirv into its own
|
||||||
# package (see how we're also special-casing it in cargoLock), but this suffices too.
|
# package (see how we're also special-casing it in cargoLock), but this suffices too.
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
cp $releaseDir/deps/librustc_codegen_spirv-*.so $out/lib/
|
cp $releaseDir/deps/librustc_codegen_spirv-*.so $out/lib/
|
||||||
'';
|
'';
|
||||||
|
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath [ pkgs.vulkan-loader ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
defaultPackage = packages.coremem-wavefront;
|
defaultPackage = packages.coremem-wavefront;
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = with pkgs; mkShell {
|
||||||
|
# buildInputs = with pkgs; [
|
||||||
|
# rust-toolchain vulkan-loader
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# hardeningDisable = [ "fortify" ];
|
||||||
|
|
||||||
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/60919.
|
||||||
|
hardeningDisable = [ "fortify" ];
|
||||||
|
|
||||||
|
# Allow cargo to download crates.
|
||||||
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
rust-toolchain
|
pkgconfig rustup xlibsWrapper libxkbcommon
|
||||||
|
];
|
||||||
|
|
||||||
|
# Runtime dependencies.
|
||||||
|
LD_LIBRARY_PATH = with xorg; lib.makeLibraryPath [
|
||||||
|
libX11 libXcursor libXi libXrandr vulkan-loader
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user