PKGBUILDS/proton-ge-custom/proton-sanitize_makefile.patch
2022-02-19 08:39:14 -06:00

318 lines
12 KiB
Diff

diff --git a/build/makefile_base.mak b/build/makefile_base.mak
index dc52210f..dcfca71c 100755
--- a/build/makefile_base.mak
+++ b/build/makefile_base.mak
@@ -62,7 +62,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
@@ -120,7 +119,7 @@ container-build:
all32 $(MAKECMDGOALS32): container-build
all64 $(MAKECMDGOALS64): container-build
else
-J = $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS)))
+J = $(patsubst -j%,%,$(SUBJOBS))
endif
@@ -170,11 +169,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
##
@@ -359,8 +359,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)
@@ -413,6 +413,9 @@ endif # ifeq ($(CONTAINER),)
##
GST_COMMON_MESON_ARGS := \
+ -Db_lto=true \
+ -Db_pie=true \
+ -Ddoc=disabled \
-Dexamples=disabled \
-Dtests=disabled \
-Dgtk_doc=disabled \
@@ -425,6 +428,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))
@@ -441,6 +445,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
@@ -477,6 +484,8 @@ GST_BASE_MESON_ARGS := \
-Dx11=disabled \
-Dxshm=disabled \
-Dxvideo=disabled \
+ -Dtools=disabled \
+ -Dpackage-name="GStreamer Base Plugins (Proton)" \
$(GST_COMMON_MESON_ARGS)
GST_BASE_DEPENDS = gst_orc gstreamer
@@ -540,7 +549,8 @@ GST_GOOD_MESON_ARGS := \
-Dwavenc=disabled \
-Dximagesrc=disabled \
-Dy4m=enabled \
- -Ddoc='disabled' \
+ -Dtools=disabled \
+ -Dpackage-name="GStreamer Good Plugins (Proton)" \
$(GST_COMMON_MESON_ARGS)
GST_GOOD_DEPENDS = gst_orc gstreamer gst_base
@@ -575,6 +585,9 @@ GST_BAD_MESON_ARGS := \
-Dopencv=disabled \
-Dvoamrwbenc=disabled \
-Dx265=disabled \
+ -Dopenexr=disabled \
+ -Dtools=disabled \
+ -Dpackage-name="GStreamer Bad Plugins (Proton)" \
$(GST_COMMON_MESON_ARGS)
GST_BAD_DEPENDS = gst_orc gstreamer gst_base
@@ -590,6 +603,8 @@ $(eval $(call rules-meson,gst_bad,64))
GST_UGLY_MESON_ARGS := \
-Ddoc='disabled' \
+ -Dtools='disabled' \
+ -Dpackage-name="GStreamer Ugly Plugins (Proton)" \
$(GST_COMMON_MESON_ARGS)
GST_UGLY_DEPENDS = gst_orc gstreamer gst_base
@@ -605,6 +620,9 @@ $(eval $(call rules-meson,gst_ugly,64))
GST_LIBAV_MESON_ARGS := \
-Ddoc=disabled \
+ -Dtools=disabled \
+ --force-fallback-for=FFmpeg \
+ -Dpackage-name="GStreamer FFmpeg Plugin (Proton)" \
$(GST_COMMON_MESON_ARGS)
GST_LIBAV_DEPENDS = gst_orc gstreamer gst_base
@@ -768,8 +786,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
@@ -824,16 +848,6 @@ $(OBJ)/.vrclient-post-source:
mkdir -p $(VRCLIENT_OBJ64) && cp -a $(VRCLIENT_SRC)/vrclient_x64/vrclient_x64.spec $(VRCLIENT_OBJ64)/vrclient_x64.spec
touch $@
-##
-## xkbcommon -- needed for wayland support in wome
-##
-
-XKBCOMMON_MESON_ARGS := \
- -Denable-docs='false'
-
-$(eval $(call rules-source,xkbcommon,$(SRCDIR)/xkbcommon))
-$(eval $(call rules-meson,xkbcommon,32))
-$(eval $(call rules-meson,xkbcommon,64))
##
@@ -843,6 +857,9 @@ $(eval $(call rules-meson,xkbcommon,64))
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))
@@ -865,6 +882,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))
@@ -928,10 +948,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/make/rules-autoconf.mk b/make/rules-autoconf.mk
index 0827caa9..4e6d19f2 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 2dbfe75f..6afbc42c 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 "$$(CARGO_TARGET_$(3))" --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 "$$(CARGO_TARGET_$(3))" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG)
touch $$@
endif
endef
diff --git a/make/rules-cmake.mk b/make/rules-cmake.mk
index 0e18df97..2150cba8 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 bc407604..c3a7dbeb 100644
--- a/make/rules-common.mk
+++ b/make/rules-common.mk
@@ -125,8 +125,12 @@ $(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;mscoree=d;mshtml=d" \
CARGO_HOME=$$(OBJ)/.cargo \
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" \
@@ -140,7 +144,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" \
@@ -164,7 +168,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
@@ -177,14 +181,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
$(OBJ)/.%-post-build32:
diff --git a/make/rules-meson.mk b/make/rules-meson.mk
index d603bfde..f798edfc 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 25c4dd33..fb6ebc4d 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"
ifeq ($(3),32)