about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/package-management/protontricks/default.nix
blob: ec5017c54c7ee4e49e5fa5b7fd657519eab6239f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib
, buildPythonApplication
, fetchFromGitHub
, setuptools_scm
, vdf
, steam-run
, winetricks
, zenity
, pytestCheckHook
}:

buildPythonApplication rec {
  pname = "protontricks";
  version = "1.4.4";

  src = fetchFromGitHub {
    owner = "Matoking";
    repo = pname;
    rev = version;
    sha256 = "0i7p0jj7avmq3b2qlcpwcflipndrnwsvwvhc5aal7rm95aa7xhja";
  };

  patches = [
    # Use steam-run to run Proton binaries
    ./steam-run.patch
  ];

  preBuild = ''
    export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
  '';

  nativeBuildInputs = [ setuptools_scm ];
  propagatedBuildInputs = [ vdf ];

  makeWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath [
      steam-run
      (winetricks.override {
        # Remove default build of wine to reduce closure size.
        # Falls back to wine in PATH when --no-runtime is passed.
        wine = null;
      })
      zenity
    ]}"
  ];

  checkInputs = [ pytestCheckHook ];
  disabledTests = [
    # Steam runtime is hard-coded with steam-run.patch and can't be configured
    "test_run_steam_runtime_not_found"
    "test_unknown_steam_runtime_detected"

    # Steam runtime 2 currently isn't supported
    # See https://github.com/NixOS/nixpkgs/issues/100655
    "test_run_winetricks_steam_runtime_v2"
  ];

  meta = with lib; {
    description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
    homepage = "https://github.com/Matoking/protontricks";
    license = licenses.gpl3;
    maintainers = with maintainers; [ metadark ];
    platforms = platforms.linux;
  };
}