fix: wrapped prostudiomasters in --in-process-gpu flag
This commit is contained in:
		
							parent
							
								
									3bee0c7402
								
							
						
					
					
						commit
						7e6fa744af
					
				
					 2 changed files with 22 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -10,7 +10,6 @@
 | 
			
		|||
        ./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: {
 | 
			
		||||
      prostudiomasters =
 | 
			
		||||
        pkgs.callPackage
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
{
 | 
			
		||||
  fetchurl,
 | 
			
		||||
  appimageTools,
 | 
			
		||||
  writeShellScript,
 | 
			
		||||
}: let
 | 
			
		||||
  pname = "prostudiomasters";
 | 
			
		||||
  version = "2.5.6";
 | 
			
		||||
| 
						 | 
				
			
			@ -8,7 +9,25 @@
 | 
			
		|||
    url = "https://download.prostudiomasters.com/linux/ProStudioMasters-${version}.AppImage";
 | 
			
		||||
    hash = "sha256-7owOwdcucFfl+JsVj+Seau2KOz0J4P/ep7WrBSNSmbs=";
 | 
			
		||||
  };
 | 
			
		||||
in
 | 
			
		||||
  appimageTools.wrapType2 {
 | 
			
		||||
 | 
			
		||||
  # Create the base AppImage wrapper
 | 
			
		||||
  baseApp = appimageTools.wrapType2 {
 | 
			
		||||
    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
 | 
			
		||||
      '';
 | 
			
		||||
  })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue