From 25ed2d5b4a5bde402bc573b5dd1c8479757a9735 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:08:38 -0400 Subject: [PATCH] build(homebrew): fix boost linking (#3296) --- packaging/sunshine.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index b5220fe49b0..68193ec1056 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -23,8 +23,8 @@ class @PROJECT_NAME@ < Formula end option "with-docs", "Enable docs" - option "with-dynamic-boost", "Dynamically link Boost libraries" - option "without-dynamic-boost", "Statically link Boost libraries" # default option + option "with-static-boost", "Enable static link of Boost libraries" + option "without-static-boost", "Disable static link of Boost libraries" # default option depends_on "cmake" => :build depends_on "doxygen" => :build @@ -35,6 +35,7 @@ class @PROJECT_NAME@ < Formula depends_on "miniupnpc" depends_on "openssl" depends_on "opus" + depends_on "boost" => :recommended depends_on "icu4c" => :recommended on_linux do @@ -84,14 +85,17 @@ def install args << "-DBUILD_DOCS=OFF" end - if build.without? "dynamic-boost" + if build.without? "static-boost" + args << "-DBOOST_USE_STATIC=OFF" + ohai "Disabled statically linking Boost libraries" + else args << "-DBOOST_USE_STATIC=ON" - ohai "Statically linking Boost libraries" + ohai "Enabled statically linking Boost libraries" unless Formula["icu4c"].any_version_installed? odie <<~EOS icu4c must be installed to link against static Boost libraries, - either install icu4c or use brew install sunshine --with-dynamic-boost instead + either install icu4c or use brew install sunshine --with-static-boost instead EOS end ENV.append "CXXFLAGS", "-I#{Formula["icu4c"].opt_include}" @@ -99,9 +103,6 @@ def install ENV.append "LDFLAGS", "-L#{icu4c_lib_path}" ENV["LIBRARY_PATH"] = icu4c_lib_path ohai "Linking against ICU libraries at: #{icu4c_lib_path}" - else - args << "-DBOOST_USE_STATIC=OFF" - ohai "Dynamically linking Boost libraries" end system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args