diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix index fdb6fffad5be..223fdba8014c 100644 --- a/pkgs/applications/emulators/wine/sources.nix +++ b/pkgs/applications/emulators/wine/sources.nix @@ -254,8 +254,8 @@ rec { winetricks = fetchFromGitHub rec { # https://github.com/Winetricks/winetricks/releases - version = "20250102"; - hash = "sha256-Km2vVTYsLs091cjmNTW8Kqku3vdsEA0imTtZfqZWDQo="; + version = "20260125"; + hash = "sha256-uIBVESebsH7rXnxWd/qlrZxcG7Y486PctHzcLz29HDk="; owner = "Winetricks"; repo = "winetricks"; rev = version; diff --git a/pkgs/applications/emulators/wine/winetricks.nix b/pkgs/applications/emulators/wine/winetricks.nix index 76e9ee4b621f..76a3eef7a497 100644 --- a/pkgs/applications/emulators/wine/winetricks.nix +++ b/pkgs/applications/emulators/wine/winetricks.nix @@ -2,20 +2,23 @@ lib, stdenv, callPackage, - perl, - which, - coreutils, - zenity, - curl, - cabextract, - unzip, - p7zip, - gnused, - gnugrep, + makeWrapper, bash, + cabextract, + coreutils, + curl, gawk, + gnugrep, + gnused, gnutar, gzip, + p7zip, + perl, + unzip, + which, + zenity, + unrar-free, + versionCheckHook, }: stdenv.mkDerivation rec { @@ -27,36 +30,49 @@ stdenv.mkDerivation rec { buildInputs = [ perl which - ]; - - # coreutils is for sha1sum - pathAdd = lib.makeBinPath [ - perl - which - coreutils - zenity - curl - cabextract - unzip - p7zip - gnused - gnugrep - bash - gawk - gnutar - gzip + makeWrapper ]; makeFlags = [ "PREFIX=$(out)" ]; doCheck = false; # requires "bashate" - postInstall = '' - sed -i \ - -e '2i PATH="${pathAdd}:$PATH"' \ - "$out/bin/winetricks" + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + postPatch = '' + patchShebangs src/winetricks + substituteInPlace src/winetricks \ + --replace-fail 'command -v unrar' 'command -v unrar-free' \ + --replace-fail 'w_try unrar' 'w_try unrar-free' ''; + postInstall = + let + runtimeDependencies = [ + bash + cabextract + coreutils + curl + gawk + gnugrep + gnused + gnutar + gzip + p7zip + perl + unrar-free + unzip + which + zenity + ]; + in + '' + wrapProgram $out/bin/winetricks \ + --prefix PATH : "${lib.makeBinPath runtimeDependencies}" \ + --set WINETRICKS_LATEST_VERSION_CHECK "disabled" + ''; + passthru = { inherit (src) updateScript; };