-
Notifications
You must be signed in to change notification settings - Fork 69
/
0001-build-macOS-Fix-up-for-macOS.patch
167 lines (144 loc) · 4.93 KB
/
0001-build-macOS-Fix-up-for-macOS.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
From bc99a826e73e4c6641fb88deeaccd45acbfdd6e5 Mon Sep 17 00:00:00 2001
From: Gcenx <38226388+Gcenx@users.noreply.github.com>
Date: Thu, 2 Jun 2022 21:18:32 -0400
Subject: [PATCH 1/3] [build-macOS] Fix up for macOS
---
meson_options.txt | 2 +-
package-release.sh | 11 +++++------
setup_dxvk.sh | 48 +++++++++-------------------------------------
3 files changed, 15 insertions(+), 46 deletions(-)
diff --git a/meson_options.txt b/meson_options.txt
index 2a4b5b4f..f27a2e93 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,5 @@
option('enable_tests', type : 'boolean', value : false)
option('enable_dxgi', type : 'boolean', value : true, description: 'Build DXGI')
-option('enable_d3d9', type : 'boolean', value : true, description: 'Build D3D9')
+option('enable_d3d9', type : 'boolean', value : false, description: 'Build D3D9')
option('enable_d3d10', type : 'boolean', value : true, description: 'Build D3D10')
option('enable_d3d11', type : 'boolean', value : true, description: 'Build D3D11')
diff --git a/package-release.sh b/package-release.sh
index 3f5d9a4c..e8585500 100755
--- a/package-release.sh
+++ b/package-release.sh
@@ -10,9 +10,9 @@ if [ -z "$1" ] || [ -z "$2" ]; then
fi
DXVK_VERSION="$1"
-DXVK_SRC_DIR=`dirname $(readlink -f $0)`
-DXVK_BUILD_DIR=$(realpath "$2")"/dxvk-$DXVK_VERSION"
-DXVK_ARCHIVE_PATH=$(realpath "$2")"/dxvk-$DXVK_VERSION.tar.gz"
+DXVK_SRC_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
+DXVK_BUILD_DIR=${2}"/dxvk-macOS-$DXVK_VERSION"
+DXVK_ARCHIVE_PATH=${2}"/dxvk-macOS-$DXVK_VERSION.tar.gz"
if [ -e "$DXVK_BUILD_DIR" ]; then
echo "Build directory $DXVK_BUILD_DIR already exists"
@@ -74,12 +74,11 @@ function build_script {
function package {
cd "$DXVK_BUILD_DIR/.."
- tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-$DXVK_VERSION"
- rm -R "dxvk-$DXVK_VERSION"
+ tar -czf "$DXVK_ARCHIVE_PATH" "dxvk-macOS-$DXVK_VERSION"
+ rm -R "dxvk-macOS-$DXVK_VERSION"
}
build_arch 64
-build_arch 32
build_script
if [ $opt_nopackage -eq 0 ]; then
diff --git a/setup_dxvk.sh b/setup_dxvk.sh
index a9105f75..bf3e759e 100755
--- a/setup_dxvk.sh
+++ b/setup_dxvk.sh
@@ -1,11 +1,10 @@
#!/bin/bash
# default directories
-dxvk_lib32=${dxvk_lib32:-"x32"}
dxvk_lib64=${dxvk_lib64:-"x64"}
# figure out where we are
-basedir=$(dirname "$(readlink -f $0)")
+basedir="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
# figure out which action to perform
action="$1"
@@ -53,20 +52,15 @@ fi
# find wine executable
export WINEDEBUG=-all
-wine="wine"
-wine64="wine64"
-wineboot="wineboot"
+wine="wine64"
+wineboot="wine64 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
+wow64=false
# resolve 32-bit and 64-bit system32 path
winever=$($wine --version | grep wine)
@@ -79,21 +73,17 @@ fi
# if they are missing
$wineboot -u
-win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
+win64_sys_path=$($wine 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
+if [ -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
+ $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native,builtin /f >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "Failed to add override for $1"
exit 1
@@ -168,32 +158,14 @@ uninstallFile() {
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
+ overrideDll "$1"
}
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
+ restoreDll "$1"
}
# skip dxgi during install if not explicitly
@@ -202,8 +174,6 @@ if $with_dxgi || [ "$action" == "uninstall" ]; then
$action dxgi
fi
-$action d3d9
-
if $with_d3d10 || [ "$action" == "uninstall" ]; then
$action d3d10
$action d3d10_1
--
2.32.0 (Apple Git-132)