Automate installation of DXVK, D9VK + Wine/Wine Staging & update GPU drivers + PlayonLinux wineprefixes (Debian/Ubuntu/Mint/Arch Linux/Manjaro)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

264 lines
10 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # Wine/Wine Staging & DXVK package builder & auto-installer
  2. Automate installation of the newest DXVK + Wine Staging, and optionally update all your PlayonLinux wineprefixes (Ubuntu/Mint/Arch Linux/Manjaro)
  3. ## About
  4. This script bundle offers an easy-way solution to use the bleeding edge Wine Staging & DXVK packages system-wide on Ubuntu/Mint and Arch Linux based Linux distributions.
  5. ## Motivation
  6. **Accessibility, lower the barrier.** My personal motivation to develop this script bundle was to lower the barried to people to get their hands on the latest bleeding-edge Wine / Wine Staging & DXVK versions on major Linux distribution platforms.
  7. I have seen that there is not a clear way to install Wine Staging Git & DXVK, especially on Ubuntu/Mint. Therefore, I decided someone has to do something, so this script bundle was born.
  8. Additionally, the benefits of the bleeding-edge Wine/Wine Staging & DXVK versions are quite limited at the moment. Wine Staging is not easily available on Debian-based Linux distributions, and DXVK is practically bundled to Lutris or Steam gaming platform as a form of Proton. We have to keep in mind that not all Windows programs are run under Steam on Linux but many programs are run via PlayOnLinux or without relying on any other third-party management software.
  9. The solution I provide here _is not bundled to any commercial or other Wine management platform_. The latest Wine/Wine Staging & DXVK bundle is available system-wide, not just Steam, Lutris or PlayOnLinux.
  10. ----------------
  11. ## Requirements
  12. - Ubuntu, Mint or any other Linux distribution which uses `dpkg` and `àpt` for package management
  13. - pure Debian is not supported yet
  14. - Arch Linux, Manjaro or any other Linux distribution which uses `pacman` for package management
  15. - **Not listed as a hard dependency, but actually required by DXVK**: The latest Nvidia or AMD GPU drivers. Personally, I've used proprietary Nvidia drivers & AMDGPU (not AMDGPU Pro).
  16. ----------------
  17. ## Why to compile from source?
  18. **Advantages:**
  19. - packages are directly adapted to your system
  20. - packages do not rely on PPAs which may be abandoned in time
  21. - using Git sources provide the latest packages available publicly
  22. **Disadvantages:**
  23. - takes time & CPU processing
  24. - is unreliable in some cases, the script may break easily due to rapid DXVK development or distro changes
  25. - may break working already-working versions of the packages (use `--no-install` parameter to avoid installation of DXVK & Wine)
  26. ----------------
  27. ## Script usage
  28. For instructions, run:
  29. ```
  30. bash updatewine.sh --help
  31. ```
  32. on the main script folder.
  33. You can pass arguments like:
  34. ```
  35. bash updatewine.sh --no-staging --no-install
  36. ```
  37. All supported arguments are:
  38. - `--no-staging` = Compile Wine instead of Wine Staging
  39. - `--no-install` = Do not install Wine or DXVK, just compile them. Note that Wine must be installed for DXVK compilation.
  40. - `--no-wine` = Do not compile or install Wine/Wine Staging
  41. - `--no-dxvk` = Do not compile or install DXVK
  42. - `--no-pol` = Do not update current user's PlayOnLinux Wine prefixes
  43. ----------------
  44. ## Custom patches for Wine & DXVK
  45. You can apply your own patches for DXVK & Wine by dropping valid `.patch` or `.diff` files into `dxvk_custom_patches` (DXVK) or `wine_custom_patches` (Wine).
  46. Folders `dxvk_disabled_patches` and `wine_disabled_patches` are just for management purposes, they do not have a role in script at all.
  47. Wine patches are not related to Wine Staging patchset. You can use your patches either with Wine Staging or vanilla Wine.
  48. ----------------
  49. ## Compiled packages are stored for later usage
  50. Successfully compiled Wine & DXVK packages are stored as follows:
  51. On Ubuntu/Mint:
  52. - `main script folder/debian/compiled_deb/`
  53. On Arch Linux:
  54. - `main script folder/arch/compiled_pkg/`
  55. The subfolders there are generated according to buildtime timestamp, known as `build identifier`
  56. ## DXVK usage
  57. **NOTE:** DXVK must be installed before applying these steps!
  58. To enable DXVK on existing wineprefixes, just run
  59. ```
  60. WINEPREFIX=/path/to/my/wineprefix setup_dxvk
  61. ```
  62. `winetricks` is required for this command.
  63. ## Add DXVK to PlayOnLinux Wine prefixes
  64. To install DXVK on specific PlayOnLinux wineprefix which uses a different than `system` version of Wine, apply the following command syntax:
  65. ```
  66. WINEPREFIX="$HOME/.PlayOnLinux/wineprefix/myprefix" WINEPATH=$HOME/.PlayOnLinux/wine/{linux-amd64,linux-x86}/wineversion/bin" setup_dxvk
  67. ```
  68. where you need to set either `linux-amd64` or `linux-x86` and set `wineversion` to match a real one, obviously.
  69. system-wide `winetricks` executable (`/usr/bin/winetricks`) is required for this command.
  70. ### Uninstall temporary development packages (Ubuntu/Mint etc. only):
  71. Development packages can take extra space on your system so you may find useful to uninstall them.
  72. This package comes with `debian_devpkgremoval.sh` script which is targeted for that purpose.
  73. It uninstalls majority of Wine-Staging (Git), meson & glslang buildtime dependencies.
  74. To use `debian_devpkgremoval.sh`, simply run:
  75. ```
  76. bash debian_devpkgremoval.sh
  77. ```
  78. ---------------------------
  79. ### EXAMPLES:
  80. **NOTE:** If `--no-install` option is given, the script doesn't check for PlayOnLinux Wine prefixes.
  81. **NOTE:** PlayOnLinux Wine prefixes is checked for current user only.
  82. **1)** Compile Wine Staging & DXVK, and make installable packages for them. Install the packages:
  83. `bash updatewine.sh`
  84. **2)** Compile DXVK and make an installable package for it. Do not install:
  85. `bash updatewine.sh --no-wine --no-install`
  86. **3)** Compile Wine Staging and make an installable package for it. Do not install:
  87. `bash updatewine.sh --no-dxvk --no-install`
  88. **4)** Compile Wine and make an installable package for it. Do not install:
  89. `bash updatewine.sh --no-staging --no-dxvk --no-install`
  90. **5)** Compile Wine & DXVK, and make installable packages for them. Do not install:
  91. `bash updatewine.sh --no-staging --no-install`
  92. **6)** Compile Wine Staging & DXVK, and make installable packages for them. Do not install:
  93. `bash updatewine.sh --no-install`
  94. **7)** Compile Wine & DXVK, and make installable packages for them. Install the packages:
  95. `bash updatewine.sh --no-staging`
  96. **8)** Compile Wine, and make an installable package for it. Install the package, do not check PlayOnLinux wineprefixes:
  97. `bash updatewine.sh --no-staging --no-dxvk --no-pol`
  98. ---------------------------
  99. ### NOTES
  100. **NOTE: Do not pause a virtual machine**. It is not recommended to run this script in a virtualized environment (Oracle VirtualBox, for instance) if you plan to `Pause` the virtual machine during script runtime. This causes an internal sudo validate loop to get nuts. In normal environments and in normal runtime cases, this doesn't happen. Validate loop is required to keep sudo permissions alive for the script since the execution time exceeds default system-wide sudo timeout limit.
  101. ---------------------------
  102. ### Test-run validation
  103. This is validation test done for the script. This test is to ensure it works as expected. It is mandatory due to rapid development of the packages it handles.
  104. **Latest test-run:** 11th November, 2018
  105. **Linux Distributions:**
  106. - Success: Arch Linux, Linux Mint 19
  107. - Failure: Debian 9 (Wine), Ubuntu 18.04 (DXVK)
  108. #### Failure reasons:
  109. Debian:
  110. - conflicting amd64/i386 Wine build time dependency packages, must find workaround for this
  111. - no winetricks package
  112. Ubuntu 18.04:
  113. - during DXVK compilation, the following error appears:
  114. ```
  115. ...
  116. [162/192] Compiling C++ object 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_swapchain.cpp.obj'.
  117. FAILED: src/d3d11/src@d3d11@@d3d11@sha/d3d11_swapchain.cpp.obj
  118. x86_64-w64-mingw32-g++ -Isrc/d3d11/src@d3d11@@d3d11@sha -Isrc/d3d11 -I../../../../src/d3d11 -I../../../.././include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++1z -O3 -DNOMINMAX -MD -MQ 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_swapchain.cpp.obj' -MF 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_swapchain.cpp.obj.d' -o 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_swapchain.cpp.obj' -c ../../../../src/d3d11/d3d11_swapchain.cpp
  119. {standard input}: Assembler messages:
  120. {standard input}:3269: Warning: end of file not at end of a line; newline inserted
  121. {standard input}: Error: open SEH entry at end of file (missing .seh_endproc)
  122. x86_64-w64-mingw32-g++: internal compiler error: Killed (program cc1plus)
  123. ...
  124. ```
  125. or
  126. ```
  127. ...
  128. [137/192] Compiling C++ object 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_view_uav.cpp.obj'.
  129. FAILED: src/d3d11/src@d3d11@@d3d11@sha/d3d11_view_uav.cpp.obj
  130. x86_64-w64-mingw32-g++ -Isrc/d3d11/src@d3d11@@d3d11@sha -Isrc/d3d11 -I../../../../src/d3d11 -I../../../.././include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++1z -O3 -DNOMINMAX -MD -MQ 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_view_uav.cpp.obj' -MF 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_view_uav.cpp.obj.d' -o 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_view_uav.cpp.obj' -c ../../../../src/d3d11/d3d11_view_uav.cpp
  131. x86_64-w64-mingw32-g++: internal compiler error: Killed (program cc1plus)
  132. Please submit a full bug report,
  133. with preprocessed source if appropriate.
  134. See <https://gcc.gnu.org/bugs/> for instructions.
  135. [144/192] Compiling C++ object 'src/d3d11/src@d3d11@@d3d11@sha/d3d11_context.cpp.obj'.
  136. ninja: build stopped: subcommand failed.
  137. ...
  138. ```
  139. ---------------------------
  140. ### TODO
  141. - Add support for pure Debian. Main issue is conflicting amd64/i386 Wine buildtime packages
  142. - Workaround must be found, maybe split single Wine deb package into two, with suffixes amd64 & i386?
  143. - For pure Debian, package 'winetricks' must be compiled, too
  144. - Add compilation scripts for the latest AMDGPU & Nvidia drivers on Arch Linux/Debian/Ubuntu/Mint
  145. - Remove temp folders in case of failure (meson/glslang/dxvk-git/wine... temp build folders)
  146. - Add option (?): do not store compiled packages, just install them
  147. - Better handling for sudo validation loop function
  148. - may cause the terminal output to get nuts
  149. - when interrupting the script, the exit functionality may not be handled correctly?
  150. ---------------------------
  151. ### LICENSE
  152. This repository uses GPLv3 license. See [LICENSE](LICENSE) for details.