summarylogtreecommitdiffstats
path: root/proton-sanitize_makefile.patch
blob: 144291d96a29fb730d6d615a9cc44cf759baef3e (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
274
275
276
277
278
279
280
281
diff --git a/Makefile.in b/Makefile.in
index 6cfb8c3..fd90f1e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -63,7 +63,6 @@ ifeq ($(ENABLE_CCACHE),1)
 	export CCACHE_DIR := $(if $(CCACHE_DIR),$(CCACHE_DIR),$(HOME)/.ccache)
 	override DOCKER_OPTS := -v $(CCACHE_DIR):$(CCACHE_DIR)$(CONTAINER_MOUNT_OPTS) $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS)
 else
-	export CCACHE_DISABLE := 1
 	override DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS)
 endif
 
@@ -125,7 +124,7 @@ container-build:
 all32 $(MAKECMDGOALS32): container-build
 all64 $(MAKECMDGOALS64): container-build
 else
-J = $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS)))
+J = $(patsubst -j%,%,$(SUBJOBS))
 endif
 
 
@@ -175,11 +174,12 @@ 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)=.
-COMMON_FLAGS32 := -mstackrealign
+COMMON_FLAGS32 := -mstackrealign -mno-avx
 CARGO_BUILD_ARG := --release
 
 ##
@@ -366,8 +366,8 @@ ALL_TARGETS += dist
 GOAL_TARGETS += dist
 
 dist_prefix: wine gst_good gst_libav gst_plugins_rs
-	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)
 
@@ -430,6 +430,11 @@ $(eval $(call rules-meson,dav1d,64))
 ##
 
 GST_COMMON_MESON_ARGS := \
+	-Db_lto=true \
+	-Db_pie=true \
+	-Ddoc=disabled \
+	-Dintrospection=disabled \
+	-Dgobject-cast-checks=disabled \
 	-Dorc=enabled
 
 GST_ORC_MESON_ARGS := \
@@ -450,6 +455,8 @@ GSTREAMER_MESON_ARGS := \
 	-Dbenchmarks=disabled \
 	-Dtools=disabled \
 	-Dbash-completion=disabled \
+	-Dptp-helper-permissions=capabilities \
+	-Ddbghelp=disabled \
 	$(GST_COMMON_MESON_ARGS)
 
 GSTREAMER_DEPENDS = gst_orc
@@ -691,7 +698,13 @@ WINE_SOURCE_ARGS = \
   --exclude include/config.h.in \
 
 WINE_CONFIGURE_ARGS = \
+  --with-x \
+  --with-gstreamer \
+  --with-faudio \
   --with-mingw \
+  --without-vkd3d \
+  --without-oss \
+  --disable-win16 \
   --disable-tests
 
 WINE_CONFIGURE_ARGS64 = --enable-win64
@@ -754,6 +767,9 @@ $(OBJ)/.vrclient-post-source:
 DXVK_MESON_ARGS32 = --bindir=$(DXVK_DST32)/lib/wine/dxvk
 DXVK_MESON_ARGS64 = --bindir=$(DXVK_DST64)/lib64/wine/dxvk
 
+DXVK_CPPFLAGS= -msse -msse2
+DXVK_LDFLAGS= -static -static-libgcc -static-libstdc++
+
 $(eval $(call rules-source,dxvk,$(SRCDIR)/dxvk))
 $(eval $(call rules-meson,dxvk,32,CROSS))
 $(eval $(call rules-meson,dxvk,64,CROSS))
@@ -776,6 +792,9 @@ $(OBJ)/.dxvk-post-build32:
 DXVK_NVAPI_MESON_ARGS32 = --bindir=$(DXVK_NVAPI_DST32)/lib/wine/nvapi
 DXVK_NVAPI_MESON_ARGS64 = --bindir=$(DXVK_NVAPI_DST64)/lib64/wine/nvapi
 
+DXVK_NVAPI_CPPFLAGS= -msse -msse2
+DXVK_NVAPI_LDFLAGS= -static -static-libgcc -static-libstdc++
+
 $(eval $(call rules-source,dxvk-nvapi,$(SRCDIR)/dxvk-nvapi))
 $(eval $(call rules-meson,dxvk-nvapi,32,CROSS))
 $(eval $(call rules-meson,dxvk-nvapi,64,CROSS))
@@ -839,10 +858,13 @@ 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
 VKD3D_PROTON_MESON_ARGS64 = --bindir=$(VKD3D_PROTON_DST64)/lib64/wine/vkd3d-proton
 
+VKD3D_PROTON_CPPFLAGS= -msse -msse2
+VKD3D_PROTON_LDFLAGS= -static -static-libgcc -static-libstdc++
+
 $(eval $(call rules-source,vkd3d-proton,$(SRCDIR)/vkd3d-proton))
 $(eval $(call rules-meson,vkd3d-proton,32,CROSS))
 $(eval $(call rules-meson,vkd3d-proton,64,CROSS))
diff --git a/configure.sh b/configure.sh
index 337781e..0ceabc5 100755
--- a/configure.sh
+++ b/configure.sh
@@ -126,6 +126,7 @@ function configure() {
     CONTAINER_MOUNT_OPTS=:Z
   fi
 
+  if [ "$arg_container_engine" != "none" ]; then
   if [[ -n "$arg_container_engine" ]]; then
     check_container_engine "$arg_container_engine" || die "Specified container engine \"$arg_container_engine\" doesn't work"
   else
@@ -138,6 +139,7 @@ function configure() {
         die "${arg_container_engine:-Container engine discovery} has failed. Please fix your setup."
     fi
   fi
+  fi
 
   stat "Using $arg_container_engine."
 
diff --git a/make/rules-autoconf.mk b/make/rules-autoconf.mk
index 0827caa..4e6d19f 100644
--- a/make/rules-autoconf.mk
+++ b/make/rules-autoconf.mk
@@ -31,9 +31,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 b2af34c..c132fff 100644
--- a/make/rules-cargo.mk
+++ b/make/rules-cargo.mk
@@ -14,8 +14,10 @@ $$(OBJ)/.$(1)-configure$(3):
 $$(OBJ)/.$(1)-build$(3):
 	@echo ":: building $(3)bit $(1)..." >&2
 	cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
+	cargo update --offline --verbose
+	cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
 	cargo build \
-	      $$(filter -j%,$$(MAKEFLAGS)) \
+	      -j$$(SUBJOBS) --locked --offline --verbose \
 	      --target "$$(CARGO_TARGET_$(3))" \
 	      --target-dir $$($(2)_OBJ$(3)) \
 	      $$(CARGO_BUILD_ARG) \
diff --git a/make/rules-cmake.mk b/make/rules-cmake.mk
index c70751a..1096dc1 100644
--- a/make/rules-cmake.mk
+++ b/make/rules-cmake.mk
@@ -28,9 +28,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 78f0f61..1ab144c 100644
--- a/make/rules-common.mk
+++ b/make/rules-common.mk
@@ -113,7 +113,11 @@ $(2)_LIBFLAGS$(3) = $$(foreach d,$$($(2)_DEPS$(3)),-L$$($$(d)_LIBDIR$(3))) \
 # native version doesn't exist.
 
 $(2)_ENV$(3) = \
+    WINEDEBUG="-all" \
+    WINEPREFIX="$$(OBJ)/pfx-wine$(3)" \
+    WINEDLLOVERRIDES="winemenubuilder=d;" \
     CARGO_TARGET_$$(call toupper,$$(CARGO_TARGET_$(3)))_LINKER="$$(TARGET_$(4)$(3))-gcc" \
+    CARGO_TARGET_$$(call toupper,$$(CARGO_TARGET_$(3)))_RUSTFLAGS="$$(RUSTFLAGS)" \
     CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \
     STRIP="$$(STRIP)" \
     AR="$$(TARGET_$(4)$(3))-ar" \
@@ -127,7 +131,7 @@ $(2)_ENV$(3) = \
     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))" \
-    PKG_CONFIG_LIBDIR="/usr/lib/$$(PKG_CONFIG_TARGET_$(4)$(3))/pkgconfig:/usr/share/pkgconfig" \
+    PKG_CONFIG_LIBDIR="/usr/lib$(3)/pkgconfig:/usr/share/pkgconfig" \
     CFLAGS="$$($(2)_INCFLAGS$(3)) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3))" \
     CPPFLAGS="$$($(2)_INCFLAGS$(3)) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3))" \
     CXXFLAGS="$$($(2)_INCFLAGS$(3)) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3)) -std=c++17" \
@@ -151,7 +155,7 @@ $(2)_ENV$(3) += \
     CROSSCPPFLAGS="$$($(2)_INCFLAGS$(3)) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3))" \
     CROSSCXXFLAGS="$$($(2)_INCFLAGS$(3)) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3)) -std=c++17" \
     CROSSLDFLAGS="$$($(2)_LIBFLAGS$(3)) $$($(2)_LDFLAGS$(3)) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \
-    CROSSPKG_CONFIG_LIBDIR="/usr/lib/$$(PKG_CONFIG_TARGET_CROSS$(3))/pkgconfig:/usr/share/pkgconfig" \
+    CROSSPKG_CONFIG_LIBDIR="/usr/lib$(3)/pkgconfig:/usr/share/pkgconfig" \
 
 endif
 
@@ -164,14 +168,14 @@ else
 install-strip = objcopy --file-alignment=4096 --strip-debug $(1) $(2)/$(notdir $(1)) && rm -f $(2)/$(notdir $(1)).debug
 endif
 
-TARGET_32 := i686-linux-gnu
-TARGET_64 := x86_64-linux-gnu
+TARGET_32 := i686-pc-linux-gnu
+TARGET_64 := x86_64-pc-linux-gnu
 TARGET_CROSS32 := i686-w64-mingw32
 TARGET_CROSS64 := x86_64-w64-mingw32
 
-PKG_CONFIG_TARGET_32 := i386-linux-gnu
-PKG_CONFIG_TARGET_64 := x86_64-linux-gnu
-PKG_CONFIG_TARGET_CROSS32 := i386-w64-mingw32
+PKG_CONFIG_TARGET_32 := i686-pc-linux-gnu
+PKG_CONFIG_TARGET_64 := x86_64-pc-linux-gnu
+PKG_CONFIG_TARGET_CROSS32 := i686-w64-mingw32
 PKG_CONFIG_TARGET_CROSS64 := x86_64-w64-mingw32
 
 LIBDIR_WINE_32 := wine/i386-unix
diff --git a/make/rules-configure.mk b/make/rules-configure.mk
index d04a3c5..18ac684 100644
--- a/make/rules-configure.mk
+++ b/make/rules-configure.mk
@@ -26,9 +26,9 @@ $$(OBJ)/.$(1)-configure$(3):
 $$(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-meson.mk b/make/rules-meson.mk
index d603bfd..f798edf 100644
--- a/make/rules-meson.mk
+++ b/make/rules-meson.mk
@@ -60,7 +60,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 69688a0..1c0d1d3 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 --$(lastword $(subst ., ,$(4))) --fake-module -E "$(basename $(4)).spec" -o "$(4).fake"
 	mkdir -p $$($(2)_LIBDIR$(3))/$(LIBDIR_WINE_$(3))