From f76378b76c12243f4440b502ee62376b6ea7c4c5 Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 14 Sep 2020 16:11:55 -0400 Subject: [PATCH 1/2] Create shell.nix --- shell.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000000..b5d09627347d7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{ pkgs ? import { } }: + +pkgs.mkShell { + buildInputs = [ + pkgs.alsaLib + pkgs.lutris + pkgs.pkgconfig + pkgs.vulkan-headers + pkgs.vulkan-loader + pkgs.vulkan-tools + pkgs.vulkan-validation-layers + pkgs.x11 + pkgs.xorg.libXcursor + pkgs.xorg.libXi + pkgs.xorg.libXrandr + ]; +} From aabc5ecfb4635b4d203cd0d0792a19b4cf8b142e Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 14 Sep 2020 17:31:35 -0400 Subject: [PATCH 2/2] Embed shell.nix into docs/linux_dependencies.md --- docs/linux_dependencies.md | 25 +++++++++++++++++++++++++ shell.nix | 17 ----------------- 2 files changed, 25 insertions(+), 17 deletions(-) delete mode 100644 shell.nix diff --git a/docs/linux_dependencies.md b/docs/linux_dependencies.md index 2b39104236c82..a60752a961d23 100644 --- a/docs/linux_dependencies.md +++ b/docs/linux_dependencies.md @@ -40,6 +40,31 @@ The following packages are known to provide the dependencies required to run a b `nix-shell -p pkgconfig x11 xorg.libXcursor xorg.libXrandr xorg.libXi vulkan-tools lutris vulkan-headers vulkan-loader vulkan-validation-layers alsaLib` +Alternatively, you can copy the following code block and create a file called `shell.nix`. You can now enter nix-shell just by running `nix-shell`. + +```nix +# shell.nix + +{ pkgs ? import { } }: + +pkgs.mkShell { + buildInputs = [ + pkgs.alsaLib + pkgs.lutris + pkgs.pkgconfig + pkgs.vulkan-headers + pkgs.vulkan-loader + pkgs.vulkan-tools + pkgs.vulkan-validation-layers + pkgs.x11 + pkgs.xorg.libXcursor + pkgs.xorg.libXi + pkgs.xorg.libXrandr + ]; +} + +``` + At this point, projects should successfully compile but fail on execution. This is due to `glslang_validator` which, unfortunately, needs to have it's binary patched to link correctly. This is a known issue and there are plans to remove this dependency. 1. `find target -type f -name glslang_validator` in order to find glslang_validator in `target/debug/build/bevy-glsl-to-spirv-/out/glslang_validator`. The directory containing glslang_validator will be referenced again, so save it for later: `export OUT_DIR="$(dirname $(find target -type f -name glslang_validator))"`. diff --git a/shell.nix b/shell.nix deleted file mode 100644 index b5d09627347d7..0000000000000 --- a/shell.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs ? import { } }: - -pkgs.mkShell { - buildInputs = [ - pkgs.alsaLib - pkgs.lutris - pkgs.pkgconfig - pkgs.vulkan-headers - pkgs.vulkan-loader - pkgs.vulkan-tools - pkgs.vulkan-validation-layers - pkgs.x11 - pkgs.xorg.libXcursor - pkgs.xorg.libXi - pkgs.xorg.libXrandr - ]; -}