2011-10-14 15:03:19 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Qscintilla2 < Formula
|
|
|
|
homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro'
|
2012-11-12 10:52:41 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/pyqt/QScintilla2/QScintilla-2.6.2/QScintilla-gpl-2.6.2.tar.gz'
|
2012-06-29 15:35:14 +00:00
|
|
|
sha1 '6106c9e13983c086daf1fb0dba1180abed17588c'
|
2011-10-14 15:03:19 +00:00
|
|
|
|
|
|
|
depends_on 'pyqt'
|
|
|
|
depends_on 'sip'
|
|
|
|
|
|
|
|
def install
|
2012-03-25 22:27:03 +00:00
|
|
|
ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':'
|
2011-10-14 15:03:19 +00:00
|
|
|
|
2012-08-17 21:50:00 +00:00
|
|
|
cd 'Qt4Qt5' do
|
2012-02-21 06:04:21 +00:00
|
|
|
inreplace 'qscintilla.pro' do |s|
|
|
|
|
s.gsub! '$$[QT_INSTALL_LIBS]', lib
|
|
|
|
s.gsub! "$$[QT_INSTALL_HEADERS]", include
|
|
|
|
s.gsub! "$$[QT_INSTALL_TRANSLATIONS]", "#{prefix}/trans"
|
|
|
|
s.gsub! "$$[QT_INSTALL_DATA]", "#{prefix}/data"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "qmake", "qscintilla.pro"
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2011-10-14 15:03:19 +00:00
|
|
|
end
|
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'Python' do
|
|
|
|
system 'python', 'configure.py', "-o", lib, "-n", include,
|
|
|
|
"--apidir=#{prefix}/qsci",
|
2012-03-25 22:27:03 +00:00
|
|
|
"--destdir=#{lib}/#{which_python}/site-packages/PyQt4",
|
2012-02-21 06:04:21 +00:00
|
|
|
"--sipdir=#{share}/sip"
|
|
|
|
system 'make'
|
|
|
|
system 'make', 'install'
|
|
|
|
end
|
2011-10-14 15:03:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2012-03-25 22:27:03 +00:00
|
|
|
For non-Homebrew Python, you need to amend your PYTHONPATH like so:
|
|
|
|
export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
|
2011-10-14 15:03:19 +00:00
|
|
|
EOS
|
|
|
|
end
|
2012-03-25 22:27:03 +00:00
|
|
|
|
|
|
|
def which_python
|
|
|
|
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
|
|
|
|
end
|
2011-10-14 15:03:19 +00:00
|
|
|
end
|