Notice that I am targeting all WINE packages in order to test slightly different configurations. Use `eselect wine` to switch between versions.
Until the Gentoo devs says that wow64 feature is stable and fully functional, I will keep it off.
I have enable the `abi_x86_32` use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.
These are the additional WINE related packages that I installed:
- media-libs/amdvlk: `+abi_x86_32 +raytracing` but I am not sure my gpu supports raytracing
- media-libs/shaderc
I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
This is an example of an innocous error that is caused by spectrwm when using WINE:
```
ERROR: ld.so: object '/usr/lib64/libswmhack.so.0.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
```
Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.
## Using WINE
If you have no clue about how WINE works, start by reading the [FAQs](https://wiki.winehq.org/FAQ#Wineprefixes).
The biggest considerations you have to make when using WINE are the
software dependencies of the Windows program you want to use. For the
moment I have been able to survive with only two prefixes, one for 32
bits games and one for more recent software.
What all of this means, is that I have two folders in my home, `.wine` and `.wine32` in which I instruct WINE to start a new program using the environment variable (that is what WINEPREFIX is all about). When I feel lazy, I select the WINE prefix using winetricks, then navigate to the game using explorer.exe.
It's important to remember that whenever you create a new WINE prefix, you need to symlink the correct directx dependencies, as the Gentoo ebuilds suggests:
-`WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink` for directx12
-`WINEPREFIX=/home/user/.wine setup_dxvk.sh install --symlink` for directx11 and earlier
Usually WINE takes care of starting up necessary processes inside the
prefixes. This is done by the `wineboot` program so I suggest to read
its manpage.
To install software dependencies, I use winetricks. If a dependency is
not available through winetricks, it's always possible to install the
.exe as you would on Windows. Take in mind that WINE uses some Linux
specific software in place of some Windows libraries. Some key replacements include:
- wine-mono in place of dotnet
- dxvk and vkd3d in place of directx
- gallium-nine and wined3d, in place of directx but I had better experience with dxvk and vkd3d
- wine-gecko in place of whatever web view IE was offering
- wineconsole in place of the Windows cmd program
- your dotnet installation is usually enough for WINE, you don't need
to install the dotnet runtimes, although I have to check this assertion on a
fresh installation
### Dependencies rules of thumb
1. lots of games prompt you to install dependencies such as directx. Avoid it as much as possible and rely on WINE specific libraries
2. winetricks can manage most if not all of those dependencies for you. It will save you time to figure out the correct paths for each library and automate the install as much as possible
3. recent games usually want the Visual C++ libraries. You can install them all with the vcrun2022 package
4. older games usually want Visual C++ libraries, but you need to install the different yearly versions one by one
5. you can backup or modify the winetricks installers. They are in you cache directory, usually `~/.cache/winetricks`
### Debugging
In all honesty, it's too early in this journey to write a comprehensive chapter on this topic. The `winedbg` command is still shrouded in mystery.
At the moment I am keeping a small set of games that are self contained and allows me to check if WINE inside the wineprefix is working as I expect.
I have uploaded some mostly self contained demos that you can use to test that directx and you GPU is working as it should:
- [https://archive.org/details/elemental-demo-dx-12-guru-3-d.com](UnrealEngine4 tech demo for directx12)
- [https://archive.org/details/ue-4-elemental-demo](the same demo, but for directx11)