2011-06-16 23:35:40 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pyside < Formula
|
|
|
|
homepage 'http://www.pyside.org'
|
2013-01-11 02:19:39 +00:00
|
|
|
url 'http://qt-project.org/uploads/pyside/pyside-qt4.8+1.1.2.tar.bz2'
|
|
|
|
mirror 'https://distfiles.macports.org/py-pyside/pyside-qt4.8+1.1.2.tar.bz2'
|
2012-10-13 18:26:49 +00:00
|
|
|
sha1 'c0119775f2500e48efebdd50b7be7543e71b2c24'
|
2011-06-16 23:35:40 +00:00
|
|
|
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
depends_on 'shiboken'
|
|
|
|
|
2013-04-21 08:44:24 +00:00
|
|
|
def which_python
|
|
|
|
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
|
|
|
|
end
|
|
|
|
|
2011-06-16 23:35:40 +00:00
|
|
|
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'
|
2013-05-03 16:28:45 +00:00
|
|
|
ENV.append_to_cflags "-F#{qt.frameworks}"
|
2011-06-16 23:35:40 +00:00
|
|
|
|
2012-05-03 22:48:09 +00:00
|
|
|
# Also need `ALTERNATIVE_QT_INCLUDE_DIR` to prevent "missing file" errors.
|
2012-07-10 23:39:19 +00:00
|
|
|
# Add out of tree build because one of its deps, shiboken, itself needs an
|
|
|
|
# out of tree build in shiboken.rb.
|
2012-05-22 21:37:04 +00:00
|
|
|
args = std_cmake_args + %W[
|
2013-05-03 16:28:45 +00:00
|
|
|
-DALTERNATIVE_QT_INCLUDE_DIR=#{qt.frameworks}
|
2013-04-21 08:44:24 +00:00
|
|
|
-DSITE_PACKAGE=lib/#{which_python}/site-packages
|
2012-05-15 21:15:46 +00:00
|
|
|
-DBUILD_TESTS=NO
|
2012-07-10 23:39:19 +00:00
|
|
|
..
|
|
|
|
]
|
|
|
|
mkdir 'macbuild' do
|
|
|
|
system 'cmake', *args
|
|
|
|
system 'make'
|
|
|
|
system 'make install'
|
|
|
|
end
|
2011-06-16 23:35:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
<<-EOS
|
|
|
|
PySide Python modules have been linked to:
|
2013-04-21 08:44:24 +00:00
|
|
|
#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages
|
2011-06-16 23:35:40 +00:00
|
|
|
|
|
|
|
Make sure this folder is on your PYTHONPATH. For PySide development tools,
|
|
|
|
install the `pyside-tools` formula.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|