Skip to content

Commit

Permalink
add shiboken2@5.15.11 formula to tap
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatch committed Oct 23, 2023
1 parent 586862e commit 5e3d0fe
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions Formula/shiboken2@5.15.11.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,31 @@ class Shiboken2AT51511 < Formula
head "https://github.com/qt/qt5.git", branch: "dev", shallow: false

stable do
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"
url "https://download.qt.io/official_releases/QtForPython/shiboken2/PySide2-5.15.11-src/pyside-setup-opensource-src-5.15.11.zip"
sha256 "9bf6d4f3192697b8d5d7e92219c8d964dcfbfe96a438916bb1cdb78265584081"
end

keg_only :versioned_formula

depends_on "cmake" => :build
depends_on "python@3.11" => :build
depends_on "python@3.10" => :build
depends_on "llvm"
depends_on "numpy"
depends_on "qt@5"

uses_from_macos "libxml2"
uses_from_macos "libxslt"

# fix for python >= v3.10
patch :p0 do
url "https://github.com/raw/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken2-python10-compat.patch"
sha256 "bb234f9a37fd9af1d20ca4a90829580be1c0df2cb55061e350619fd3fb0c1e36"
end

def install
ENV["LLVM_INSTALL_DIR"] = Formula["llvm"].opt_prefix

mkdir "macbuild.#{version}" do
mkdir "build" do
args = std_cmake_args
args << "-DCMAKE_PREFIX_PATH=#{Formula["qt@5"].opt_lib}"
pyhome = `#{Formula["python@3.11"].opt_bin}/python3.11-config --prefix`.chomp
pyhome = `#{Formula["python@3.10"].opt_bin}/python3.10-config --prefix`.chomp
# Building the tests, is effectively a test of Shiboken
args << "-DPYTHON_EXECUTABLE=#{pyhome}/bin/python3"
args << "-DFORCE_LIMITED_API=yes"
args << "-DCMAKE_INSTALL_RPATH=#{lib}"

system "cmake", *args, "../sources/shiboken2"
Expand All @@ -45,7 +40,9 @@ def install

def caveats
<<-EOS
this formula is keg-only
this formula is keg-only, and is tied to the version of python
that is used to build qt@5, ie. if qt@5 uses python@3.10 then
this formula must use python@3.10
EOS
end

Expand Down

0 comments on commit 5e3d0fe

Please sign in to comment.