class Portmidi < Formula desc "Cross-platform library for real-time MIDI I/O" homepage "https://sourceforge.net/projects/portmedia/" url "https://downloads.sourceforge.net/project/portmedia/portmidi/217/portmidi-src-217.zip" sha256 "08e9a892bd80bdb1115213fb72dc29a7bf2ff108b378180586aa65f3cfd42e0f" revision 2 bottle do cellar :any sha256 "0dfe3a9b8ba85cf769c54a66fef958bfc0579700c3b8a3b494597a931e78db00" => :mojave sha256 "746ef0d9f4013333e18b65160559ad578f2e491d5252ea22434cf8718885eb1e" => :high_sierra sha256 "fba5058ec32b4f448c35104824f503a687bca51201e47c9e27020c08dd21fc41" => :sierra end depends_on "cmake" => :build def install if MacOS.version == :sierra || MacOS.version == :el_capitan ENV["SDKROOT"] = MacOS.sdk_path end 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 # Fix outdated SYSROOT to avoid: # No rule to make target `/Developer/SDKs/MacOSX10.5.sdk/...' inreplace "pm_common/CMakeLists.txt", "set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk CACHE", "set(CMAKE_OSX_SYSROOT /#{MacOS.sdk_path} CACHE" system "make", "-f", "pm_mac/Makefile.osx" system "make", "-f", "pm_mac/Makefile.osx", "install" end end