2021-01-05 17:05:55 +00:00
|
|
|
{ lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools_scm
|
|
|
|
, vdf
|
2021-01-05 17:05:55 +00:00
|
|
|
, steam-run
|
2020-09-25 04:45:31 +00:00
|
|
|
, winetricks
|
|
|
|
, zenity
|
2021-01-05 17:05:55 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protontricks";
|
2021-02-13 14:23:35 +00:00
|
|
|
version = "1.4.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Matoking";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-13 14:23:35 +00:00
|
|
|
sha256 = "0i7p0jj7avmq3b2qlcpwcflipndrnwsvwvhc5aal7rm95aa7xhja";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
patches = [
|
|
|
|
# Use steam-run to run Proton binaries
|
|
|
|
./steam-run.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
|
|
|
propagatedBuildInputs = [ vdf ];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
2021-01-05 17:05:55 +00:00
|
|
|
"--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
|
|
|
|
]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-05 17:05:55 +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"
|
|
|
|
"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"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|