require 'formula' class Portmidi :build def caveats <<-EOS.undent NOTE: "brew install -v portmidi" will fail! You must install in non-verbose mode for this to succeed. EOS end def install # PATCH for Snow Leopard, see http://github.com/halfbyte/portmidi # hopefully not needed anymymore in the next version of portmidi architectures = archs_for_command('/bin/sh').join(' ') inreplace 'CMakeLists.txt', 'CMAKE_OSX_ARCHITECTURES i386 ppc CACHE STRING "do not build for 64-bit"', "CMAKE_OSX_ARCHITECTURES #{architectures} CACHE STRING \"do only build for required architectures\"" inreplace 'pm_mac/Makefile.osx', 'PF=/usr/local', "PF=#{prefix}" # need to create include/lib directories since make won't create them itself include.mkpath lib.mkpath system 'make -f pm_mac/Makefile.osx' system 'make -f pm_mac/Makefile.osx install' end end