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.

88 lines
2.5 KiB

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