summarylogtreecommitdiffstats
path: root/proton-unfuck_makefile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'proton-unfuck_makefile.patch')
-rw-r--r--proton-unfuck_makefile.patch264
1 files changed, 264 insertions, 0 deletions
diff --git a/proton-unfuck_makefile.patch b/proton-unfuck_makefile.patch
new file mode 100644
index 000000000000..36431eb4c4d4
--- /dev/null
+++ b/proton-unfuck_makefile.patch
@@ -0,0 +1,264 @@
+diff --git a/build/makefile_base.mak b/build/makefile_base.mak
+index 57ca0fb..6b913fe 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
+
+@@ -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)
+
+@@ -409,6 +409,9 @@ endif # ifeq ($(CONTAINER),)
+ ##
+
+ GST_COMMON_MESON_ARGS := \
++ -Db_lto=true \
++ -Db_pie=true \
++ -Ddoc=disabled \
+ -Dexamples=disabled \
+ -Dtests=disabled \
+ -Dgtk_doc=disabled \
+@@ -421,6 +424,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))
+@@ -437,6 +441,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
+@@ -475,6 +482,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
+@@ -536,6 +544,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
+@@ -674,8 +683,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
+@@ -804,17 +819,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/
+@@ -844,7 +860,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 5369fb4..21db917 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 --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 --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/