Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/lanes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Lanes is an original, turn-based homebrew game for Project TuxBox. Collect as ma
Use an x86-64 PC with Python 3.10 or newer, Rust 1.95 or newer with Cargo, and the DirectX Shader Compiler (`dxc`) on your PATH. Add the Windows build target once with `rustup target add x86_64-pc-windows-msvc`. [DirectX Shader Compiler releases](https://github.com/microsoft/DirectXShaderCompiler/releases)

- **Linux** needs `clang-cl`, `lld-link` and the Windows SDK and C runtime staged with xwin. To stage them in the cargo-xwin cache that `build.py` reads, run `cargo install cargo-xwin` and then `cargo xwin cache xwin --xwin-arch x86_64` once. If the SDK is outside the cargo-xwin cache, set `XWIN_SDK_ROOT` to the directory containing `sdk/` and `crt/`. The launcher builds a small Vulkan layer on first run, so also install the Vulkan headers (`vulkan-headers` on Arch). Use Microsoft's Linux DXC release: Arch's `directx-shader-compiler` 1.10.2605.37 aborts on every shader, and `build.py` reports this before building. Install UMU (`umu-run`, the `umu-launcher` package in the AUR on Arch) and [GE-Proton11-14](https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/GE-Proton11-14), extracted into Steam's `compatibilitytools.d`, to play. From the project folder, run `python3 -m venv .venv` and `source .venv/bin/activate` before installing the Python dependencies.
- **Nix** users can run `nix develop` (or `direnv allow`) for a shell with these Linux tools. The Windows SDK still needs `cargo xwin cache xwin --xwin-arch x86_64` once, and Proton Experimental comes from Steam. On NixOS, prefix the GPU checks with `tuxbox-fhs` (`tuxbox-fhs python tuxbox.py check ...`), which supplies the system libraries that Proton's Wine expects.
- **Nix** users can run `nix develop` (or `direnv allow`) for a shell with these Linux tools. The Windows SDK still needs `cargo xwin cache xwin --xwin-arch x86_64` once. The shell also provides GE-Proton11-14 and sets `PROTONPATH` to it, so the launcher uses it without a Steam install; pass `--proton "$PROTONPATH"` to `tuxbox.py check` for the GPU checks. On NixOS, prefix the GPU checks with `tuxbox-fhs` (`tuxbox-fhs python tuxbox.py check ...`), which supplies the system libraries that Proton's Wine expects.
- **Windows** needs Visual Studio Build Tools with the C++ tools and Windows SDK. Run the commands in an **x64 Native Tools Command Prompt**.

## Build and play
Expand Down
13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
targets = ["x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc"];
};

# The launcher's default Proton (PINNED_PROTON in project_tuxbox/host.py).
# nixpkgs' proton-ge-bin follows its own release schedule, so pin the
# upstream release archive here and keep both versions in sync.
proton-ge = pkgs.fetchzip {
name = "GE-Proton11-14";
url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton11-14/GE-Proton11-14-x86_64.tar.gz";
hash = "sha256-Bru3l0AqrvDl+XYC1dYhmy5XqKP49yFjWVJwZzel60Q=";
};

tools = with pkgs; [
# Languages
rust
Expand Down Expand Up @@ -88,13 +97,17 @@
runScript = "env";
};
in {
packages.proton-ge = proton-ge;

devShells.default = pkgs.mkShell {
packages = tools ++ [fhs];
buildInputs = [pkgs.lz4];

# Python loads these through ctypes
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.lz4 pkgs.libx11];
VULKAN_HEADERS_INCLUDE = "${pkgs.vulkan-headers}/include";

PROTONPATH = proton-ge;
};
});
}
19 changes: 19 additions & 0 deletions tests/test_flake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import re
import unittest
from pathlib import Path

from project_tuxbox.host import PINNED_PROTON

ROOT = Path(__file__).resolve().parents[1]


class FlakeTests(unittest.TestCase):
def test_dev_shell_pins_the_launcher_default_proton(self):
flake = (ROOT / "flake.nix").read_text(encoding="utf-8")
pinned = set(re.findall(r"GE-Proton\d+-\d+", flake))
self.assertEqual(pinned, {PINNED_PROTON})
self.assertIn("PROTONPATH", flake)


if __name__ == "__main__":
unittest.main()
Loading