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.

107 lines
2.6 KiB

  1. # Maintainer: Pekka Helenius (~Fincer) <fincer89 at hotmail dot com>
  2. # Contributor: Adrià Cereto i Massagué <ssorgatem at gmail.com>
  3. # Override /etc/makepkg.conf PKGDEST variable if it's enabled
  4. PKGDEST="${PWD}"
  5. pkgname=dxvk-git
  6. _pkgname=dxvk
  7. pkgver=1.2.1.4
  8. pkgrel=1
  9. pkgdesc="A Vulkan-based compatibility layer for Direct3D 9/10/11 which allows running 3D applications on Linux using Wine."
  10. url="https://github.com/doitsujin/dxvk"
  11. license=('custom:zlib/libpng')
  12. arch=('x86_64')
  13. conflicts=(
  14. 'd9vk-bin'
  15. 'd9vk-mingw'
  16. 'd9vk-mingw-git'
  17. 'd9vk-winelib'
  18. 'd9vk-winelib-git'
  19. 'dxvk-bin'
  20. 'dxvk-winelib'
  21. 'dxvk-winelib-git'
  22. 'dxvk-legacy-git'
  23. 'dxvk-mingw-git'
  24. )
  25. depends=('wine' 'vulkan-icd-loader' 'lib32-vulkan-icd-loader')
  26. makedepends=(
  27. 'ninja'
  28. 'meson>=0.43'
  29. 'glslang'
  30. 'mingw-w64-gcc'
  31. 'git'
  32. 'wine'
  33. )
  34. _git_branch_dxvk=master
  35. _dxvk_commit=HEAD
  36. provides=('dxvk')
  37. options=(!strip !buildflags staticlibs)
  38. source=(${pkgname}::"git+https://github.com/doitsujin/dxvk.git#commit=${_dxvk_commit}")
  39. sha256sums=('SKIP')
  40. ##############################
  41. # Copy custom patches to correct location
  42. if [[ $(find "${startdir}/dxvk-patches" -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$") ]]; then
  43. cp -r "${startdir}/dxvk-patches/"*.{patch,diff} "${startdir}"/
  44. p=0
  45. for patch in $(find . -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$"); do
  46. patches[$p]="$(basename ${patch})"
  47. let p++
  48. done
  49. unset p
  50. source+=(${source[@]} ${patches[@]})
  51. fi
  52. # Reset git tree and apply custom patches
  53. prepare() {
  54. cd "${srcdir}/dxvk-git"
  55. git checkout ${_git_branch_dxvk}
  56. git reset --hard ${_dxvk_commit} # Restore tracked files
  57. git clean -d -x -f # Delete untracked files
  58. # Apply patches, if present
  59. if [[ $(ls "${srcdir}"/*.{patch,diff} 2>/dev/null | wc -w) -ne 0 ]]; then
  60. # Apply all custom patches
  61. msg2 "Applying custom patches..."
  62. for i in "${srcdir}"/*.{patch,diff}; do
  63. if [[ -f ${i} ]]; then
  64. patch -Np1 < ${i}
  65. fi
  66. done
  67. fi
  68. }
  69. ##############################
  70. # Retrieve DXVK version tag
  71. pkgver() {
  72. cd "${pkgname}"
  73. printf '%s' $(git describe --long --always | sed 's/\-[a-z].*//; s/\-/\./; s/[a-z]//g')
  74. }
  75. # Launch DXVK build script
  76. build() {
  77. "${srcdir}/${pkgname}"/package-release.sh ${pkgver} "${srcdir}"/build --no-package
  78. }
  79. # Bundle the compiled files
  80. package() {
  81. mkdir -p "${pkgdir}"/usr/{bin,share/dxvk}
  82. cp -r "${srcdir}"/build/${_pkgname}-${pkgver}/* "${pkgdir}/usr/share/dxvk/"
  83. echo -e "#!/bin/sh\n/usr/share/dxvk/setup_dxvk.sh \${@}" \
  84. > "${pkgdir}/usr/bin/setup_dxvk"
  85. chmod +x "${pkgdir}/usr/bin/setup_dxvk"
  86. }