-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note that we still need the SDL2 ports of supporting libraries, e.g. SDL2_image.
- Loading branch information
1 parent
651c27d
commit e5fa61a
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'formula' | ||
|
||
class Sdl2 < Formula | ||
homepage 'http://www.libsdl.org/' | ||
url 'http://www.libsdl.org/release/SDL2-2.0.0.tar.gz' | ||
sha1 'a907eb5203abad6649c1eae0120d96c0a1931350' | ||
|
||
head 'http://hg.libsdl.org/SDL', :branch => 'SDL-2.0', :using => :hg | ||
|
||
if build.head? | ||
depends_on :automake | ||
depends_on :libtool | ||
end | ||
|
||
option :universal | ||
|
||
def install | ||
# we have to do this because most build scripts assume that all sdl modules | ||
# are installed to the same prefix. Consequently SDL stuff cannot be | ||
# keg-only but I doubt that will be needed. | ||
inreplace %w[sdl2.pc.in sdl2-config.in], '@prefix@', HOMEBREW_PREFIX | ||
|
||
ENV.universal_binary if build.universal? | ||
|
||
system "./autogen.sh" if build.head? | ||
|
||
args = %W[--prefix=#{prefix}] | ||
# LLVM-based compilers choke on the assembly code packaged with SDL. | ||
args << '--disable-assembly' if ENV.compiler == :llvm or (ENV.compiler == :clang and MacOS.clang_build_version < 421) | ||
args << '--without-x' | ||
|
||
system './configure', *args | ||
system "make install" | ||
end | ||
|
||
def test | ||
system "#{bin}/sdl2-config", "--version" | ||
end | ||
end |