2020-09-19 13:37:15 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools_scm
|
|
|
|
, vdf
|
|
|
|
, wine
|
|
|
|
, winetricks
|
|
|
|
, zenity
|
2020-01-26 13:51:31 +00:00
|
|
|
, pytest
|
2019-07-13 03:03:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "protontricks";
|
2020-09-19 13:37:15 +00:00
|
|
|
version = "1.4.2";
|
2019-07-13 03:03:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Matoking";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-09-19 13:37:15 +00:00
|
|
|
sha256 = "0ri4phi1rna9snrxa6gl23walyack09mgax7zpjqfpxivwls3ach";
|
2019-07-13 03:03:35 +00:00
|
|
|
};
|
|
|
|
|
2020-01-26 13:51:31 +00:00
|
|
|
# Fix interpreter in mock run.sh for tests
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/conftest.py \
|
|
|
|
--replace '#!/bin/bash' '#!${stdenv.shell}' \
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
2019-07-13 03:03:35 +00:00
|
|
|
propagatedBuildInputs = [ vdf ];
|
|
|
|
|
|
|
|
# The wine install shipped with Proton must run under steam's
|
|
|
|
# chrootenv, but winetricks and zenity break when running under
|
|
|
|
# it. See https://github.com/NixOS/nix/issues/902.
|
|
|
|
#
|
|
|
|
# The current workaround is to use wine from nixpkgs
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--set STEAM_RUNTIME 0"
|
|
|
|
"--set-default WINE ${wine}/bin/wine"
|
|
|
|
"--set-default WINESERVER ${wine}/bin/wineserver"
|
2020-01-26 13:51:31 +00:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [ winetricks zenity ]}"
|
2019-07-13 03:03:35 +00:00
|
|
|
];
|
|
|
|
|
2020-01-26 13:51:31 +00:00
|
|
|
checkInputs = [ pytest ];
|
|
|
|
checkPhase = "pytest";
|
|
|
|
|
2019-07-13 03:03:35 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/Matoking/protontricks";
|
2019-07-13 03:03:35 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ metadark ];
|
2020-09-19 13:37:15 +00:00
|
|
|
platforms = platforms.linux;
|
2019-07-13 03:03:35 +00:00
|
|
|
};
|
|
|
|
}
|