class OpenalSoft < Formula desc "Implementation of the OpenAL 3D audio API" homepage "http://kcat.strangesoft.net/openal.html" url "http://kcat.strangesoft.net/openal-releases/openal-soft-1.17.0.tar.bz2" sha256 "5e93336de2e7c50f3a01beba51861d6f61c3e4045a896191dc806591e46264d1" head "http://repo.or.cz/openal-soft.git" bottle do cellar :any sha256 "81d1fd4cf4e709f04071d6586c3961aed84cc98727a30b397315cf63ecc5be66" => :el_capitan sha256 "f6bf71249e4b2d909e0a7240b9c4529b6abe94cb637738c339a0ea357e9166ae" => :yosemite sha256 "da9897a08329506de8767b3681a2683bccea4d385c98243f79e056615603dfd8" => :mavericks end option :universal depends_on "pkg-config" => :build depends_on "cmake" => :build depends_on "portaudio" => :optional depends_on "pulseaudio" => :optional depends_on "fluid-synth" => :optional depends_on "qt" => :optional # llvm-gcc does not support the alignas macro # clang 4.2's support for alignas is incomplete fails_with :llvm fails_with(:clang) { build 425 } keg_only :provided_by_osx, "OS X provides OpenAL.framework." def install ENV.universal_binary if build.universal? # Please don't reenable example building. See: # https://github.com/Homebrew/homebrew/issues/38274 args = std_cmake_args args << "-DALSOFT_EXAMPLES=OFF" args << "-DALSOFT_BACKEND_PORTAUDIO=OFF" if build.without? "portaudio" args << "-DALSOFT_BACKEND_PULSEAUDIO=OFF" if build.without? "pulseaudio" args << "-DALSOFT_MIDI_FLUIDSYNTH=OFF" if build.without? "fluid-synth" system "cmake", ".", *args system "make", "install" end test do (testpath/"test.c").write <<-EOS.undent #include "AL/al.h" #include "AL/alc.h" int main() { ALCdevice *device; device = alcOpenDevice(0); alcCloseDevice(device); return 0; } EOS system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lopenal" end end