From cb92d9954ca49815d0ab905840c795d6ef9a8e5f Mon Sep 17 00:00:00 2001 From: Raffarti Date: Mon, 12 Feb 2018 08:07:24 +0100 Subject: [PATCH 1/2] Setup script: improvements to error handling (#65) * Setup script: improvements to error handlings * Setup script: added missing `-e` to echo * Setup script: fix misplaced fullstop due to windows \r --- wine_utils/setup_dxvk.sh.in | 40 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/wine_utils/setup_dxvk.sh.in b/wine_utils/setup_dxvk.sh.in index 8cb8a82e..4b62594a 100755 --- a/wine_utils/setup_dxvk.sh.in +++ b/wine_utils/setup_dxvk.sh.in @@ -72,36 +72,48 @@ else fi fi unix_sys_path="$($wine winepath -u 'C:\windows\system32')" +if [ $? -ne 0 ]; then + exit 1 +fi + ret=0 function removeOverride { echo -n ' [1/2] Removing override... ' - wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d builtin /f - if [ ! $? ]; then + local out + out=$(wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d builtin /f 2>&1) + if [ $? -ne 0 ]; then + echo -e "\\e[1;31m$out\\e[0m" exit 1 fi + echo -e "$(sed -e 's|\r||g' <<< "\\e[1;32m$out\\e[0m.")" local dll="$unix_sys_path/$1.dll" echo -n ' [2/2] Removing link... ' if [ -h "$dll" ]; then - rm "$dll" - if [ "$?" == "0" ]; then - echo "Done." + out=$(rm "$dll" 2>&1) + if [ $? -eq 0 ]; then + echo -e '\e[1;32mDone\e[0m.' else ret=2 + echo -e "\\e[1;31m$out\\e[0m" fi else - echo "'$dll' is not a link or doesn't exist." + echo -e "\\e[1;33m'$dll' is not a link or doesn't exist\\e[0m." ret=2 fi } function checkOverride { echo -n ' [1/2] Checking override... ' - local ovr="$(wine reg query 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1)" - if [ ! $? ]; then + echo -en '\e[1;31m' + local ovr + ovr="$(wine reg query 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1)" + if [ $? -ne 0 ]; then + echo -en '\e[1;0m' exit 1 fi + echo -en '\e[1;0m' if [[ $ovr == *native* ]] && ! [[ $ovr == *builtin,native* ]]; then echo -e '\e[1;32mOK\e[0m.' else @@ -119,16 +131,20 @@ function checkOverride { function createOverride { echo -n ' [1/2] Creating override... ' - wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f - if [ ! $? ]; then + local out + out=$(wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f 2>&1) + if [ $? -ne 0 ]; then + echo -e "\\e[1;31m$out\\e[0m" exit 1 fi + echo -e "$(sed -e 's|\r||g' <<< "\\e[1;32m$out\\e[0m.")" echo -n " [2/2] Creating link to $1.dll... " ln -sf "$dlls_dir/$1.dll" "$unix_sys_path/$1.dll" - if [ $? ]; then - echo "Done." + if [ $? -eq 0 ]; then + echo -e '\e[1;32mDone\e[0m.' else ret=2 + echo -e "\\e[1;31m$out\\e[0m" fi } From 844249ca6ed11b70e60f55597d71fd337306964f Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 12 Feb 2018 01:07:37 -0600 Subject: [PATCH 2/2] Improve documentation for building on Debian (#66) * setup_dxvk.sh: Fix typo * [general] README: Document required meson version Meson 0.43 introduced support for @BASENAME@ in the generator argument list, so document that we need at least that. * [general] README: Document mingw-w64 threading support requirement --- README.md | 15 +++++++++++++-- wine_utils/setup_dxvk.sh.in | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 49987b50..897432d1 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ For binary releases, see the [releases](https://github.com/doitsujin/dxvk/releas ### Requirements: - [wine-staging](https://wine-staging.com/) for Vulkan support -- [Meson](http://mesonbuild.com/) build system -- [MinGW64](http://mingw-w64.org/) compiler and headers +- [Meson](http://mesonbuild.com/) build system (at least 0.43) +- [MinGW64](http://mingw-w64.org/) compiler and headers (requires threading support) - [glslang](https://github.com/KhronosGroup/glslang) front end and validator ### Building DLLs @@ -63,3 +63,14 @@ In addition to the DLLs, the following standalone programs are included in the p - `dxbc-compiler`: Compiles a DXBC shader to SPIR-V. - `dxbc-disasm`: Disassembles a DXBC shader. Requires native `d3dcompiler_47.dll`. - `hlsl-compiler`: Compiles a HLSL shader to DXBC. Requires native `d3dcompiler_47.dll`. + +## Troubleshooting +DXVK requires threading support from your mingw-w64 build environment. If you +are missing this, you may see "error: 'mutex' is not a member of 'std'". On +Debian, this can usually be resolved by using the posix alternate, which +supports threading. For example, choose the posix alternate from these +commands (use i686 for 32-bit): +``` +update-alternatives --config x86_64-w64-mingw32-gcc +update-alternatives --config x86_64-w64-mingw32-g++ +``` diff --git a/wine_utils/setup_dxvk.sh.in b/wine_utils/setup_dxvk.sh.in index 4b62594a..bd618a7b 100755 --- a/wine_utils/setup_dxvk.sh.in +++ b/wine_utils/setup_dxvk.sh.in @@ -16,7 +16,7 @@ else wine=wine fi -quite=false +quiet=false assume= function ask {