Skip to content

Commit

Permalink
initial checkin for new shiboken version
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatch committed Oct 23, 2023
1 parent 77d68ef commit 747289a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions Formula/shiboken2@5.15.11.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
class Shiboken2AT51511 < Formula
desc "GeneratorRunner plugin that outputs C++ code for CPython extensions"
homepage "https://code.qt.io/cgit/pyside/pyside-setup.git/tree/README.shiboken2-generator.md?h=5.15.2"
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
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"
end

keg_only :versioned_formula

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

uses_from_macos "libxml2"
uses_from_macos "libxslt"

# fix for numpy v1.23 API
patch :p0 do
url "https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken-numpy-1.23.compat.patch"
sha256 "e5a503eb5beb0f3e438559920081c28a7f663d79a34a9efb0a1459fa1ffb6f6a"
end

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

def install

Check failure on line 36 in Formula/shiboken2@5.15.11.rb

View workflow job for this annotation

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

`brew install --verbose --build-bottle freecad/freecad/shiboken2@5.15.11` failed on macOS Catalina (10.15)!

Warning: You are using macOS 10.15. We (and Apple) do not provide support for this old version. It is expected behaviour that some formulae will fail to build in this old version. It is expected behaviour that Homebrew will be buggy and slow. Do not create any issues about this on Homebrew's GitHub repositories. Do not create any issues even if you think this message is unrelated. Any opened issues will be immediately closed without response. Do not ask for help from Homebrew or its maintainers on social media. You may ask for help in Homebrew's discussions but are unlikely to receive a response. Try to figure out the problem yourself and submit a fix as a pull request. We will review it but may or may not accept it. ==> Fetching freecad/freecad/shiboken2@5.15.11 ==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken-numpy-1.23.compat.patch Already downloaded: /Users/brewer/Library/Caches/Homebrew/downloads/ed6d1a59a76d10fd011fc6a95bd26ef96d7d91262ac5666e48592f259e6259ab--libshiboken-numpy-1.23.compat.patch ==> Verifying checksum for 'ed6d1a59a76d10fd011fc6a95bd26ef96d7d91262ac5666e48592f259e6259ab--libshiboken-numpy-1.23.compat.patch' ==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken2-python10-compat.patch Already downloaded: /Users/brewer/Library/Caches/Homebrew/downloads/35da8d9458288cd8048d657eebe1815741c26d6750ab2f8a9edf499244351925--libshiboken2-python10-compat.patch ==> Verifying checksum for '35da8d9458288cd8048d657eebe1815741c26d6750ab2f8a9edf499244351925--libshiboken2-python10-compat.patch' ==> Downloading https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.11-src/pyside-setup-opensource-src-5.15.11.tar.xz Already downloaded: /Users/brewer/Library/Caches/Homebrew/downloads/c9f2dbcf0fc47d44e03b01c9c7a2bbbba7b7821907a04dce233ce15ad33b6d93--pyside-setup-opensource-src-5.15.11.tar.xz ==> Verifying checksum for 'c9f2dbcf0fc47d44e03b01c9c7a2bbbba7b7821907a04dce233ce15ad33b6d93--pyside-setup-opensource-src-5.15.11.tar.xz' ==> Installing shiboken2@5.15.11 from freecad/freecad /usr/bin/env tar --extract --no-same-owner --file /Users/brewer/Library/Caches/Homebrew/downloads/c9f2dbcf0fc47d44e03b01c9c7a2bbbba7b7821907a04dce233ce15ad33b6d93--pyside-setup-opensource-src-5.15.11.tar.xz --directory /private/tmp/d20231023-15053-79pctd /usr/bin/env cp -pR /private/tmp/d20231023-15053-79pctd/pyside-setup-opensource-src-5.15.11/. /private/tmp/shiboken2A5.15.11-20231023-15053-119bt0c/pyside-setup-opensource-src-5.15.11 ==> Patching cp -p /Users/brewer/Library/Caches/Homebrew/downloads/ed6d1a59a76d10fd011fc6a95bd26ef96d7d91262ac5666e48592f259e6259ab--libshiboken-numpy-1.23.compat.patch /private/tmp/shiboken2A5.15.11--patch-20231023-15053-zsn46v/libshiboken-numpy-1.23.compat.patch ==> Applying libshiboken-numpy-1.23.compat.patch patch -g 0 -f -p0 -i /private/tmp/shiboken2A5.15.11--patch-20231023-15053-zsn46v/libshiboken-numpy-1.23.compat.patch patching file sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp Hunk #1 FAILED at 116. 1 out of 1 hunk FAILED -- saving rejects to file sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp.rej ==> Formula Tap: freecad/freecad Path: /usr/local/Homebrew/Library/Taps/freecad/homebrew-freecad/Formula/shiboken2@5.15.11.rb ==> Configuration HOMEBREW_VERSION: 4.1.17-2-g7b0d468 ORIGIN: https://github.com/Homebrew/brew HEAD: 7b0d46850dcdbf338523d500de527e46c22b8cb2 Last commit: 5 hours ago Core tap origin: https://github.com/Homebrew/homebrew-core Core tap HEAD: 2cafb3915f5e4e34b8b6c043c3965d48b94a1835 Core tap last commit: 11 months ago Core tap branch: ipatch-1015-cmake-bottle Core tap JSON: 23 Oct 20:37 UTC HOMEBREW_PREFIX: /usr/local HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /Users/brewer/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GIT_EMAIL: 1589480+BrewTestBot@users.noreply.github.com HOMEBREW_GIT_NA
ENV["LLVM_INSTALL_DIR"] = Formula["llvm"].opt_prefix

mkdir "macbuild.#{version}" 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
# Building the tests, is effectively a test of Shiboken
args << "-DPYTHON_EXECUTABLE=#{pyhome}/bin/python3"
args << "-DCMAKE_INSTALL_RPATH=#{lib}"

system "cmake", *args, "../sources/shiboken2"
system "make", "-j#{ENV.make_jobs}", "install"
end
end

def caveats
<<-EOS
this formula is keg-only
EOS
end

test do
# NOTE: using `#{bin}` allows for testing formula installed in custom prefix
system "#{bin}/shiboken2", "--version"
end
end

0 comments on commit 747289a

Please sign in to comment.