From 1f57725528fd33f240fa87a8e3b6d2032ac66d5e Mon Sep 17 00:00:00 2001 From: Diego Jahn Date: Fri, 12 Apr 2024 21:19:36 +0200 Subject: [PATCH] morpheus-beta: Refactor `install` method according to Homebrew-Core --- Formula/morpheus-beta.rb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Formula/morpheus-beta.rb b/Formula/morpheus-beta.rb index 50c8239..610bf81 100644 --- a/Formula/morpheus-beta.rb +++ b/Formula/morpheus-beta.rb @@ -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" @@ -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