forked from cartr/homebrew-qt4
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class PysideAT12 < Formula
desc "Python bindings for Qt"
homepage "https://wiki.qt.io/PySide"
url "https://download.qt.io/official_releases/pyside/pyside-qt4.8+1.2.2.tar.bz2"
mirror "https://distfiles.macports.org/py-pyside/pyside-qt4.8+1.2.2.tar.bz2"
sha256 "a1a9df746378efe52211f1a229f77571d1306fb72830bbf73f0d512ed9856ae1"
revision 1
head "https://github.com/PySide/PySide.git"
bottle do
cellar :any
rebuild 2
root_url "https://dl.bintray.com/cartr/autobottle-qt4"
sha256 "51be3a1fd82789dfee8afd5079e01685ac480cacb3c07f9cdb839f4a695488ac" => :sierra
sha256 "84303e789040c6fce89d499cb42308fd4a1d0f4ef7b8b5b760bf196e8c3e272a" => :el_capitan
sha256 "ef5894f1769a3ca2e2c8b69eb8a8fc62daa0baf107e26d43a9bc3077394c14fc" => :yosemite
end
# 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
option "without-docs", "Skip building documentation"
depends_on "cmake" => :build
depends_on "sphinx-doc" => :build if build.with? "docs"
depends_on "cartr/qt4/qt@4"
depends_on "cartr/qt4/[email protected]"
if build.with? "python3"
depends_on "cartr/qt4/[email protected]" => "with-python3"
else
depends_on "cartr/qt4/[email protected]"
end
def install
rm buildpath/"doc/CMakeLists.txt" if build.without? "docs"
# Add out of tree build because one of its deps, shiboken, itself needs an
# out of tree build in shiboken.rb.
Language::Python.each_python(build) do |python, version|
abi = `#{python} -c 'import sysconfig as sc; print(sc.get_config_var("SOABI"))'`.strip
python_suffix = python == "python" ? "-python2.7" : ".#{abi}"
mkdir "macbuild#{version}" do
qt = Formula["cartr/qt4/qt@4"].opt_prefix
args = std_cmake_args + %W[
-DSITE_PACKAGE=#{lib}/python#{version}/site-packages
-DALTERNATIVE_QT_INCLUDE_DIR=#{HOMEBREW_PREFIX}/include
-DQT_SRC_DIR=#{qt}/src
-DPYTHON_SUFFIX=#{python_suffix}
]
args << ".."
system "cmake", *args
system "make"
system "make", "install"
end
end
end
test do
Language::Python.each_python(build) do |python, _version|
system python, "-c", "from PySide import QtCore"
end
end
end