Minecraft Blogs / Other

Arch Linux — Out-of-bounds; Steam & Protontricks

  • 47 views, 2 today
  • 3
  • 0
Hebgbs's Avatar Hebgbs
Level 48 : Master Archer
45

What do you really need WINE for?

It's a question that should fascinate anyone with Steam installed. If Steam uses Proton for its compatibility tool, and if it runs Windows games… does that mean Steam uses WINE?

Yes. But that's only one half of the answer. …We don't care about the rest, we just want to get Protontricks working so editing Proton instances for select titles can be done. This article will present the possibility of avoiding the installation of WINE stable in favour for Proton's WINE libraries, which can be used even with Steam closed, but… frankly there's no point to that now, is there?

But why?

If you've just installed your Arch Linux (Garuda, Manjaro, ChimeraOS, RebornOS, EndeavourOS) instance, and root for that system can be mutated by you; the end-user then certain things can be done in a way that many may consider as out--of-bounds, but we can do these things with relative safety if we know what we are doing.

…That doesn't give a good reason as to why, though.So consider how much space you have to spare; do you really want WINE stable installed, along with almost every version of Proton under the sun for Linux compatibility with Windows binaries? If you've given yourself heaps of space, then fine have dozens of compatibility layers to run your Windows applications with little consideration of how much software you can make function using less instances than fingers on one hand. This isn't for you, move along. For the curious and inquiring, however…

Where is Steam's WINE?

There are several locations where your Proton instances can be at, depending on how you have your partitions configured and where you have your instances; steamapps/common may be located in the following directories:
Windows — %progra~2%\Steam\
Linux / Unix / BSD — $HOME/.local/share/Steam/
Else — SteamLibrary/

That's not all; different versions of Proton have different locations for the critical WINE binaries applications seek out. On top of knowing where the common/ directory is, Proton's files can exist in various locations. Depending on the version of Proton used (not comprehensive):
Experimental / 9.0 (beta) and after ­— files/bin/
8.0 and prior — dist/bin/

Let's demonstrate one of possible myriad options to use Proton Experimental for general native applications which expect WINE, using GNU core utils' ln:
find -type f -name 'wine*' $HOME/.local/share/Steam/steamapps/common/Proton\ -\ Experimental/files/bin/ | xargs -I{} sudo ln -s {} /usr/local/bin

I broke this down in my previous post about symbolic links; but unlike last time, we have the incorporation of sudo — the de-facto elevation authoriser used in Linux systems around the world. Also notice the spaces are prefixed with \ — in Windows this is how you'd de-limit paths. Everywhere else you use this to escape characters. Rather than wrap the offending portions in "Quotation marks" ('Or, their single-quote variety') backslashes are used to enable spaces as part of a directory path.

But also, it's still five operations except, rather than making our own input using the output of printf, we're using the output of find as input; and since the find command prints absolute paths, we can use those as-is rather than using a single directory name for filling in the blank left in xargs with -I {}.
Want to use the terminal for removing these links? Give this a try:find /usr/local/bin -type l -name 'wine*' | xargs -I {} sudo unlink {}

So uh… now what?

We're not quite done yet — in the example above, Protn Experimental's WINE binaries are put into /usr/local/bin but Linux-native applications asking for WINE (like TeamViewer or ProtonTricks) will still want to install WINE, thus making the above entirely useless.

Before we build ProtonTricks, we need to build WineTricks as this is what ProtonTricks depends on — it'll be the same as from my article about GUI package management, in the comment I left about building Pamac for GTK 2+3 in other Arch Linux derivatives; fetch the package, change the package, and add it to ignore so we can manage it ourselves when a GUI tool of preference declares an update is available but not install it until you say so.

Fetching

Get the software and edit winetricks-git:git clone https://aur.archlinux.org/protontricks
https://aur.archlinux.org/winetricks-git
cd ./winetricks-git && $EDITOR ./PKGBUIILD

Editing

Now that the build file of Winetricks we downloaded has its PKGBUILD file opened, we need to make a couple of changes;
Editing dependencies
Provided:depends=('wine' 'cabextract' 'unzip' 'xorg-xmessage')Modified:depends=('cabextract' 'unzip' 'xorg-xmessage')

Editing optional dependencies
Provided:optdepends=('zenity: For the GTK3 GUI.'
'kdialog: For the KDE GUI (less capable).'
)
Modified:optdepends=('zenity: For the GTK3 GUI.'
'kdialog: For the KDE GUI (less capable).'
'wine: —USER-DEFINED OPTION—'
)
You can replace the flavour text for Winetricks' optional Wine dependency yourself; just swap  —USER-DEFINED OPTION—  with anything else.

Building

Now, simply build it:makepkg -si
cd ../protontricks && makepkg -si
Protontricks doesn't need WINE, it needs Winetricks; Winetricks was build without wine as a dependency, thus avoiding the need to install it so Proton Experimental (per previous effort above) is used in its place.

Ewwww, that interface!

Yeah, looks pretty goofy doesn't it? You can blame Zenity for that. If you don't like the look of Zenity for GTK 4, then you can build Zenity for GTK 3 with relative ease, which should also integrate better with other GTK 2+3 applications outside of GNOME Shell, as it'd respect your appearance preferences:cd /tmp
git clone https://aur.archlinux.org/zenity-gtk3
cd ./zenity-gtk3 && makepkg -si

If prompted to remove zenity as a package due to zenity-gtk3 conflicting with it, accept. Since zenity is an optional package, this should be of no problem to use but if other applications expect gtk4 + libadwaita, you'll need to build older versions that expect gtk3 so your preference for zenity is respected.

Blissful ignorance

The package must now be added into the Pacman configuration as an ignored package. Since we modified this package, any updates provided to us as-is also need to be modified so our preferences are preserved, and many AUR helpers will happily disregard ignored packages — yet, still tell you updates exist — for anything defined in /etc/pacman.conf.
Open the file:sudo $EDITOR /etc/pacman.confAdd the provisions:IgnorePkg = winetricks-git
If adding onto an existing IgnorePkg (for instance, as provided by Pamac Manager) then use their GUI to do it, or append onto existing ignored package provisions.

Summary

If you've followed along up to this point, you now understand how to take control of packages in Arch so in scenarios where you have less-than-ideal partition space because of compounding circumstances, you can still get what you want, with minimal fuss and still have space to spare for more important things.
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome