Skip to content

Commit

Permalink
morpheus-beta: Refactor install method according to Homebrew-Core
Browse files Browse the repository at this point in the history
  • Loading branch information
jdieg0 committed Apr 12, 2024
1 parent 68f376e commit 1f57725
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions Formula/morpheus-beta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ class MorpheusBeta < Formula
uses_from_macos "zlib"

def install
args = []
args << "-G Ninja"
# has to build with Ninja until: https://gitlab.kitware.com/cmake/cmake/-/issues/25142
args = ["-G Ninja"]

if OS.mac?
args << "-DMORPHEUS_RELEASE_BUNDLE=ON"
args << "-DBREW_FORMULA_DEPLOYMENT=ON"

# SBML import currently disabled by default due to libSBML build errors with some macOS SDKs
args << "-DMORPHEUS_SBML=OFF" if build.without? "sbml"
Expand All @@ -42,17 +43,13 @@ def install
system "cmake", "--build", "build"
system "cmake", "--install", "build"

if OS.mac?
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus"
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus-gui"
end
end
return unless OS.mac?

def post_install
if OS.mac? && File.read("#{prefix}/Morpheus.app/Contents/Info.plist").include?("HOMEBREW_BIN_PATH")
# Set PATH environment variable including Homebrew prefix in macOS app bundle
inreplace "#{prefix}/Morpheus.app/Contents/Info.plist", "HOMEBREW_BIN_PATH", "#{HOMEBREW_PREFIX}/bin"
end
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus"
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus-gui"

# Set PATH environment variable including Homebrew prefix in macOS app bundle
inreplace "#{prefix}/Morpheus.app/Contents/Info.plist", "HOMEBREW_BIN_PATH", "#{HOMEBREW_PREFIX}/bin"
end

def caveats
Expand Down

0 comments on commit 1f57725

Please sign in to comment.