2021-01-05 17:05:55 +00:00
|
|
|
{ lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2021-09-18 10:52:07 +00:00
|
|
|
, setuptools
|
2020-09-25 04:45:31 +00:00
|
|
|
, vdf
|
2024-01-13 08:15:51 +00:00
|
|
|
, pillow
|
|
|
|
, substituteAll
|
|
|
|
, writeShellScript
|
2021-01-05 17:05:55 +00:00
|
|
|
, steam-run
|
2020-09-25 04:45:31 +00:00
|
|
|
, winetricks
|
2021-09-18 10:52:07 +00:00
|
|
|
, yad
|
2021-01-05 17:05:55 +00:00
|
|
|
, pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, nix-update-script
|
2024-06-05 15:53:02 +00:00
|
|
|
, extraCompatPaths ? ""
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protontricks";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Matoking";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-a40IAFrzQ0mogMoXKb+Lp0fPc1glYophqtftigk3nAc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
patches = [
|
|
|
|
# Use steam-run to run Proton binaries
|
2024-01-13 08:15:51 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./steam-run.patch;
|
|
|
|
steamRun = lib.getExe steam-run;
|
|
|
|
bash = writeShellScript "steam-run-bash" ''
|
|
|
|
exec ${lib.getExe steam-run} bash "$@"
|
|
|
|
'';
|
|
|
|
})
|
2021-01-05 17:05:55 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools # implicit dependency, used to find data/icon_placeholder.png
|
|
|
|
vdf
|
2024-01-13 08:15:51 +00:00
|
|
|
pillow
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeWrapperArgs = [
|
2021-01-05 17:05:55 +00:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [
|
2021-09-18 10:52:07 +00:00
|
|
|
winetricks
|
|
|
|
yad
|
2021-01-05 17:05:55 +00:00
|
|
|
]}"
|
2024-01-13 08:15:51 +00:00
|
|
|
# Steam Runtime does not work outside of steam-run, so don't use it
|
|
|
|
"--set STEAM_RUNTIME 0"
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optional (extraCompatPaths != "") "--set STEAM_EXTRA_COMPAT_TOOLS_PATHS ${extraCompatPaths}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
# From 1.6.0 release notes (https://github.com/Matoking/protontricks/releases/tag/1.6.0):
|
|
|
|
# In most cases the script is unnecessary and should be removed as part of the packaging process.
|
|
|
|
postInstall = ''
|
|
|
|
rm "$out/bin/protontricks-desktop-install"
|
|
|
|
'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
pythonImportsCheck = [ "protontricks" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple wrapper for running Winetricks commands for Proton-enabled games";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/Matoking/protontricks";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ kira-bruneau ];
|
2021-09-18 10:52:07 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|