Applying a patch from GitHub to a formula when the source archive uses different paths? #2706
-
I'm looking to create a pull request for sdl2_mixer.rb to fix libsdl-org/SDL_mixer@6160668 since there's a use-after-free bug in the latest released version that's been patched in the tree upstream. However, pulling the patch directly from GitHub in the formula fails, since the source archive at https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-2.0.4.tar.gz has the source file in a different path. Instead of being at Here's what I have for changes so far, in case it helps:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Under the hood, the
Based on this, I think your patch could apply with patch :p3 do
url "https://github.com/libsdl-org/SDL_mixer/commit/6160668079f91d57a5d7bf0b40ffdd843be70daf.patch?full_index=1"
sha256 "73e5ebf9136818b7a65f1e8fcbeb99c350654d7d9e53629adc26887e9e169d8d"
end There's also an example of a similar use in the |
Beta Was this translation helpful? Give feedback.
Under the hood, the
patch
mechanism in Homebrew uses thepatch
command line tool. Of interest in your case is this command line flag for thepatch
tool: