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.

113 lines
2.7 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. _dxvk_gitsrc=
  35. _git_branch_dxvk=master
  36. _dxvk_commit=HEAD
  37. provides=('dxvk')
  38. options=(!strip !buildflags staticlibs)
  39. source=(${pkgname}::"${_dxvk_gitsrc}#commit=${_dxvk_commit}")
  40. sha256sums=('SKIP')
  41. ##############################
  42. # Copy custom patches to correct location
  43. if [[ $(find "${startdir}/dxvk-patches" -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$") ]]; then
  44. cp -r "${startdir}/dxvk-patches/"*.{patch,diff} "${startdir}"/
  45. p=0
  46. for patch in $(find . -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$"); do
  47. patches[$p]="$(basename ${patch})"
  48. let p++
  49. done
  50. unset p
  51. source+=(${source[@]} ${patches[@]})
  52. fi
  53. # Reset git tree and apply custom patches
  54. prepare() {
  55. cd "${srcdir}/dxvk-git"
  56. git checkout ${_git_branch_dxvk}
  57. git reset --hard ${_dxvk_commit} # Restore tracked files
  58. git clean -d -x -f # Delete untracked files
  59. git submodule update --init --recursive
  60. # Apply patches, if present
  61. if [[ $(ls "${srcdir}"/*.{patch,diff} 2>/dev/null | wc -w) -ne 0 ]]; then
  62. # Apply all custom patches
  63. msg2 "Applying custom patches..."
  64. for i in "${srcdir}"/*.{patch,diff}; do
  65. if [[ -f ${i} ]]; then
  66. patch -Np1 < ${i}
  67. fi
  68. done
  69. fi
  70. }
  71. ##############################
  72. # Retrieve DXVK version tag
  73. pkgver() {
  74. cd "${pkgname}"
  75. printf '%s' $(git describe --long --always | sed 's/\-[a-z].*//; s/\-/\./g; s/[a-z]//g')
  76. }
  77. # Launch DXVK build script
  78. build() {
  79. cd "${pkgname}"
  80. ./package-release.sh ${pkgver} "${srcdir}"/build --no-package
  81. }
  82. # Bundle the compiled files
  83. package() {
  84. mkdir -p "${pkgdir}"/usr/{bin,share/dxvk}
  85. cp -r "${srcdir}"/build/${_pkgname}-${pkgver}/* "${pkgdir}/usr/share/dxvk/"
  86. echo -e "#!/bin/sh" > "${pkgdir}/usr/bin/setup_dxvk"
  87. echo -e "
  88. cd /usr/share/dxvk/
  89. ./setup_dxvk.sh \${@}
  90. " >> "${pkgdir}/usr/bin/setup_dxvk"
  91. chmod +x "${pkgdir}/usr/bin/setup_dxvk"
  92. }