vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.71k stars 274 forks source link

Build failure on macOS 13 due to fuzzy gettext patch file #781

Closed ryandesign closed 1 year ago

ryandesign commented 1 year ago

It was reported to MacPorts that poedit 3.2.2 doesn't build under macOS 13. The error is:

patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
patching file 'gettext-runtime/configure'
patch: **** misordered hunks! output would be garbled
FAILED: /path/to/poedit-3.2.2/build/Deps.build/Release/_intermediate.x86_64/gettext.done 

macOS 13 has a different version of the patch program that we have found is less forgiving of fuzzy patches than the patch in macOS 12 and earlier. Under macOS 10.15 it builds fine but I see that your two gettext patches were made for gettext 0.20.1 and 0.20.2 and one of the patches only applies to 0.21.1 with fuzz:

$ cd gettext-0.21.1
$ patch -p1 < /path/to/poedit-3.2.2/deps/gettext/gettext-macos-catalina-dont-touch-parent-dirs.patch
patching file gettext-runtime/configure
Hunk #1 succeeded at 25602 with fuzz 2 (offset 4875 lines).
Hunk #2 succeeded at 25638 with fuzz 2 (offset 4877 lines).
Hunk #3 succeeded at 26149 with fuzz 2 (offset 4965 lines).
Hunk #4 succeeded at 26185 with fuzz 2 (offset 4967 lines).
patching file gettext-runtime/m4/intlmacosx.m4
patching file gettext-tools/configure
Hunk #1 succeeded at 28356 with fuzz 2 (offset 5086 lines).
Hunk #2 succeeded at 28392 with fuzz 2 (offset 5088 lines).
Hunk #3 succeeded at 28903 with fuzz 2 (offset 5176 lines).
Hunk #4 succeeded at 28939 with fuzz 2 (offset 5178 lines).

I believe regenerating the patch files to apply cleanly to gettext 0.21.1 will solve the problem. I'm testing that now and will send a PR if it works. Please regenerate the patch files to apply cleanly anytime you update to a new version of gettext.