summarylogtreecommitdiffstats
path: root/proton-sanitize_makefile.patch
blob: ecb206c2220454d0f56e0b1b6647e1a50bbd5981 (plain)
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
diff --git a/build/makefile_base.mak b/build/makefile_base.mak
index e07c04c..9450c6b 100644
--- a/build/makefile_base.mak
+++ b/build/makefile_base.mak
@@ -63,7 +63,6 @@ ifeq ($(ENABLE_CCACHE),1)
 	export CCACHE_DIR := $(if $(CCACHE_DIR),$(CCACHE_DIR),$(HOME)/.ccache)
 	DOCKER_OPTS := -v $(CCACHE_DIR):$(CCACHE_DIR)$(CONTAINER_MOUNT_OPTS) $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS)
 else
-	export CCACHE_DISABLE := 1
 	DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS)
 endif
 
@@ -121,7 +120,7 @@ container-build:
 all32 $(MAKECMDGOALS32): container-build
 all64 $(MAKECMDGOALS64): container-build
 else
-J = $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS)))
+J = $(patsubst -j%,%,$(SUBJOBS))
 endif
 
 
@@ -171,7 +170,8 @@ else
 endif
 
 CROSSLDFLAGS   += -Wl,--file-alignment,4096
-OPTIMIZE_FLAGS := -O2 -march=nocona -mtune=core-avx2 -mfpmath=sse
+CFLAGS         ?= -O2 -march=nocona -mtune=core-avx2
+OPTIMIZE_FLAGS := $(CFLAGS) -mfpmath=sse
 SANITY_FLAGS   := -fwrapv -fno-strict-aliasing
 DEBUG_FLAGS    := -gdwarf-2 -gstrict-dwarf
 COMMON_FLAGS    = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS) $(SANITY_FLAGS) -ffile-prefix-map=$(CCACHE_BASEDIR)=.
@@ -356,8 +356,8 @@ ALL_TARGETS += dist
 GOAL_TARGETS += dist
 
 dist_prefix: wine gst_good
-	find $(DST_LIBDIR32)/wine -type f -execdir chmod a-w '{}' '+'
-	find $(DST_LIBDIR64)/wine -type f -execdir chmod a-w '{}' '+'
+	find $(DST_LIBDIR32)/wine -type f -execdir chmod go-w '{}' '+'
+	find $(DST_LIBDIR64)/wine -type f -execdir chmod go-w '{}' '+'
 	rm -rf $(abspath $(DIST_PREFIX))
 	python3 $(SRCDIR)/default_pfx.py $(abspath $(DIST_PREFIX)) $(abspath $(DST_DIR)) $(STEAM_RUNTIME_RUNSH)
 
@@ -410,6 +410,9 @@ endif # ifeq ($(CONTAINER),)
 ##
 
 GST_COMMON_MESON_ARGS := \
+	-Db_lto=true \
+	-Db_pie=true \
+	-Ddoc=disabled \
 	-Dexamples=disabled \
 	-Dtests=disabled \
 	-Dgtk_doc=disabled \
@@ -422,6 +425,7 @@ GST_COMMON_MESON_ARGS := \
 
 GST_ORC_MESON_ARGS := \
 	-Dorc-test=disabled \
+	-Dpackage-name="GStreamer Orc (Proton)" \
 	$(GST_COMMON_MESON_ARGS)
 
 $(eval $(call rules-source,gst_orc,$(SRCDIR)/gst-orc))
@@ -438,6 +442,9 @@ GSTREAMER_MESON_ARGS := \
 	-Dbenchmarks=disabled \
 	-Dtools=disabled \
 	-Dbash-completion=disabled \
+	-Dptp-helper-permissions=capabilities \
+	-Ddbghelp=disabled \
+	-Dpackage-name="GStreamer (Proton)" \
 	$(GST_COMMON_MESON_ARGS)
 
 GSTREAMER_DEPENDS = gst_orc
@@ -476,6 +483,7 @@ GST_BASE_MESON_ARGS := \
 	-Dxshm=disabled \
 	-Dxvideo=disabled \
 	-Dtools=disabled \
+	-Dpackage-name="GStreamer Base Plugins (Proton)" \
 	$(GST_COMMON_MESON_ARGS)
 
 GST_BASE_DEPENDS = gst_orc gstreamer
@@ -537,6 +545,7 @@ GST_GOOD_MESON_ARGS := \
 	-Dximagesrc=disabled \
 	-Dy4m=disabled \
 	-Dtools=disabled \
+	-Dpackage-name="GStreamer Good Plugins (Proton)" \
 	$(GST_COMMON_MESON_ARGS)
 
 GST_GOOD_DEPENDS = gst_orc gstreamer gst_base
@@ -680,8 +689,14 @@ WINE_SOURCE_ARGS = \
   --exclude include/config.h.in \
 
 WINE_CONFIGURE_ARGS = \
+  --with-x \
+  --with-gstreamer \
+  --with-faudio \
   --with-mingw \
   --without-xpresent \
+  --without-vkd3d \
+  --without-oss \
+  --disable-win16 \
   --disable-tests
 
 WINE_CONFIGURE_ARGS64 = --enable-win64
@@ -810,17 +825,18 @@ VKD3D_CONFIGURE_ARGS = \
   --disable-tests \
   --disable-demos \
   --without-ncurses \
-  WIDL=$(WINE_OBJ64)/tools/widl/widl
 
 VKD3D_CONFIGURE_ARGS32 = \
   --host=i686-w64-mingw32 \
   CC="$(CCACHE_BIN) i686-w64-mingw32-gcc" \
   LD="i686-w64-mingw32-ld" \
+  WIDL=$(WINE_OBJ32)/tools/widl/widl
 
 VKD3D_CONFIGURE_ARGS64 = \
   --host=x86_64-w64-mingw32 \
   CC="$(CCACHE_BIN) x86_64-w64-mingw32-gcc" \
   LD="x86_64-w64-mingw32-ld" \
+  WIDL=$(WINE_OBJ64)/tools/widl/widl
 
 VKD3D_LDFLAGS = -static-libgcc $(CROSSLDFLAGS)
 VKD3D_LDFLAGS32 = -L$(WINE_OBJ32)/dlls/vulkan-1/
@@ -850,7 +866,7 @@ VKD3D_PROTON_SOURCE_ARGS = \
   --exclude vkd3d_build.h.in \
   --exclude vkd3d_version.h.in \
 
-VKD3D_PROTON_MESON_ARGS = -Denable_standalone_d3d12=true
+VKD3D_PROTON_MESON_ARGS = -Denable_d3d12=true
 VKD3D_PROTON_MESON_ARGS32 = \
     --bindir=$(VKD3D_PROTON_DST32)/lib/wine/vkd3d-proton \
     --cross-file=$(VKD3D_PROTON_OBJ32)/build-win32.txt
diff --git a/make/rules-autoconf.mk b/make/rules-autoconf.mk
index 6567f05..cb41249 100644
--- a/make/rules-autoconf.mk
+++ b/make/rules-autoconf.mk
@@ -21,8 +21,8 @@ $$(OBJ)/.$(1)-configure$(3): $$(OBJ)/.$(1)-pre-configure
 	    --prefix="$$($(2)_DST$(3))" \
 	    --libdir="$$($(2)_DST$(3))/lib$(subst 32,,$(3))" \
 	    $$($(2)_ENV$(3)) \
-	    CROSSCFLAGS="$$(COMMON_FLAGS)" \
-	    CROSSCXXFLAGS="$$(COMMON_FLAGS) -std=c++17" \
+	    CROSSCFLAGS="$$(COMMON_FLAGS) -fno-builtin-sin -fno-builtin-sinf -fno-builtin-cos -fno-builtin-cosf" \
+	    CROSSCXXFLAGS="$$(COMMON_FLAGS) -fno-builtin-sin -fno-builtin-sinf -fno-builtin-cos -fno-builtin-cosf -std=c++17" \
 	    CROSSLDFLAGS="$$(CROSSLDFLAGS)" \
 	    $$($(2)_CONFIGURE_ARGS) \
 	    $$($(2)_CONFIGURE_ARGS$(3))
@@ -32,9 +32,9 @@ $$(OBJ)/.$(1)-configure$(3): $$(OBJ)/.$(1)-pre-configure
 $$(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
-	$$(MAKE)
+	$$(MAKE) -j$$(SUBJOBS)
 	cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
-	$$(MAKE) install
+	$$(MAKE) -j$$(SUBJOBS) install
 	touch $$@
 endif
 endef
diff --git a/make/rules-cargo.mk b/make/rules-cargo.mk
index 36ec054..91d8cf0 100644
--- a/make/rules-cargo.mk
+++ b/make/rules-cargo.mk
@@ -14,7 +14,9 @@ $(OBJ)/.$(1)-configure$(3):
 $(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
-	cargo build $$(filter -j%,$$(MAKEFLAGS)) --target "$$(ARCH$(3))-unknown-linux-gnu" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG)
+	cargo update --offline --verbose
+	cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
+	cargo build -j$$(SUBJOBS) --locked --offline --verbose --target "$$(ARCH$(3))-unknown-linux-gnu" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG)
 	touch $$@
 endif
 endef
diff --git a/make/rules-cmake.mk b/make/rules-cmake.mk
index 4c61951..3a31610 100644
--- a/make/rules-cmake.mk
+++ b/make/rules-cmake.mk
@@ -15,7 +15,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt
 	cmake "$$($(2)_SRC)" \
 	    -DCMAKE_INSTALL_PREFIX="$$($(2)_DST$(3))" \
 	    -DCMAKE_INSTALL_LIBDIR="lib$(subst 32,,$(3))" \
-	    -DCMAKE_BUILD_TYPE=plain \
+	    -DCMAKE_BUILD_TYPE=Release \
 	    $$($(2)_CMAKE_ARGS) \
 	    $$($(2)_CMAKE_ARGS$(3))
 
@@ -24,9 +24,9 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt
 $$(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
-	$$(MAKE)
+	$$(MAKE) -j$$(SUBJOBS)
 	cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \
-	$$(MAKE) install
+	$$(MAKE) -j$$(SUBJOBS) install
 	touch $$@
 endif
 endef
diff --git a/make/rules-common.mk b/make/rules-common.mk
index 083655b..28d7785 100644
--- a/make/rules-common.mk
+++ b/make/rules-common.mk
@@ -108,18 +108,22 @@ CONTAINERGOALS := $(CONTAINERGOALS) $(filter $(1),$(MAKECMDGOALS))
 
 
 $(2)_ENV$(3) = \
+    WINEDEBUG="-all" \
+    WINEPREFIX="$$(OBJ)/pfx-wine$(3)" \
+    WINEDLLOVERRIDES="winemenubuilder=d;mscoree=d;mshtml=d" \
     CARGO_HOME=$$(OBJ)/.cargo \
-    CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_LINKER="$$(ARCH$(3))-linux-gnu-gcc" \
+    CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_LINKER="gcc" \
+    CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_RUSTFLAGS="$$(RUSTFLAGS)" \
     CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \
     STRIP="$$(STRIP)" \
-    CC="$$(CCACHE_BIN) $$(ARCH$(3))-linux-gnu-gcc" \
-    CXX="$$(CCACHE_BIN) $$(ARCH$(3))-linux-gnu-g++" \
+    CC="$$(CCACHE_BIN) gcc -m$(3)" \
+    CXX="$$(CCACHE_BIN) g++ -m$(3)" \
     LD="$$(ARCH$(3))-linux-gnu-ld" \
-    PKG_CONFIG="$$(ARCH$(3))-linux-gnu-pkg-config" \
+    PKG_CONFIG="$$(ARCH$(3))-pc-linux-gnu-pkg-config" \
     CROSSCC="$$(CCACHE_BIN) $$(ARCH$(3))-w64-mingw32-gcc" \
     CROSSCXX="$$(CCACHE_BIN) $$(ARCH$(3))-w64-mingw32-g++" \
     CROSSLD="$$(ARCH$(3))-w64-mingw32-ld" \
-    CROSSPKG_CONFIG="$$(ARCH$(3))-linux-gnu-pkg-config" \
+    CROSSPKG_CONFIG="$$(ARCH$(3))-pc-linux-gnu-pkg-config" \
     PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_BINDIR$(3))),,:):$$(SRC)/glslang/bin:$$$$PATH" \
     LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))),,:)$$$$LD_LIBRARY_PATH" \
     PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))/pkgconfig))" \
diff --git a/make/rules-meson.mk b/make/rules-meson.mk
index 7b982fa..8e08128 100644
--- a/make/rules-meson.mk
+++ b/make/rules-meson.mk
@@ -11,7 +11,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build
 	@echo ":: configuring $(3)bit $(1)..." >&2
 	rm -rf "$$($(2)_OBJ$(3))/meson-private/coredata.dat"
 
-	grep -s -v -e c_args -e cpp_args -e link_args "$$($(2)_SRC)/build-win$(3).txt" | \
+	grep -s -v -e c_args -e cpp_args "$$($(2)_SRC)/build-win$(3).txt" | \
 	sed -e "s:\[properties\]:[properties]\nc_args = [$$(call list-quote,$$(COMMON_FLAGS))]:" \
 	    -e "s:\[properties\]:[properties]\ncpp_args = [$$(call list-quote,$$(COMMON_FLAGS))]:" \
 	    -e "s:\[properties\]:[properties]\nlink_args = [$$(call list-quote,$$(CROSSLDFLAGS))]:" \
@@ -21,7 +21,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build
 	meson "$$($(2)_OBJ$(3))" "$$($(2)_SRC)" \
 	      --prefix="$$($(2)_DST$(3))" \
 	      --libdir="lib$(subst 32,,$(3))" \
-	      --buildtype=plain \
+	      --buildtype=release \
 	      $$($(2)_MESON_ARGS) \
 	      $$($(2)_MESON_ARGS$(3)) \
 	      $$(MESON_STRIP_ARG)
@@ -31,7 +31,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build
 $$(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	env $$($(2)_ENV$(3)) \
-	ninja $$(filter -j%,$$(MAKEFLAGS)) -C "$$($(2)_OBJ$(3))" install $(-v?)
+	ninja -j$$(SUBJOBS) -C "$$($(2)_OBJ$(3))" install $(-v?)
 	touch $$@
 endif
 endef
diff --git a/make/rules-winemaker.mk b/make/rules-winemaker.mk
index 8a0f0ce..36a107c 100644
--- a/make/rules-winemaker.mk
+++ b/make/rules-winemaker.mk
@@ -29,7 +29,7 @@ $(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	rsync -arx "$$($(2)_SRC)/" "$$($(2)_OBJ$(3))/"
 	env $$($(2)_ENV$(3)) \
-	$$(MAKE) -C "$$($(2)_OBJ$(3))" LIBRARIES="$$($(2)_LDFLAGS)"
+	$$(MAKE) -j$$(SUBJOBS) -C "$$($(2)_OBJ$(3))" LIBRARIES="$$($(2)_LDFLAGS)"
 	cd "$$($(2)_OBJ$(3))" && touch "$(basename $(4)).spec" && env $$($(2)_ENV$(3)) \
 	winebuild --dll --fake-module -E "$(basename $(4)).spec" -o "$(4).fake"
 	mkdir -p $$($(2)_DST$(3))/lib$(subst 32,,$(3))/wine/fakedlls/