aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pyside.rb
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-06-16 16:35:40 -0700
committerCharlie Sharpsteen2011-08-25 17:47:22 -0700
commit05d3a7e9c7b7ad8ca60d4e7c3213f8ac913aa6d3 (patch)
tree83f43a4f6139c63e29d3d1a5980a6e947f775eb1 /Library/Formula/pyside.rb
parentc429406c90cef20195d8b21df008dbd65c020145 (diff)
downloadhomebrew-05d3a7e9c7b7ad8ca60d4e7c3213f8ac913aa6d3.tar.bz2
New formula for PySide
PySide is a set of LGPL-licensed Python bindings for the Qt libraries that is mostly compatible with PyQt. This formula builds the Python run-time modules. For development tools such as Qt UI and Resource compilers, see the PySideTools formula.
Diffstat (limited to 'Library/Formula/pyside.rb')
-rw-r--r--Library/Formula/pyside.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/pyside.rb b/Library/Formula/pyside.rb
new file mode 100644
index 000000000..826ba9d3c
--- /dev/null
+++ b/Library/Formula/pyside.rb
@@ -0,0 +1,44 @@
+require 'formula'
+
+def which_python
+ "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
+end
+
+def site_package_dir
+ "lib/#{which_python}/site_packages"
+end
+
+class Pyside < Formula
+ homepage 'http://www.pyside.org'
+ url 'http://www.pyside.org/files/pyside-qt4.7+1.0.6.tar.bz2'
+ md5 '6773cdd7c594f5bc314541d8cfb70256'
+
+ depends_on 'cmake' => :build
+
+ depends_on 'shiboken'
+ depends_on 'generatorrunner'
+ depends_on 'apiextractor'
+ depends_on 'qt'
+
+ def install
+ # The build will be unable to find Qt headers buried inside frameworks
+ # unless the folder containing those frameworks is added to the compiler
+ # search path.
+ qt = Formula.factory 'qt'
+ ENV.append_to_cflags "-F#{qt.prefix}/Frameworks"
+
+ # Also need `ALTERNATIVE_QT_INCLUDE_DIR` to prevent "missing file" errors.
+ system "cmake . #{std_cmake_parameters} -DALTERNATIVE_QT_INCLUDE_DIR=#{qt.prefix}/Frameworks -DSITE_PACKAGE=#{site_package_dir} -DBUILD_TESTS=NO"
+ system 'make install'
+ end
+
+ def caveats
+ <<-EOS
+PySide Python modules have been linked to:
+ #{HOMEBREW_PREFIX}/#{site_package_dir}
+
+Make sure this folder is on your PYTHONPATH. For PySide development tools,
+install the `pyside-tools` formula.
+ EOS
+ end
+end