-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shiboken2: update formula to include py module .pth file
- Loading branch information
Showing
1 changed file
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ 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 3 | ||
revision 4 | ||
head "https://github.com/qt/qt5.git", branch: "dev", shallow: false | ||
|
||
stable do | ||
|
@@ -26,12 +26,18 @@ class Shiboken2AT51511 < Formula | |
depends_on "llvm" | ||
depends_on "numpy" | ||
depends_on "qt@5" | ||
depends_on "sphinx-doc" | ||
|
||
uses_from_macos "libxml2" | ||
uses_from_macos "libxslt" | ||
|
||
def python3 | ||
"python3.11" | ||
Formula["[email protected]"].opt_bin/"python3" | ||
end | ||
|
||
def pythons | ||
deps.map(&:to_formula) | ||
.select { |f| f.name.match?(/^python@3\.\d+$/) } | ||
end | ||
|
||
def install | ||
Check failure on line 43 in Formula/[email protected]
|
||
|
@@ -44,16 +50,30 @@ def install | |
|
||
ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].opt_lib | ||
|
||
# "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}", | ||
system "cmake", "-S", "./sources/shiboken2", "-B", "build", | ||
"-DPYTHON_EXECUTABLE=#{which(python3)}", | ||
"-DPYTHON_EXECUTABLE=#{python3}", | ||
"-DFORCE_LIMITED_API=no", | ||
"-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}", | ||
*std_cmake_args | ||
system "cmake", "--build", "build" | ||
system "cmake", "--install", "build" | ||
end | ||
|
||
def post_install | ||
# explicitly set python version | ||
python_version = "3.11" | ||
|
||
# Unlink the existing .pth file to avoid reinstall issues | ||
pth_file = lib/"python#{python_version}/site-packages/shiboken2.pth" | ||
pth_file.unlink if pth_file.exist? | ||
|
||
ohai "Creating .pth file for shiboken2 module" | ||
# write the .pth file to the site-packages directory | ||
(lib/"python#{python_version}/site-packages/shiboken2.pth").write <<~EOS | ||
import site; site.addsitedir('#{lib}/python#{python_version}/site-packages/') | ||
EOS | ||
end | ||
|
||
def caveats | ||
<<-EOS | ||
this formula is keg-only | ||
|