diff --git a/build/Containerfile.proton b/build/Containerfile.proton index a8721017..172eea6f 100644 --- a/build/Containerfile.proton +++ b/build/Containerfile.proton @@ -110,6 +110,18 @@ RUN pacman -Syu --noconfirm --needed \ libsm libtheora xz \ && pacman -Scc --noconfirm +# Our own patches, one directory per submodule they apply to: patches/proton/ +# wine/ applies in wine/. Its own layer, after the fetch and the dependencies, +# so a patch change costs the build and nothing before it. A patch that no +# longer applies to a new tag stops here, before the hours of building. +COPY patches/proton /build/patches/proton +RUN set -e; cd /build/patches/proton; \ + for dir in */; do \ + for p in "${dir}"*.patch; do \ + echo "applying ${p}"; \ + patch -d "/build/proton-cachyos/${dir%/}" -p1 --forward < "${p}"; \ + done; \ + done COPY scripts/proton-build.sh /build/proton-build.sh RUN GECKO_VER="${GECKO_VER}" MONO_VER="${MONO_VER}" JOBS="${JOBS}" \ bash /build/proton-build.sh diff --git a/build/Makefile b/build/Makefile index d167742b..be252cfb 100644 --- a/build/Makefile +++ b/build/Makefile @@ -38,8 +38,13 @@ IMAGE_NAME := ghcr.io/nestrilabs/nestri/base # number in two spellings and an image whose name does not say which Proton is # inside it is worse than no image at all. Changing the tag by hand and # forgetting the version is exactly the mistake this removes. +# +# `PROTON_PATCHES` counts our own changes on top of that tag (patches/proton/). +# Bump it whenever they change, so a patched build never takes the name of the +# one before it; reset it to 0 when the tag moves. PROTON_TAG ?= cachyos-11.0-20261005-native -PROTON_VERSION := $(PROTON_TAG:cachyos-%-native=%) +PROTON_PATCHES ?= 1 +PROTON_VERSION := $(PROTON_TAG:cachyos-%-native=%)-n$(PROTON_PATCHES) PROTON_IMAGE ?= ghcr.io/nestrilabs/proton-cachyos-native-wow64 PROTON_REF := $(PROTON_IMAGE):$(PROTON_VERSION) OUTPUT_DIR := output diff --git a/build/patches/proton/wine/0001-ntdll-read-an-ASCII-locale-as-UTF-8.patch b/build/patches/proton/wine/0001-ntdll-read-an-ASCII-locale-as-UTF-8.patch new file mode 100644 index 00000000..50060c15 --- /dev/null +++ b/build/patches/proton/wine/0001-ntdll-read-an-ASCII-locale-as-UTF-8.patch @@ -0,0 +1,14 @@ +--- a/dlls/ntdll/unix/env.c ++++ b/dlls/ntdll/unix/env.c +@@ -286,6 +286,11 @@ + + if (!(ctype = setlocale( LC_CTYPE, "" ))) name = "UTF-8"; + else if (!(name = nl_langinfo( CODESET ))) return; ++ /* The C and POSIX locales name plain ASCII, in which a non-ASCII file ++ * name cannot be created at all. Steam starts games with LC_ALL=C, so ++ * under it every such name failed; ASCII is a subset of UTF-8, so ++ * reading it as UTF-8 changes nothing that worked before. */ ++ if (!strcmp( name, "ANSI_X3.4-1968" )) name = "UTF-8"; + TRACE_(nls)( "Unix LC_CTYPE %s, using %s codeset\n", debugstr_a(ctype), debugstr_a(name) ); + + /* remove punctuation characters from charset name */