fix: wrapped prostudiomasters in --in-process-gpu flag

This commit is contained in:
Leyla Becker 2025-09-17 19:42:15 -05:00
parent 3bee0c7402
commit 7e6fa744af
2 changed files with 22 additions and 4 deletions

View file

@ -10,7 +10,6 @@
./webtoon-dl.nix ./webtoon-dl.nix
{}; {};
}) })
# TODO: this package always needs to be called with the --in-process-gpu flag for some reason, can we automate that?
(final: prev: { (final: prev: {
prostudiomasters = prostudiomasters =
pkgs.callPackage pkgs.callPackage

View file

@ -1,6 +1,7 @@
{ {
fetchurl, fetchurl,
appimageTools, appimageTools,
writeShellScript,
}: let }: let
pname = "prostudiomasters"; pname = "prostudiomasters";
version = "2.5.6"; version = "2.5.6";
@ -8,7 +9,25 @@
url = "https://download.prostudiomasters.com/linux/ProStudioMasters-${version}.AppImage"; url = "https://download.prostudiomasters.com/linux/ProStudioMasters-${version}.AppImage";
hash = "sha256-7owOwdcucFfl+JsVj+Seau2KOz0J4P/ep7WrBSNSmbs="; hash = "sha256-7owOwdcucFfl+JsVj+Seau2KOz0J4P/ep7WrBSNSmbs=";
}; };
in
appimageTools.wrapType2 { # Create the base AppImage wrapper
baseApp = appimageTools.wrapType2 {
inherit pname version src; inherit pname version src;
} };
# Create a wrapper script that automatically adds the --in-process-gpu flag
wrapper = writeShellScript "prostudiomasters-wrapper" ''
exec ${baseApp}/bin/prostudiomasters --in-process-gpu "$@"
'';
in
# Override the base app to use our wrapper script
baseApp.overrideAttrs (oldAttrs: {
buildCommand =
oldAttrs.buildCommand
+ ''
# Replace the original binary with our wrapper
rm $out/bin/prostudiomasters
cp ${wrapper} $out/bin/prostudiomasters
chmod +x $out/bin/prostudiomasters
'';
})