homebrew-core/Formula/shiboken.rb

53 lines
2.1 KiB
Ruby

class Shiboken < Formula
desc "GeneratorRunner plugin that outputs C++ code for CPython extensions"
homepage "https://wiki.qt.io/PySide"
url "https://download.qt.io/official_releases/pyside/shiboken-1.2.2.tar.bz2"
mirror "https://distfiles.macports.org/py-shiboken/shiboken-1.2.2.tar.bz2"
sha256 "7625bbcf1fe313fd910c6b8c9cf49ac5495499f9d00867115a2f1f2a69fce5c4"
head "https://github.com/PySide/Shiboken.git"
bottle do
revision 2
sha256 "70c2218fd33120644707710aca6cb12a68272b85afdc694a4a3fe28eb5135f8f" => :el_capitan
sha256 "f0f159f81858e514afd5cfc55f9c05a40ad5155baffc788974f4e632bfd97726" => :yosemite
sha256 "a1306b5980598839dfba0ba4ea23251fafebc87307bfb3c2ebcc5d006c63c9cb" => :mavericks
sha256 "81a1a53a3abdc3b21f5716f30ca1e3be063821f746e7e390ab51e97d45de29c6" => :mountain_lion
end
depends_on "cmake" => :build
depends_on "qt"
# don't use depends_on :python because then bottles install Homebrew's python
option "without-python", "Build without python 2 support"
depends_on :python => :recommended if MacOS.version <= :snow_leopard
depends_on :python3 => :optional
def install
# As of 1.1.1 the install fails unless you do an out of tree build and put
# the source dir last in the args.
Language::Python.each_python(build) do |python, version|
mkdir "macbuild#{version}" do
args = std_cmake_args
# Building the tests also runs them.
args << "-DBUILD_TESTS=ON"
if python == "python3" && Formula["python3"].installed?
python_framework = Formula["python3"].opt_prefix/"Frameworks/Python.framework/Versions/#{version}"
args << "-DPYTHON3_INCLUDE_DIR:PATH=#{python_framework}/Headers"
args << "-DPYTHON3_LIBRARY:FILEPATH=#{python_framework}/lib/libpython#{version}.dylib"
end
args << "-DUSE_PYTHON3:BOOL=ON" if python == "python3"
args << ".."
system "cmake", *args
system "make", "install"
end
end
end
test do
Language::Python.each_python(build) do |python, _version|
system python, "-c", "import shiboken"
end
end
end