Skip to content

Commit

Permalink
sdl2: fix tests' resource paths
Browse files Browse the repository at this point in the history
SDL2's test binaries reference sample resources, expecting them to be
in the working directory. This patches them to instead seek them out in
the share directory.

Closes #8834.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
  • Loading branch information
ticky authored and mistydemeo committed Jan 14, 2017
1 parent 6805e99 commit ef43f31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Formula/sdl2.rb
Expand Up @@ -57,6 +57,13 @@ def install
# We need the build to point at the newly-built (not yet linked) copy of SDL.
inreplace bin/"sdl2-config", "prefix=#{HOMEBREW_PREFIX}", "prefix=#{prefix}"
cd "test" do
# These test source files produce binaries which by default will reference
# some sample resources in the working directory.
# Let's point them to the test_extras directory we're about to set up instead!
inreplace %w[controllermap.c loopwave.c loopwavequeue.c testmultiaudio.c
testoverlay2.c testsprite2.c],
/"(\w+\.(?:bmp|dat|wav))"/,
"\"#{share}/test_extras/\\1\""
system "./configure", "--without-x"
system "make"
# Tests don't have a "make install" target
Expand Down

0 comments on commit ef43f31

Please sign in to comment.