mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-07-30 17:11:38 +03:00
build: Fixup PE section headers.
For FH4.
This commit is contained in:
parent
4ae50536c6
commit
71342e4fb5
7
Makefile
7
Makefile
@ -145,6 +145,7 @@ module: configure
|
|||||||
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
|
||||||
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib/wine/ && \
|
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib/wine/ && \
|
||||||
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/wine/ && \
|
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/wine/ && \
|
||||||
|
find /vagrant/$(module)/ -type f -name "*.dll" -printf "%p\0" | xargs --verbose -0 -r -P8 -n3 proton/make/pefixup.py && \
|
||||||
if [ -e $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so ]; then \
|
if [ -e $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so ]; then \
|
||||||
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module).so /vagrant/$(module)/lib/wine/ && \
|
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module).so /vagrant/$(module)/lib/wine/ && \
|
||||||
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so /vagrant/$(module)/lib64/wine/; \
|
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so /vagrant/$(module)/lib64/wine/; \
|
||||||
@ -156,14 +157,16 @@ dxvk: configure
|
|||||||
mkdir -p vagrant_share/dxvk/lib64/wine/dxvk/
|
mkdir -p vagrant_share/dxvk/lib64/wine/dxvk/
|
||||||
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
|
||||||
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \
|
||||||
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/'
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/ && \
|
||||||
|
find /vagrant/dxvk/ -type f -name "*.dll" -printf "%p\0" | xargs --verbose -0 -r -P8 -n3 proton/make/pefixup.py'
|
||||||
|
|
||||||
vkd3d-proton: configure
|
vkd3d-proton: configure
|
||||||
mkdir -p vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton/
|
mkdir -p vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton/
|
||||||
mkdir -p vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton/
|
mkdir -p vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton/
|
||||||
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
|
||||||
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \
|
||||||
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/'
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/ && \
|
||||||
|
find /vagrant/vkd3d-proton/ -type f -name "*.dll" -printf "%p\0" | xargs --verbose -0 -r -P8 -n3 proton/make/pefixup.py'
|
||||||
|
|
||||||
lsteamclient: configure
|
lsteamclient: configure
|
||||||
mkdir -p vagrant_share/lsteamclient/lib/wine
|
mkdir -p vagrant_share/lsteamclient/lib/wine
|
||||||
|
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@ -77,7 +77,7 @@ Vagrant.configure(2) do |config|
|
|||||||
#install host build-time dependencies
|
#install host build-time dependencies
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y ccache texinfo gpgv2 gnupg2 git docker-ce docker-ce-cli containerd.io \
|
apt-get install -y ccache texinfo gpgv2 gnupg2 git docker-ce docker-ce-cli containerd.io \
|
||||||
fontforge-nox python-debian python-pip
|
fontforge-nox python-debian python-pip python3-pefile
|
||||||
|
|
||||||
#install adobe font devkit to build source san hans
|
#install adobe font devkit to build source san hans
|
||||||
pip install afdko
|
pip install afdko
|
||||||
|
27
make/pefixup.py
Executable file
27
make/pefixup.py
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import stat
|
||||||
|
import pefile
|
||||||
|
|
||||||
|
for path in sys.argv[1:]:
|
||||||
|
pe = pefile.PE(path)
|
||||||
|
|
||||||
|
for section in pe.sections:
|
||||||
|
if section.Name.decode("utf-8")[0:5] == ".text":
|
||||||
|
section.Characteristics &= ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_CNT_INITIALIZED_DATA']
|
||||||
|
section.Characteristics &= ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_ALIGN_MASK']
|
||||||
|
|
||||||
|
pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum()
|
||||||
|
|
||||||
|
perm = stat.S_IMODE(os.stat(path).st_mode)
|
||||||
|
if (perm & stat.S_IWUSR) == 0:
|
||||||
|
os.chmod(path, perm | stat.S_IWUSR)
|
||||||
|
|
||||||
|
pe.write(path)
|
||||||
|
|
||||||
|
if (perm & stat.S_IWUSR) == 0:
|
||||||
|
os.chmod(path, perm)
|
||||||
|
|
||||||
|
print("Fixed up PE: ", path)
|
@ -82,6 +82,14 @@ endif
|
|||||||
$(1)-dist$(3): $$(OBJ)/.$(1)-dist$(3)
|
$(1)-dist$(3): $$(OBJ)/.$(1)-dist$(3)
|
||||||
.INTERMEDIATE: $(1)-dist$(3)
|
.INTERMEDIATE: $(1)-dist$(3)
|
||||||
|
|
||||||
|
ifeq ($(CONTAINER),)
|
||||||
|
$(1)-dist$(3): $$(OBJ)/.$(1)-fixup$(3)
|
||||||
|
$$(OBJ)/.$(1)-fixup$(3): $$(OBJ)/.$(1)-dist$(3)
|
||||||
|
cd $$($(2)_LIBDIR$(3)) && find -type f -name '*.dll' -printf '$$(DST_LIBDIR$(3))/%p\0' | xargs --verbose -0 -r -P8 -n3 $$(SRC)/make/pefixup.py
|
||||||
|
touch $$@
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
all-dist$(3) $(1)-dist: $(1)-dist$(3)
|
all-dist$(3) $(1)-dist: $(1)-dist$(3)
|
||||||
.PHONY: all-dist$(3) $(1)-dist
|
.PHONY: all-dist$(3) $(1)-dist
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user