DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.22k stars 40 forks source link

Add Wine-tkg sources #178

Closed sonic2kk closed 1 year ago

sonic2kk commented 1 year ago

Implements #156.

This PR aims to implement at least one Wine-tkg source into ProtonUp-Qt for use with Lutris :partying_face: If others are desired they should be straightforward to implement too :smile:

image

As of writing, currently only WIne-tkg based on Valve's Wine has been implemented as a ctmod, based on the so-called "Exp Bleeding Edge Other distro". It will download this ctmod and extract the zip, which contains a .tar.zst file inside the zip. This extracts to a usr folder, which is the actual folder that Lutris will use as its base Wine runner directory, so we rename it to match the name of the zip archive.

On a technical note, this PR implements the Wine-tkg ctmod as a separate ctmod file, but this is just a subclass of the Proton-tkg ctmod as the logic is 95%. The only three places the logic differs is:

Hopefully this approach to implementation is alright :sweat_smile: I thought it would be way overkill to just copy/paste the Proton-tkg ctmod, especially if we want to implement more Tkg builds! I took a similar approach with SteamTinkerLaunch and SteamTinkerLaunch-git since they both downloaded from the same repo, and I think in this case since the Wine-tkg and Proton-tkg builds share a repo, it makes sense to have subclassed ctmods in this instance as well :-)


I guess if we can agree on and finalize the implementation of this Wine-tkg build, we can start to discuss others. To reiterate what I left in a comment on #156, I think we should give the user at least two options for the Wine-tkg build they want by default: One based on Valve's Wine, and another based on vanilla Wine.

I am open to suggestions on which flavour of vanilla Wine to go with, but I figured that the one based on the Ubuntu buildsystem is probably the safest to go with. I have no preference either way :slightly_smiling_face:

I was also thinking that we could add the League of Legends Wine build under Advanced Mode, since we have the Titanfall 2 build perhaps we could also support the LoL Wine as well. I don't play League of Legends so I can't say how beneficial it may be, and unlike the Titanfall 2 build it was not requested (as far as I know :nerd_face:), it it may be "solving" a problem that doesn't exist :sweat_smile:


Thanks as always! :smile:

DavidoTek commented 1 year ago

Great!

this PR implements the Wine-tkg ctmod as a separate ctmod file, but this is just a subclass of the Proton-tkg

Very good, makes sense.

I think we should give the user at least two options for the Wine-tkg build they want by default: One based on Valve's Wine, and another based on vanilla Wine.

We can do that. Maybe we should hide one of them behind advanced mode so it doesn't get too much. I'm open on this.

but I figured that the one based on the Ubuntu buildsystem is probably the safest to go with

Yeah, Ubuntu uses older/more stable dependencies. Should work on most other distros then.

I was also thinking that we could add the League of Legends Wine build under Advanced Mode [...] I can't say how beneficial it may be [...]

I also can't say what the advantages of this build are, but nothing speaks against adding it.


I will do an in-depth review tomorrow and merge.

Thanks! :tada: :tada:

sonic2kk commented 1 year ago

Maybe we should hide one of them behind advanced mode so it doesn't get too much. I'm open on this.

This is definitely a concern of mine too, trying to avoid providing an overwhelming amount of options is definitely something I keep in mind.

Perhaps the vanilla Wine should be kept to advanced mode? I figure it would probably be slightly "less" compatible than Valve's Wine, as Valve's Bleeding-Edge Wine is used for several projects including GE-Proton (it used to be based on wine-staging but I think he switched to Valve Bleeding Edge).

Vanilla Wine isn't added as a ctmod yet, but to add it, it should just be a case of making a new ctmod to point to the corresponding GitHub workflow for it. If we go with the Ubuntu one, it might look something like this:

# pupgui2 compatibility tools module
# Proton-Tkg https://github.com/Frogging-Family/wine-tkg-git
# Copyright (C) 2022 DavidoTek, partially based on AUNaseef's protonup

from PySide6.QtCore import QCoreApplication, Signal

from pupgui2.resources.ctmods.ctmod_protontkg import CtInstaller as TKGCtInstaller  # Use ProtonTKg Ctmod as base

CT_NAME = 'Wine Tkg (Vanilla Wine)'
CT_LAUNCHERS = ['lutris', 'advmode']
CT_DESCRIPTION = {'en': QCoreApplication.instance().translate('ctmod_winetkg_vanilla_ubuntu', '''Custom Wine build for running Windows games, built with the Wine-tkg build system.''')}

class CtInstaller(TKGCtInstaller):

    BUFFER_SIZE = 65536
    PROTON_PACKAGE_NAME = 'wine-ubuntu.yml'
    TKG_EXTRACT_NAME = 'wine_tkg'

    p_download_progress_percent = 0
    download_progress_percent = Signal(int)

    def __init__(self, main_window = None):
        super().__init__(main_window)

The TKG_EXTRACT_NAME may need to be changed, I am not sure. Perhaps something like wine_tkg_staging_fsync_git?


NOTE: I just checked a vanilla Wine-tkg build and it is actually packaged slightly different than the Valve Wine builds (ugh...). It downloads as a zip like usual, and has a .tar file inside it. Perhaps the logic that was already in place for extracting the .tar file will already work for vanilla Wine builds.

The .tar file for vanilla Wine does not appear to contain a usr subfolder, so having the folder inside the .tar as the root folder should be all that is required. Looking at the .tar extraction code, it seems like that's what happens already, so no extra effort may be needed to implement extracting the vanilla Wine builds. However I still wanted to note this :-)

image

(to be clear, this .tar is inside the .zip artifact downloaded from GitHub Actions, so from what I have seen this is identical to how Proton-tkg is packaged, and therefore how it is downloaded and extracted by ProtonUp-Qt)

This vanilla Wine build could always be looked into in a separate PR :slightly_smiling_face:


I also can't say what the advantages of this build are, but nothing speaks against adding it.

So just once again, I am not a League player, but I think that the LoL builds have various patches that are incompatible or otherwise unable to be merged upstream or used in conjunction with other Wine builds. Maybe this is not the case anymore, maybe this was never the case and I am remembering wrong, but I think that's why the build is separate :smile:

sonic2kk commented 1 year ago

D'oh, just realised this extracts the dotfiles that come with Wine-tkg:

We could put these into a list, and check for and remove them after successful extraction maybe. Will look into it later :-)

DavidoTek commented 1 year ago

Perhaps the vanilla Wine should be kept to advanced mode?

That was my thought too.

If we go with the Ubuntu one, it might look something like this: [code] [...] checked a vanilla Wine-tkg build and it is actually packaged slightly different

That is short. Very nice. Maybe we can add a check for the usr folder in the "main-ctmod" protontkg later if necessary.

I think that the LoL builds have various patches that are incompatible

All right.

sonic2kk commented 1 year ago

Added a small check to remove the listed files. I prefer removing from a list instead of removing dotfiles so we are explicit about what we remove, but if it's overkill we can change it. Also, not sure if I implemented the removal in the most efficient way, but it's a start at least :-)

DavidoTek commented 1 year ago

I prefer removing from a list instead of removing dotfiles so we are explicit about what we remove,

Good, that keeps it clean.


Thanks, will merge.