aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sdl2.rb
diff options
context:
space:
mode:
authorMisty De Meo2013-08-13 08:58:37 -0700
committerMisty De Meo2013-08-13 09:00:06 -0700
commit0fd31a54a63416133b806c07df20e861b797b2f2 (patch)
tree06485b396418727b0854e6f25996ca9a795a405e /Library/Formula/sdl2.rb
parent83e7e2381cfbb1adadc682e81198b5e630f48fd4 (diff)
downloadhomebrew-0fd31a54a63416133b806c07df20e861b797b2f2.tar.bz2
sdl2 2.0.0
Note that we still need the SDL2 ports of supporting libraries, e.g. SDL2_image.
Diffstat (limited to 'Library/Formula/sdl2.rb')
-rw-r--r--Library/Formula/sdl2.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/Library/Formula/sdl2.rb b/Library/Formula/sdl2.rb
new file mode 100644
index 000000000..39f48a83d
--- /dev/null
+++ b/Library/Formula/sdl2.rb
@@ -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