"Hunk #5 FAILED at 2001." when upgrading wine through homebrew I get this error message when I am trying to update from wine-3.13 to 4.0-rc5.

$ brew upgrade wine
==&gt; Upgrading 1 outdated package:
wine 3.13 -&gt; 4.0-rc5
==&gt; Upgrading wine 
==&gt; Downloading https://homebrew.bintray.com/bottles/wine-4.0-rc5.sierra.bottle.tar.gz

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "wine"
Download failed: https://homebrew.bintray.com/bottles/wine-4.0-rc5.sierra.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==&gt; Downloading https://dl.winehq.org/wine/source/4.0/wine-4.0-rc5.tar.xz
Already downloaded: /Users/gustaf/Library/Caches/Homebrew/downloads/9d4ffd92524540ca171b332f4f0281eb7a689da4560e3bda8029ba8533db61e9--wine-4.0-rc5.tar.xz
==&gt; Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/74c2566/wine/2.14.patch
Already downloaded: /Users/gustaf/Library/Caches/Homebrew/downloads/d06acb9dce25009cf81be12fbb50a415406c5fd03a8a43d719fe8f9ba43321b5--2.14.patch
==&gt; Patching
==&gt; Applying 2.14.patch
patching file dlls/wined3d/context.c
Hunk #1 succeeded at 1647 (offset 216 lines).
Hunk #2 succeeded at 1676 (offset 216 lines).
Hunk #3 succeeded at 1699 (offset 216 lines).
Hunk #4 succeeded at 1727 (offset 216 lines).
Hunk #5 FAILED at 2001.
1 out of 5 hunks FAILED -- saving rejects to file dlls/wined3d/context.c.rej
Error: Failure while executing; `patch -g 0 -f -p1 -i /private/tmp/wine--patch-20190110-22169-zpas8/2.14.patch` exited with 1.


What does this mean, and how can I fix it so that I can update wine? I am using Xcode 9.
I was able to solve it by deleting these lines:

# Patch to fix screen-flickering issues. Still relevant on 3.0.
# https://bugs.winehq.org/show_bug.cgi?id=34166
patch do
  url "https://raw.githubusercontent.com/Homebrew/formula-patches/74c2566/wine/2.14.patch"
  sha256 "6907471d18996ada60cc0cbc8462a1698e90720c0882846dfbfb163e5d3899b8"
end


in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/wine.rb. Take note that, as the comment states, "screen-flickering issues" may be present when this patch is not applied.