Skip to content

[Merged by Bors] - Update and simplify NixOS documentation#1495

Closed
turboMaCk wants to merge 1 commit intobevyengine:mainfrom
turboMaCk:main
Closed

[Merged by Bors] - Update and simplify NixOS documentation#1495
turboMaCk wants to merge 1 commit intobevyengine:mainfrom
turboMaCk:main

Conversation

@turboMaCk
Copy link
Contributor

Some updates and simplifications to the NixOS specific part of documentation.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation C-Dependencies A change to the crates that Bevy depends on S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Feb 21, 2021
Comment on lines 62 to 82
`nix-shell -p cargo pkgconfig udev alsaLib x11 xorg.libXcursor xorg.libXrandr xorg.libXi vulkan-tools lutris vulkan-headers vulkan-loader vulkan-validation-layers`

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`.
Alternatively, you can define `shell.nix` and enther it by running `nix-shell`.

```nix
# shell.nix
$ cat > shell.nix <<EOF

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
with 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
cargo
pkgconfig udev alsaLib
x11 xorg.libXcursor xorg.libXrandr xorg.libXi
vulkan-tools lutris vulkan-headers vulkan-loader vulkan-validation-layers
];
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here cargo and udev were added. NixOS is all about having explicit dependencies so assuming there is no global installation of cargo and udev seems to be more natural. I also shrieked related stuff into single lines so we don't take so excessive amount of lines within this document.

Comment on lines -89 to -92
1. `find target -type f -name glslang_validator` in order to find glslang_validator in `target/debug/build/bevy-glsl-to-spirv-<hash>/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))"`.
2. Running `ldd $OUT_DIR/glslang_validator` may show `libstdc++.so.6` is not found. If all dependencies are found, then bevy should work. If not, install (globally or in nix-shell) any of the results found by `nix-locate -w libstdc++.so.6`. For example purposes, consider `nixos.gcc-unwrapped`. In theory, any of the ones in `find -L /nix/store -type f -name libstdc++.so.6` will work.
3. `patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath /nix/store/784rh7jrfhagbkydjfrv68h9x3g4gqmk-gcc-8.3.0-lib/lib $OUT_DIR/glslang_validator`
4. Bevy should now be working correctly!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are no longer needed

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, just a few small thoughts.

Please also look at the CI results for markdownlint, and fix those issues.

Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@cart
Copy link
Member

cart commented Mar 3, 2021

I've never used NixOS, so I'll just defer to others here 😄

@cart
Copy link
Member

cart commented Mar 3, 2021

bors r+

bors bot pushed a commit that referenced this pull request Mar 3, 2021
Some updates and simplifications to the NixOS specific part of documentation.
@bors
Copy link
Contributor

bors bot commented Mar 3, 2021

@bors bors bot changed the title Update and simplify NixOS documentation [Merged by Bors] - Update and simplify NixOS documentation Mar 3, 2021
@bors bors bot closed this Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Dependencies A change to the crates that Bevy depends on C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants