From dfedd6325773428accac7b3b469c0eee6f0cede6 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 12 May 2024 16:31:28 -0500 Subject: [PATCH] pyside2@5.15.11_py310: rebottle for linux --- Formula/pyside2@5.15.11_py310.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Formula/pyside2@5.15.11_py310.rb b/Formula/pyside2@5.15.11_py310.rb index e8e2be05..5d22cb0f 100644 --- a/Formula/pyside2@5.15.11_py310.rb +++ b/Formula/pyside2@5.15.11_py310.rb @@ -64,20 +64,25 @@ def install [lib, Formula["qt@5"].opt_lib] end - # Avoid shim reference. - inreplace "sources/shiboken2/ApiExtractor/CMakeLists.txt", "${CMAKE_CXX_COMPILER}", ENV.cxx + ENV.append_path "CMAKE_PREFIX_PATH", Formula["llvm@15"].opt_lib + ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].opt_lib cmake_args = std_cmake_args # NOTE: ipatch build will fail if using `python3` cmake requires major+minor ie. `python3.10` - python_exe = Formula["python@3.10"].opt_bin/"python3.10" - python_lib = Formula["python@3.10"].opt_lib/"libpython3.10.dylib" + py_exe = Formula["python@3.10"].opt_bin/"python3.10" - cmake_args << "-DPYTHON_EXECUTABLE=#{python_exe}" - cmake_args << "-DPYTHON_LIBRARY=#{python_lib}" + py_lib = if OS.mac? + Formula["python@3.10"].opt_lib/"libpython3.10.dylib" + else + Formula["python@3.10"].opt_lib/"libpython3.10.so" + end - ENV.append_path "CMAKE_PREFIX_PATH", Formula["llvm@15"].opt_lib - ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].opt_lib + cmake_args << "-DPYTHON_EXECUTABLE=#{py_exe}" + cmake_args << "-DPYTHON_LIBRARY=#{py_lib}" + + # Avoid shim reference. + inreplace "sources/shiboken2/ApiExtractor/CMakeLists.txt", "${CMAKE_CXX_COMPILER}", ENV.cxx system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}", @@ -109,6 +114,7 @@ def post_install def caveats <<-EOS this formula may require manual linking after install + this a versioned formula designed to work with the homebrew-freecad tap EOS end