summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEwout van Mansom2023-01-12 13:24:21 +0100
committerEwout van Mansom2023-01-12 13:24:21 +0100
commit9cbdf86efc27fc2f25203eeb690dfc04fb097cdd (patch)
tree5b392ba4d643e2992309c9a0170d7ad03c2bb5a7
downloadaur-dxvk-async-bin.tar.gz
initial commit
-rw-r--r--.SRCINFO41
-rw-r--r--.gitignore7
-rw-r--r--PKGBUILD40
-rw-r--r--dxvk-async-env.conf1
-rw-r--r--setup_dxvk.sh206
5 files changed, 295 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6b82e454d63f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,41 @@
+pkgbase = dxvk-async-bin
+ pkgdesc = A Vulkan-based compatibility layer for Direct3D 9/10/11 (with async patches)
+ pkgver = 2.0
+ pkgrel = 1
+ url = https://github.com/Sporif/dxvk-async
+ arch = x86_64
+ license = ZLIB
+ license = custom:libpng
+ depends = vulkan-icd-loader
+ depends = wine>=4.0rc1
+ depends = lib32-vulkan-icd-loader
+ depends = bash
+ provides = dxvk
+ provides = d9vk
+ provides = dxvk=2.0
+ conflicts = d9vk-mingw-git
+ conflicts = d9vk-bin
+ conflicts = d9vk-winelib-git
+ conflicts = dxvk-bin
+ conflicts = dxvk-git
+ conflicts = dxvk-wine32-git
+ conflicts = dxvk-wine64-git
+ conflicts = dxvk-win32-git
+ conflicts = dxvk-win64-git
+ conflicts = dxvk-winelib-git
+ conflicts = dxvk-mingw-git
+ conflicts = dxvk-async
+ conflicts = dxvk-async-git
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = https://github.com/Sporif/dxvk-async/releases/download/2.0/dxvk-async-2.0.tar.gz
+ source = https://raw.githubusercontent.com/doitsujin/dxvk/master/LICENSE
+ source = dxvk-async-env.conf
+ source = setup_dxvk.sh
+ sha256sums = f8e250f1afd1475e90b1dcc4083ae28a1174f0900e02f52955b6525996de5e2e
+ sha256sums = 03ca4af84f5cd28cef3ed3f1ef4d17996992d35ccdbe82b29cc020ca02c16f3d
+ sha256sums = 5ea0fbf7fddb45a8575ff001793011a594d999aaeb66ef95378bca950c844300
+ sha256sums = 0f688815530ab5e8cc89b9b45d9b1d66cd8cd5a7770fb8249339af555a30dfe7
+
+pkgname = dxvk-async-bin
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..c815fd7ec5f1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+!.SRCINFO
+!.gitignore
+!PKGBUILD
+!dxvk-async-env.conf
+!setup_dxvk.sh
+
+*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4538c2cac5f1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Ewout van Mansom <ewout@vanmansom.name>
+# Contributor: Andrius Lukosevicius <niobium93@gmail.com>
+# Contributor: giantdwarf <17hoehbr@gmail.com>
+
+pkgname=dxvk-async-bin
+pkgver=2.0
+pkgrel=1
+pkgdesc="A Vulkan-based compatibility layer for Direct3D 9/10/11 (with async patches)"
+arch=('x86_64')
+url="https://github.com/Sporif/dxvk-async"
+license=('ZLIB' 'custom:libpng')
+depends=('vulkan-icd-loader' 'wine>=4.0rc1' 'lib32-vulkan-icd-loader' 'bash')
+provides=('dxvk' 'd9vk' "dxvk=$pkgver")
+conflicts=('d9vk-mingw-git' 'd9vk-bin' 'd9vk-winelib-git' 'dxvk-bin' 'dxvk-git' 'dxvk-wine32-git' 'dxvk-wine64-git' 'dxvk-win32-git' 'dxvk-win64-git' 'dxvk-winelib-git' 'dxvk-mingw-git' 'dxvk-async' 'dxvk-async-git')
+options=(!strip !buildflags staticlibs)
+source=("$url/releases/download/$pkgver/dxvk-async-$pkgver.tar.gz"
+ 'https://raw.githubusercontent.com/doitsujin/dxvk/master/LICENSE'
+ 'dxvk-async-env.conf'
+ 'setup_dxvk.sh')
+sha256sums=('f8e250f1afd1475e90b1dcc4083ae28a1174f0900e02f52955b6525996de5e2e'
+ '03ca4af84f5cd28cef3ed3f1ef4d17996992d35ccdbe82b29cc020ca02c16f3d'
+ '5ea0fbf7fddb45a8575ff001793011a594d999aaeb66ef95378bca950c844300'
+ '0f688815530ab5e8cc89b9b45d9b1d66cd8cd5a7770fb8249339af555a30dfe7')
+
+package() {
+ cd "${pkgname%-bin}-$pkgver"
+
+ mkdir -p -m 755 "$pkgdir/usr/share"
+ cp -dr --preserve=mode,timestamp . "$pkgdir/usr/share/dxvk"
+
+ mkdir -p -m 755 "$pkgdir/usr/share/licenses/dxvk-async"
+ install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/dxvk-async/LICENSE"
+
+ install -Dm 755 "$srcdir/setup_dxvk.sh" "$pkgdir/usr/share/dxvk/setup_dxvk.sh"
+ mkdir -p -m 755 "$pkgdir/usr/bin"
+ ln -s /usr/share/dxvk/setup_dxvk.sh "$pkgdir/usr/bin/setup_dxvk"
+
+ mkdir -p -m 755 "$pkgdir/etc/environment.d"
+ install -Dm644 "$srcdir/dxvk-async-env.conf" "$pkgdir/etc/environment.d/dxvk-async-env.conf"
+}
diff --git a/dxvk-async-env.conf b/dxvk-async-env.conf
new file mode 100644
index 000000000000..e41652436fb5
--- /dev/null
+++ b/dxvk-async-env.conf
@@ -0,0 +1 @@
+DXVK_ASYNC=1
diff --git a/setup_dxvk.sh b/setup_dxvk.sh
new file mode 100644
index 000000000000..0f1998f30d99
--- /dev/null
+++ b/setup_dxvk.sh
@@ -0,0 +1,206 @@
+#!/usr/bin/env bash
+
+# default directories
+dxvk_lib32=${dxvk_lib32:-"x32"}
+dxvk_lib64=${dxvk_lib64:-"x64"}
+
+# figure out where we are
+basedir="$(dirname "$(readlink -f "$0")")"
+
+# figure out which action to perform
+action="$1"
+
+case "$action" in
+install)
+ ;;
+uninstall)
+ ;;
+*)
+ echo "Unrecognized action: $action"
+ echo "Usage: $0 [install|uninstall] [--without-dxgi] [--symlink]"
+ exit 1
+esac
+
+# process arguments
+shift
+
+with_dxgi=true
+file_cmd="cp -v --reflink=auto"
+
+while (($# > 0)); do
+ case "$1" in
+ "--without-dxgi")
+ with_dxgi=false
+ ;;
+ "--symlink")
+ file_cmd="ln -s -v"
+ ;;
+ esac
+ shift
+done
+
+# check wine prefix before invoking wine, so that we
+# don't accidentally create one if the user screws up
+if [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then
+ echo "$WINEPREFIX:"' Not a valid wine prefix.' >&2
+ exit 1
+fi
+
+# find wine executable
+export WINEDEBUG=-all
+# disable mscoree and mshtml to avoid downloading
+# wine gecko and mono
+export WINEDLLOVERRIDES="mscoree,mshtml="
+
+wine="wine"
+wine64="wine64"
+wineboot="wineboot"
+
+# $PATH is the way for user to control where wine is located (including custom Wine versions).
+# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps.
+# In such case, wine64 and winebooot will be present, but wine binary will be missing,
+# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing.
+wine_path=$(dirname "$(which $wineboot)")
+wow64=true
+if ! [ -f "$wine_path/$wine" ]; then
+ wine=$wine64
+ wow64=false
+fi
+
+# resolve 32-bit and 64-bit system32 path
+winever=$($wine --version | grep wine)
+if [ -z "$winever" ]; then
+ echo "$wine:"' Not a wine executable. Check your $wine.' >&2
+ exit 1
+fi
+
+# ensure wine placeholder dlls are recreated
+# if they are missing
+$wineboot -u
+
+win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
+win64_sys_path="${win64_sys_path/$'\r'/}"
+if $wow64; then
+ win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
+ win32_sys_path="${win32_sys_path/$'\r'/}"
+fi
+
+if [ -z "$win32_sys_path" ] && [ -z "$win64_sys_path" ]; then
+ echo 'Failed to resolve C:\windows\system32.' >&2
+ exit 1
+fi
+
+# create native dll override
+overrideDll() {
+ $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo -e "Failed to add override for $1"
+ exit 1
+ fi
+}
+
+# remove dll override
+restoreDll() {
+ $wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /f > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Failed to remove override for $1"
+ fi
+}
+
+# copy or link dxvk dll, back up original file
+installFile() {
+ dstfile="${1}/${3}.dll"
+ srcfile="${basedir}/${2}/${3}.dll"
+
+ if [ -f "${srcfile}.so" ]; then
+ srcfile="${srcfile}.so"
+ fi
+
+ if ! [ -f "${srcfile}" ]; then
+ echo "${srcfile}: File not found. Skipping." >&2
+ return 1
+ fi
+
+ if [ -n "$1" ]; then
+ if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then
+ if ! [ -f "${dstfile}.old" ]; then
+ mv -v "${dstfile}" "${dstfile}.old"
+ else
+ rm -v "${dstfile}"
+ fi
+ $file_cmd "${srcfile}" "${dstfile}"
+ else
+ echo "${dstfile}: File not found in wine prefix" >&2
+ return 1
+ fi
+ fi
+ return 0
+}
+
+# remove dxvk dll, restore original file
+uninstallFile() {
+ dstfile="${1}/${3}.dll"
+ srcfile="${basedir}/${2}/${3}.dll"
+
+ if [ -f "${srcfile}.so" ]; then
+ srcfile="${srcfile}.so"
+ fi
+
+ if ! [ -f "${srcfile}" ]; then
+ echo "${srcfile}: File not found. Skipping." >&2
+ return 1
+ fi
+
+ if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then
+ echo "${dstfile}: File not found. Skipping." >&2
+ return 1
+ fi
+
+ if [ -f "${dstfile}.old" ]; then
+ rm -v "${dstfile}"
+ mv -v "${dstfile}.old" "${dstfile}"
+ return 0
+ else
+ return 1
+ fi
+}
+
+install() {
+ installFile "$win64_sys_path" "$dxvk_lib64" "$1"
+ inst64_ret="$?"
+
+ inst32_ret=-1
+ if $wow64; then
+ installFile "$win32_sys_path" "$dxvk_lib32" "$1"
+ inst32_ret="$?"
+ fi
+
+ if (( ($inst32_ret == 0) || ($inst64_ret == 0) )); then
+ overrideDll "$1"
+ fi
+}
+
+uninstall() {
+ uninstallFile "$win64_sys_path" "$dxvk_lib64" "$1"
+ uninst64_ret="$?"
+
+ uninst32_ret=-1
+ if $wow64; then
+ uninstallFile "$win32_sys_path" "$dxvk_lib32" "$1"
+ uninst32_ret="$?"
+ fi
+
+ if (( ($uninst32_ret == 0) || ($uninst64_ret == 0) )); then
+ restoreDll "$1"
+ fi
+}
+
+# skip dxgi during install if not explicitly
+# enabled, but always try to uninstall it
+if $with_dxgi || [ "$action" == "uninstall" ]; then
+ $action dxgi
+fi
+
+$action d3d9
+$action d3d10core
+$action d3d11