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
|
|
|
homepage 'http://sourceforge.net/apps/trac/portmedia/wiki/portmidi'
|
2012-03-06 04:36:34 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/portmedia/portmidi/200/portmidi-src-200.zip'
|
2012-08-26 21:18:30 +00:00
|
|
|
sha1 'dcd979881a3b16518d33999e529004d7a647c2db'
|
2010-05-31 16:13:59 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'cmake' => :build
|
2010-05-31 16:13:59 +00:00
|
|
|
|
|
|
|
def install
|
2010-11-10 18:16:28 +00:00
|
|
|
# PATCH for Snow Leopard, see https://github.com/halfbyte/portmidi
|
2012-01-04 06:05:05 +00:00
|
|
|
# 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}"
|
|
|
|
|
2012-08-26 21:18:30 +00:00
|
|
|
# Fix compilation on Mountain Lion, works on previous versions too
|
|
|
|
inreplace 'pm_mac/readbinaryplist.c',
|
|
|
|
'#include "Folders.h"',
|
|
|
|
'#include <CoreServices/CoreServices.h>'
|
|
|
|
|
2010-05-31 16:13:59 +00:00
|
|
|
# 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
|