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.

99 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. # 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 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. 'dxvk-bin'
  15. 'dxvk-winelib-git'
  16. 'dxvk-legacy-git'
  17. 'dxvk-mingw-git'
  18. )
  19. depends=('wine' 'vulkan-icd-loader' 'lib32-vulkan-icd-loader')
  20. makedepends=(
  21. 'ninja'
  22. 'meson>=0.43'
  23. 'glslang'
  24. 'mingw-w64-gcc'
  25. 'git'
  26. 'wine'
  27. )
  28. provides=('dxvk')
  29. options=(!strip !buildflags staticlibs)
  30. source=(${pkgname}::"git+https://github.com/doitsujin/dxvk.git#commit=HEAD")
  31. sha256sums=('SKIP')
  32. _git_branch_dxvk=master
  33. _dxvk_commit=HEAD
  34. ##############################
  35. # Copy custom patches to correct location
  36. if [[ $(find "${startdir}/dxvk-patches" -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$") ]]; then
  37. cp -r "${startdir}/dxvk-patches/"*.{patch,diff} "${startdir}"/
  38. p=0
  39. for patch in $(find . -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$"); do
  40. patches[$p]="$(basename ${patch})"
  41. let p++
  42. done
  43. unset p
  44. source+=(${source[@]} ${patches[@]})
  45. fi
  46. # Reset git tree and apply custom patches
  47. prepare() {
  48. cd "${srcdir}/dxvk-git"
  49. git checkout ${_git_branch_dxvk}
  50. git reset --hard ${_dxvk_commit} # Restore tracked files
  51. git clean -d -x -f # Delete untracked files
  52. # Apply patches, if present
  53. if [[ $(ls "${srcdir}"/*.{patch,diff} 2>/dev/null | wc -w) -ne 0 ]]; then
  54. # Apply all custom patches
  55. msg2 "Applying custom patches..."
  56. for i in "${srcdir}"/*.{patch,diff}; do
  57. if [[ -f ${i} ]]; then
  58. patch -Np1 < ${i}
  59. fi
  60. done
  61. fi
  62. }
  63. ##############################
  64. # Retrieve DXVK version tag
  65. pkgver() {
  66. cd "${pkgname}"
  67. printf '%s' $(git describe --long --always | sed 's/\-[a-z].*//; s/\-/\./; s/[a-z]//g')
  68. }
  69. # Launch DXVK build script
  70. build() {
  71. "${srcdir}/${pkgname}"/package-release.sh ${pkgver} "${srcdir}"/build --no-package
  72. }
  73. # Bundle the compiled files
  74. package() {
  75. mkdir -p "${pkgdir}"/usr/{bin,share/dxvk}
  76. cp -r "${srcdir}"/build/${_pkgname}-${pkgver}/* "${pkgdir}/usr/share/dxvk/"
  77. echo -e "#!/bin/sh\n/usr/share/dxvk/setup_dxvk.sh" \
  78. > "${pkgdir}/usr/bin/setup_dxvk"
  79. chmod +x "${pkgdir}/usr/bin/setup_dxvk"
  80. }