homebrew-core/Formula/portmidi.rb

35 lines
1.1 KiB
Ruby
Raw Normal View History

2010-05-31 16:13:59 +00:00
require 'formula'
2011-03-10 05:11:03 +00:00
class Portmidi < Formula
2010-05-31 16:13:59 +00:00
url 'http://downloads.sourceforge.net/project/portmedia/portmidi/200/portmidi-src-200.zip'
homepage 'http://sourceforge.net/apps/trac/portmedia/wiki/portmidi'
md5 '26053a105d938395227bb6ae1d78643b'
depends_on 'cmake' => :build
2010-05-31 16:13:59 +00:00
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 https://github.com/halfbyte/portmidi
# hopefully not needed anymore in the next version of portmidi
2010-05-31 16:13:59 +00:00
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