2011-10-14 15:03:19 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Qscintilla2 < Formula
|
|
|
|
homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro'
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8/QScintilla-gpl-2.8.tar.gz'
|
2013-12-30 20:44:58 +00:00
|
|
|
sha1 '3edf9d476d4e6af0706a4d33401667a38e3a697e'
|
2011-10-14 15:03:19 +00:00
|
|
|
|
2014-02-10 11:59:19 +00:00
|
|
|
depends_on :python => :recommended
|
|
|
|
depends_on :python3 => :optional
|
|
|
|
|
|
|
|
if build.with? "python3"
|
|
|
|
depends_on "pyqt" => "with-python3"
|
|
|
|
else
|
|
|
|
depends_on "pyqt"
|
|
|
|
end
|
|
|
|
|
2011-10-14 15:03:19 +00:00
|
|
|
def install
|
2014-01-14 01:48:46 +00:00
|
|
|
# On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag
|
|
|
|
if ENV.compiler == :clang and MacOS.version >= :mavericks
|
|
|
|
spec = "unsupported/macx-clang-libc++"
|
|
|
|
else
|
|
|
|
spec = "macx-g++"
|
|
|
|
end
|
|
|
|
args = %W[-config release -spec #{spec}]
|
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
|
|
|
|
|
2014-01-14 01:48:46 +00:00
|
|
|
system "qmake", "qscintilla.pro", *args
|
2012-02-21 06:04:21 +00:00
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2011-10-14 15:03:19 +00:00
|
|
|
end
|
|
|
|
|
2014-01-04 13:15:51 +00:00
|
|
|
cd 'Python' do
|
2014-03-08 12:08:21 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-10 11:59:19 +00:00
|
|
|
(share/"sip").mkpath
|
|
|
|
system python, "configure.py", "-o", lib, "-n", include,
|
|
|
|
"--apidir=#{prefix}/qsci",
|
|
|
|
"--destdir=#{lib}/python#{version}/site-packages/PyQt4",
|
|
|
|
"--qsci-sipdir=#{share}/sip",
|
|
|
|
"--pyqt-sipdir=#{HOMEBREW_PREFIX}/share/sip",
|
|
|
|
"--spec=#{spec}"
|
|
|
|
system 'make'
|
|
|
|
system 'make', 'install'
|
2014-03-08 12:08:21 +00:00
|
|
|
system "make", "clean"
|
2014-02-10 11:59:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
Pathname("test.py").write <<-EOS.undent
|
|
|
|
import PyQt4.Qsci
|
|
|
|
assert("QsciLexer" in dir(PyQt4.Qsci))
|
|
|
|
EOS
|
2014-03-08 12:08:21 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-10 11:59:19 +00:00
|
|
|
system python, "test.py"
|
2012-02-21 06:04:21 +00:00
|
|
|
end
|
2011-10-14 15:03:19 +00:00
|
|
|
end
|
|
|
|
end
|