Skip to content

Commit

Permalink
[email protected]_py310: rebottle for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatch committed May 21, 2024
1 parent 83cefaa commit fa32ab1
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions Formula/[email protected]_py310.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Pyside2AT51511Py310 < Formula
url "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.11-src/pyside-setup-opensource-src-5.15.11.tar.xz"
sha256 "da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29"
license all_of: ["GFDL-1.3-only", "GPL-2.0-only", "GPL-3.0-only", "LGPL-2.1-only", "LGPL-3.0-only"]
revision 1

livecheck do
url "https://download.qt.io/official_releases/QtForPython/pyside2/"
Expand Down Expand Up @@ -64,20 +65,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["[email protected]"].opt_bin/"python3.10"
python_lib = Formula["[email protected]"].opt_lib/"libpython3.10.dylib"
py_exe = Formula["[email protected]"].opt_bin/"python3.10"

cmake_args << "-DPYTHON_EXECUTABLE=#{python_exe}"
cmake_args << "-DPYTHON_LIBRARY=#{python_lib}"
py_lib = if OS.mac?
Formula["[email protected]"].opt_lib/"libpython3.10.dylib"
else
Formula["[email protected]"].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(";")}",
Expand Down Expand Up @@ -109,6 +115,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

Expand Down

0 comments on commit fa32ab1

Please sign in to comment.