class Pyside < Formula desc "Official Python bindings for Qt" homepage "https://wiki.qt.io/Qt_for_Python" url "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.2-src/pyside-setup-opensource-src-5.15.2.tar.xz" sha256 "b306504b0b8037079a8eab772ee774b9e877a2d84bab2dbefbe4fa6f83941418" license all_of: ["GFDL-1.3-only", "GPL-2.0-only", "GPL-3.0-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 bottle do sha256 "59e5c373a67322e16ede374a28a56a33dc24e4c5915b25a6a144379be3464637" => :big_sur sha256 "2dc161b5c9cd38d7502a4798bcd196ca91d69316be5474619548ec0012850f5b" => :catalina sha256 "7ce52066861e3a94b3dc903e277c2c09824e89f5ce8f37490bb181175215cbc0" => :mojave end depends_on "cmake" => :build depends_on "llvm" => :build depends_on "python@3.9" depends_on "qt" def install ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib args = %W[ --ignore-git --parallel=#{ENV.make_jobs} --install-scripts #{bin} ] xy = Language::Python.major_minor_version Formula["python@3.9"].opt_bin/"python3" system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix), "--install-lib", lib/"python#{xy}/site-packages", *args, "--build-type=shiboken2" system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix), "--install-lib", lib/"python#{xy}/site-packages", *args, "--build-type=pyside2" lib.install_symlink Dir.glob(lib/"python#{xy}/site-packages/PySide2/*.dylib") lib.install_symlink Dir.glob(lib/"python#{xy}/site-packages/shiboken2/*.dylib") end test do system Formula["python@3.9"].opt_bin/"python3", "-c", "import PySide2" %w[ Core Gui Location Multimedia Network Quick Svg WebEngineWidgets Widgets Xml ].each { |mod| system Formula["python@3.9"].opt_bin/"python3", "-c", "import PySide2.Qt#{mod}" } end end