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.

112 lines
2.7 KiB

  1. # Maintainer: Pekka Helenius (~Fincer) <fincer89 at hotmail dot com>
  2. # Override /etc/makepkg.conf PKGDEST variable if it's enabled
  3. PKGDEST="${PWD}"
  4. pkgname=dxvk-nvapi-git
  5. _pkgname=dxvk-nvapi
  6. pkgver=580.6268
  7. pkgrel=1
  8. pkgdesc="Alternative NVAPI implementation on top of DXVK."
  9. url="https://github.com/jp7677/dxvk-nvapi"
  10. license=('MIT')
  11. arch=('x86_64')
  12. conflicts=(
  13. 'dxvk-nvapi'
  14. )
  15. depends=('dxvk' 'wine' 'vulkan-icd-loader' 'lib32-vulkan-icd-loader')
  16. makedepends=(
  17. 'ninja'
  18. 'meson>=0.49'
  19. 'glslang'
  20. 'mingw-w64-gcc'
  21. 'git'
  22. 'wine'
  23. 'python'
  24. )
  25. _dxvknvapi_gitsrc=
  26. _git_branch_dxvknvapi=master
  27. _dxvknvapi_commit=HEAD
  28. provides=('dxvk-nvapi')
  29. options=(!strip !buildflags staticlibs)
  30. source=(
  31. ${pkgname}::"${_dxvknvapi_gitsrc}#commit=${_dxvknvapi_commit}"
  32. 'setup_dxvk_nvapi.sh'
  33. )
  34. sha256sums=(
  35. 'SKIP'
  36. 'e2ff99af4ecb739629e0f873077f986cffcc9418c8ecb7e6040744f05110afbb'
  37. )
  38. ##############################
  39. # Copy custom patches to correct location
  40. if [[ $(find "${startdir}/dxvk-nvapi-patches" -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$") ]]; then
  41. cp -r "${startdir}/dxvk-nvapi-patches/"*.{patch,diff} "${startdir}"/
  42. p=0
  43. for patch in $(find . -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$"); do
  44. patches[$p]="$(basename ${patch})"
  45. let p++
  46. done
  47. unset p
  48. source+=(${source[@]} ${patches[@]})
  49. fi
  50. # Reset git tree and apply custom patches
  51. prepare() {
  52. cd "${srcdir}/dxvk-nvapi-git"
  53. git checkout ${_git_branch_dxvknvapi}
  54. git reset --hard ${_dxvknvapi_commit} # Restore tracked files
  55. git clean -d -x -f # Delete untracked files
  56. git submodule update --init --recursive
  57. # Apply patches, if present
  58. if [[ $(ls "${srcdir}"/*.{patch,diff} 2>/dev/null | wc -w) -ne 0 ]]; then
  59. # Apply all custom patches
  60. msg2 "Applying custom patches..."
  61. for i in "${srcdir}"/*.{patch,diff}; do
  62. if [[ -f ${i} ]]; then
  63. patch -Np1 < ${i}
  64. fi
  65. done
  66. fi
  67. }
  68. ##############################
  69. # Retrieve DXVK NVAPI version tag
  70. pkgver() {
  71. cd "${pkgname}"
  72. printf '%s.%s' $(git rev-list --count HEAD) $(git rev-parse --short HEAD | sed 's/\-[a-z].*//; s/\-/\./g; s/[a-z]//g')
  73. }
  74. # Launch DXVK NVAPI build script
  75. build() {
  76. cd "${pkgname}"
  77. ./package-release.sh ${pkgver} "${srcdir}"/build
  78. }
  79. # Bundle the compiled files
  80. package() {
  81. mkdir -p "${pkgdir}"/usr/{bin,share/dxvk_nvapi}
  82. cp -r "${srcdir}"/build/${_pkgname}-${pkgver}/* "${pkgdir}/usr/share/dxvk_nvapi/"
  83. cp "${srcdir}"/setup_dxvk_nvapi.sh "${pkgdir}/usr/share/dxvk_nvapi/"
  84. echo -e "#!/bin/sh" > "${pkgdir}/usr/bin/setup_dxvk_nvapi"
  85. echo -e "
  86. cd /usr/share/dxvk_nvapi/
  87. ./setup_dxvk_nvapi.sh \${@}
  88. " >> "${pkgdir}/usr/bin/setup_dxvk_nvapi"
  89. chmod +x "${pkgdir}/usr/share/dxvk_nvapi/setup_dxvk_nvapi.sh"
  90. chmod +x "${pkgdir}/usr/bin/setup_dxvk_nvapi"
  91. }