2019-11-07 14:38:33 +00:00
|
|
|
{ lib
|
2020-09-19 14:37:15 +01:00
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools_scm
|
|
|
|
, vdf
|
2019-11-07 14:38:33 +00:00
|
|
|
, steam-run
|
2020-09-19 14:37:15 +01:00
|
|
|
, winetricks
|
|
|
|
, zenity
|
2019-11-07 14:38:33 +00:00
|
|
|
, pytestCheckHook
|
2019-07-13 04:03:35 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protontricks";
|
2021-02-04 22:31:06 +00:00
|
|
|
version = "1.4.4";
|
2019-07-13 04:03:35 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Matoking";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-04 22:31:06 +00:00
|
|
|
sha256 = "0i7p0jj7avmq3b2qlcpwcflipndrnwsvwvhc5aal7rm95aa7xhja";
|
2019-07-13 04:03:35 +01:00
|
|
|
};
|
|
|
|
|
2019-11-07 14:38:33 +00:00
|
|
|
patches = [
|
|
|
|
# Use steam-run to run Proton binaries
|
|
|
|
./steam-run.patch
|
|
|
|
];
|
2020-01-26 13:51:31 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
2019-07-13 04:03:35 +01:00
|
|
|
propagatedBuildInputs = [ vdf ];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
2019-11-07 14:38:33 +00:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [
|
|
|
|
steam-run
|
2020-12-13 15:13:36 +00:00
|
|
|
(winetricks.override {
|
|
|
|
# Remove default build of wine to reduce closure size.
|
|
|
|
# Falls back to wine in PATH when --no-runtime is passed.
|
|
|
|
wine = null;
|
|
|
|
})
|
2019-11-07 14:38:33 +00:00
|
|
|
zenity
|
|
|
|
]}"
|
2019-07-13 04:03:35 +01:00
|
|
|
];
|
|
|
|
|
2019-11-07 14:38:33 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
disabledTests = [
|
|
|
|
# Steam runtime is hard-coded with steam-run.patch and can't be configured
|
|
|
|
"test_run_steam_runtime_not_found"
|
2020-12-12 18:00:56 +00:00
|
|
|
"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"
|
2019-11-07 14:38:33 +00:00
|
|
|
];
|
2020-01-26 13:51:31 +00:00
|
|
|
|
2019-11-07 14:38:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-13 04:03:35 +01:00
|
|
|
description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/Matoking/protontricks";
|
2019-07-13 04:03:35 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ metadark ];
|
2020-09-19 14:37:15 +01:00
|
|
|
platforms = platforms.linux;
|
2019-07-13 04:03:35 +01:00
|
|
|
};
|
|
|
|
}
|