Skip to content

Commit

Permalink
pyside new version pyside2@5.15.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatch committed Nov 26, 2023
1 parent 4473e82 commit 27f219a
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions Formula/pyside2@5.15.11.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
class Pyside2AT51511 < Formula
desc "Python bindings for Qt5 and greater"
homepage "https://code.qt.io/cgit/pyside/pyside-setup.git/tree/README.pyside2.md?h=5.15.2"
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"]

livecheck do
url "https://download.qt.io/official_releases/QtForPython/pyside2/"
regex(%r{href=.*?PySide2[._-]v?(\d+(?:\.\d+)+)-src/}i)
end

keg_only :versioned_formula

depends_on "cmake" => :build
depends_on "freecad/freecad/shiboken2@5.15.11"
depends_on "llvm@15" # Upstream issue ref: https://bugreports.qt.io/browse/PYSIDE-2268
depends_on "python@3.10"
depends_on "qt@5"
depends_on "sphinx-doc"

uses_from_macos "libxml2"
uses_from_macos "libxslt"

on_linux do
depends_on "libxcb"
depends_on "mesa"
end

fails_with gcc: "5"

# Don't copy qt@5 tools.
patch do
url "https://src.fedoraproject.org/rpms/python-pyside2/raw/009100c67a63972e4c5252576af1894fec2e8855/f/pyside2-tools-obsolete.patch"
sha256 "ede69549176b7b083f2825f328ca68bd99ebf8f42d245908abd320093bac60c9"
end

def python3
"python3.10"
end

# NOTE: ipatch >= qt@5.15.3 tarballs require a c++17 compiler
def install

Check failure on line 43 in Formula/pyside2@5.15.11.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

`brew install --verbose --build-bottle freecad/freecad/pyside2@5.15.11` failed on macOS Ventura (13)!

er.cpp.o -MF CMakeFiles/QtNetwork.dir/PySide2/QtNetwork/qocspresponse_wrapper.cpp.o.d -o CMakeFiles/QtNetwork.dir/PySide2/QtNetwork/qocspresponse_wrapper.cpp.o -c /tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtNetwork/PySide2/QtNetwork/qocspresponse_wrapper.cpp [ 46%] Building CXX object sources/pyside2/PySide2/QtScxml/CMakeFiles/QtScxml.dir/PySide2/QtScxml/qscxmlcppdatamodel_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtScxml && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_SCXML_LIB -DQtScxml_EXPORTS -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtScxml/QtScxml -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtScxml -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtScxml -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/libpyside -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtCore/PySide2/QtCore -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2 -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/shiboken2/libshiboken -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -iframework /usr/local/opt/qt@5/lib -isystem /usr/local/opt/qt@5/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt@5/./mkspecs/macx-clang -isystem /usr/local/opt/qt@5/lib/QtScxml.framework/Headers -isystem /usr/local/opt/qt@5/lib/QtQml.framework/Headers -isystem /usr/local/opt/qt@5/lib/QtNetwork.framework/Headers -Wall -fvisibility=hidden -Wno-strict-aliasing -O3 -DNDEBUG -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -fPIC -fPIC -fPIC -MD -MT sources/pyside2/PySide2/QtScxml/CMakeFiles/QtScxml.dir/PySide2/QtScxml/qscxmlcppdatamodel_wrapper.cpp.o -MF CMakeFiles/QtScxml.dir/PySide2/QtScxml/qscxmlcppdatamodel_wrapper.cpp.o.d -o CMakeFiles/QtScxml.dir/PySide2/QtScxml/qscxmlcppdatamodel_wrapper.cpp.o -c /tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtScxml/PySide2/QtScxml/qscxmlcppdatamodel_wrapper.cpp [ 46%] Building CXX object sources/pyside2/PySide2/QtScript/CMakeFiles/QtScript.dir/PySide2/QtScript/qscriptvalueiterator_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtScript && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQtScript_EXPORTS -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtScript/QtScript -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtScript -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtScript -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/libpyside -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtCore/PySide2/QtCore -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2 -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/sources/shiboken2/libshiboken -I/tmp/pyside2A5.15.11-20231126-16648-fnkfk0/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken

Check failure on line 43 in Formula/pyside2@5.15.11.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

`brew install --verbose --build-bottle freecad/freecad/pyside2@5.15.11` failed on macOS Monterey (12)!

rces/pyside2/PySide2/QtNetwork/PySide2/QtNetwork/qocspresponse_wrapper.cpp [ 43%] Building CXX object sources/pyside2/PySide2/QtXmlPatterns/CMakeFiles/QtXmlPatterns.dir/PySide2/QtXmlPatterns/qxmlresultitems_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtXmlPatterns && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_XMLPATTERNS_LIB -DQtXmlPatterns_EXPORTS -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtXmlPatterns/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/libpyside -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtCore/PySide2/QtCore -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2 -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/shiboken2/libshiboken -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -iframework /usr/local/opt/qt@5/lib -isystem /usr/local/opt/qt@5/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt@5/./mkspecs/macx-clang -isystem /usr/local/opt/qt@5/lib/QtXmlPatterns.framework/Headers -isystem /usr/local/opt/qt@5/lib/QtNetwork.framework/Headers -Wall -fvisibility=hidden -Wno-strict-aliasing -O3 -DNDEBUG -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -fPIC -fPIC -fPIC -MD -MT sources/pyside2/PySide2/QtXmlPatterns/CMakeFiles/QtXmlPatterns.dir/PySide2/QtXmlPatterns/qxmlresultitems_wrapper.cpp.o -MF CMakeFiles/QtXmlPatterns.dir/PySide2/QtXmlPatterns/qxmlresultitems_wrapper.cpp.o.d -o CMakeFiles/QtXmlPatterns.dir/PySide2/QtXmlPatterns/qxmlresultitems_wrapper.cpp.o -c /tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtXmlPatterns/PySide2/QtXmlPatterns/qxmlresultitems_wrapper.cpp [ 43%] Building CXX object sources/pyside2/PySide2/QtXmlPatterns/CMakeFiles/QtXmlPatterns.dir/PySide2/QtXmlPatterns/qxmlschemavalidator_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtXmlPatterns && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_XMLPATTERNS_LIB -DQtXmlPatterns_EXPORTS -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtXmlPatterns/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtXmlPatterns -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/libpyside -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtCore/PySide2/QtCore -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2 -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/sources/shiboken2/libshiboken -I/tmp/pyside2A5.15.11-20231126-6599-bskp3z/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -iframework /usr/local/opt/qt@5/lib -isystem /usr/local/opt/qt@5/lib/QtCore.fra

Check failure on line 43 in Formula/pyside2@5.15.11.rb

View workflow job for this annotation

GitHub Actions / test-bot (self-hosted-bigsurvm)

`brew install --verbose --build-bottle freecad/freecad/pyside2@5.15.11` failed on macOS Big Sur (11)!

tion.dir/PySide2/QtLocation/qplacesearchsuggestionreply_wrapper.cpp.o CMakeFiles/QtLocation.dir/PySide2/QtLocation/qplacesupplier_wrapper.cpp.o CMakeFiles/QtLocation.dir/PySide2/QtLocation/qtlocation_module_wrapper.cpp.o CMakeFiles/QtLocation.dir/PySide2/QtLocation/qgeoserviceproviderfactoryv2_wrapper.cpp.o -iframework /usr/local/opt/qt@5/lib -Wl,-rpath,/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/libpyside -Wl,-rpath,/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken ../../libpyside/libpyside2.abi3.5.15.11.dylib /usr/local/opt/qt@5/lib/QtLocation.framework/QtLocation ../../../shiboken2/libshiboken/libshiboken2.abi3.5.15.11.dylib -undefined dynamic_lookup /usr/local/opt/qt@5/lib/QtPositioningQuick.framework/QtPositioningQuick /usr/local/opt/qt@5/lib/QtPositioning.framework/QtPositioning /usr/local/opt/qt@5/lib/QtQuick.framework/QtQuick /usr/local/opt/qt@5/lib/QtQmlModels.framework/QtQmlModels /usr/local/opt/qt@5/lib/QtGui.framework/QtGui /usr/local/opt/qt@5/lib/QtQml.framework/QtQml /usr/local/opt/qt@5/lib/QtNetwork.framework/QtNetwork /usr/local/opt/qt@5/lib/QtCore.framework/QtCore [ 52%] Built target QtLocation [ 52%] Building CXX object sources/pyside2/PySide2/QtSensors/CMakeFiles/QtSensors.dir/PySide2/QtSensors/qtapsensor_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtSensors && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_SENSORS_LIB -DQtSensors_EXPORTS -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtSensors/QtSensors -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtSensors -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtSensors -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/pyside2/libpyside -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtCore/PySide2/QtCore -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2 -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/shiboken2/libshiboken -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/shiboken2/libshiboken -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -iframework /usr/local/opt/qt@5/lib -isystem /usr/local/opt/qt@5/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt@5/./mkspecs/macx-clang -isystem /usr/local/opt/qt@5/lib/QtSensors.framework/Headers -Wall -fvisibility=hidden -Wno-strict-aliasing -O3 -DNDEBUG -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -fPIC -fPIC -fPIC -MD -MT sources/pyside2/PySide2/QtSensors/CMakeFiles/QtSensors.dir/PySide2/QtSensors/qtapsensor_wrapper.cpp.o -MF CMakeFiles/QtSensors.dir/PySide2/QtSensors/qtapsensor_wrapper.cpp.o.d -o CMakeFiles/QtSensors.dir/PySide2/QtSensors/qtapsensor_wrapper.cpp.o -c /tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtSensors/PySide2/QtSensors/qtapsensor_wrapper.cpp [ 52%] Building CXX object sources/pyside2/PySide2/QtSensors/CMakeFiles/QtSensors.dir/PySide2/QtSensors/qtiltfilter_wrapper.cpp.o cd /tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/build/sources/pyside2/PySide2/QtSensors && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -DNDEBUG -DPYSIDE_QML_SUPPORT=1 -DPy_LIMITED_API=0x03050000 -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_SENSORS_LIB -DQtSensors_EXPORTS -I/tmp/pyside2A5.15.11-20231126-80002-ejvoqp/pyside-setup-opensource-src-5.15.11/sources/pyside2/PySide2/QtSensors/QtSensors -I/tmp/pyside2A5.15.11-20231
rpaths = if OS.mac?
pyside2_module = prefix/Language::Python.site_packages(python3)/"PySide2"
[rpath, rpath(source: pyside2_module)]
else
# Add missing include dirs on Linux.
# upstream issue: https://bugreports.qt.io/browse/PYSIDE-1684
extra_include_dirs = [Formula["mesa"].opt_include, Formula["libxcb"].opt_include]
inreplace "sources/pyside2/cmake/Macros/PySideModules.cmake",
"--include-paths=${shiboken_include_dirs}",
"--include-paths=${shiboken_include_dirs}:#{extra_include_dirs.join(":")}"

# Add rpath to qt@5 because it is keg-only.
[lib, Formula["qt@5"].opt_lib]
end

# Avoid shim reference.
inreplace "sources/shiboken2/ApiExtractor/CMakeLists.txt", "${CMAKE_CXX_COMPILER}", ENV.cxx

# This is a workaround for current problems with Shiboken2
# ENV["HOMEBREW_INCLUDE_PATHS"] = ENV["HOMEBREW_INCLUDE_PATHS"].sub(Formula["qt@5"].include, "")

ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].opt_lib
system "cmake", "-S", ".", "-B", "build",
"-DPYTHON_EXECUTABLE=#{which(python3)}",
"-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}",
"-DFORCE_LIMITED_API=yes",
*std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

def caveats
<<-EOS
if qt6, qt@6 is linked then this formula will fail to build from source
this formula requires manually linking after install
EOS
end

test do
Language::Python.each_python(build) do |python, _version|
system python, "-c", "from PySide2 import QtCore"
end
end
end

0 comments on commit 27f219a

Please sign in to comment.