1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-22 07:54:15 +01:00

Add an option to set up dxvk through overrides (#40)

* use winepath to convert unix path

* Add overrides option to setup script

* Fix missing arch switch in setup script
This commit is contained in:
Raffarti 2018-01-29 13:22:19 +01:00 committed by Philip Rebohle
parent 08a916487d
commit f5782cd6cd
2 changed files with 34 additions and 14 deletions

View File

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
dlls_dir='@dlldir@' dlls_dir='@dlldir@'
build_arch='@arch@'
path_pattern='s|^\s*PATH\s+REG_EXPAND_SZ\s+(.*)\s*$|\1|g' path_pattern='s|^\s*PATH\s+REG_EXPAND_SZ\s+(.*)\s*$|\1|g'
dlls_windir="Z:$(sed 's|/|\\|g'<<<$dlls_dir)" dlls_windir=$(winepath -w "$dlls_dir")
dlls_windir_pattern="$(sed 's|\\|\\\\|g'<<<$dlls_windir)" dlls_windir_pattern="$(sed 's|\\|\\\\|g'<<<$dlls_windir)"
WINEDEBUG=-all WINEDEBUG=-all
@ -35,19 +36,37 @@ function redirect {
fi fi
} }
redirect CHK_REDIRECT_D3D11 d3d11 function addToPATH {
redirect CHK_REDIRECT_DXGI dxgi path=$(wine reg query 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' /v PATH | sed -e 's|\r||g')
path_val=$(grep REG_EXPAND_SZ<<<$path | sed -E -e $path_pattern)
path=$(wine reg query 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' /v PATH | sed -e 's|\r||g') check=$(sed -E -e "s|^(.*;)?$(sed 's|\\|\\\\|g'<<<$1)(;.*)?$||" <<<$path_val)
path_val=$(grep REG_EXPAND_SZ<<<$path | sed -E -e $path_pattern) if [ -n "$check" ]; then
check=$(sed -E -e "s|^(.*;)?$dlls_windir_pattern(;.*)?$||" <<<$path_val) echo "adding $1 to windows PATH"
new_path="$(sed -E -e 's|;?\s*$||' <<<$path_val);$1"
if [ -n "$check" ]; then
echo "adding $dlls_windir to windows PATH"
new_path="$(sed -E -e 's|;?\s*$||' <<<$path_val);$dlls_windir"
echo "$path" echo "$path"
echo "new PATH: $new_path" echo "new PATH: $new_path"
wine reg add 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' /v PATH /d "$new_path" /t REG_EXPAND_SZ wine reg add 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' /v PATH /d "$new_path" /t REG_EXPAND_SZ
else else
echo -e "windows PATH was \\e[0;32mOK\\e[0m" echo -e "windows PATH was \\e[0;32mOK\\e[0m"
fi
}
if [ "$1" == "overrides" ]; then
set -e
if [ $build_arch == "x86_64" ]; then
wine=wine64
else
wine=wine
fi
unix_sys_path="$($wine winepath -u 'C:\windows\system32')"
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides /v d3d11 /d native /f
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides /v dxgi /d native /f
ln -sf "$dlls_dir/d3d11_vk.dll" "$unix_sys_path/d3d11.dll"
ln -sf "$dlls_dir/dxgi_vk.dll" "$unix_sys_path/dxgi.dll"
exit 0
fi fi
redirect CHK_REDIRECT_D3D11 d3d11
redirect CHK_REDIRECT_DXGI dxgi
addToPATH "$dlls_windir"

View File

@ -1,5 +1,6 @@
conf = configuration_data() conf = configuration_data()
conf.set('dlldir', get_option('prefix')+'/'+get_option('bindir')) conf.set('dlldir', get_option('prefix')+'/'+get_option('bindir'))
conf.set('arch', target_machine.cpu_family())
configure_file( configure_file(
configuration : conf, configuration : conf,
input : 'dlls_setup.sh.in', input : 'dlls_setup.sh.in',