Skip to content

Commit

Permalink
qscintilla2 2.8.3
Browse files Browse the repository at this point in the history
Also add designer plugin support.

Closes Homebrew/legacy-homebrew#31434.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
dakcarto authored and MikeMcQuaid committed Aug 27, 2014
1 parent 59ea7c6 commit 725e932
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions Formula/qscintilla2.rb
Expand Up @@ -2,12 +2,14 @@

class Qscintilla2 < Formula
homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro'
url 'https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8/QScintilla-gpl-2.8.tar.gz'
sha1 '3edf9d476d4e6af0706a4d33401667a38e3a697e'
url "https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8.3/QScintilla-gpl-2.8.3.tar.gz"
sha1 "d3b4f0dc7358591c122518d932f797ae3e3dd9d4"

depends_on :python => :recommended
depends_on :python3 => :optional

option "without-plugin", "Skip building the Qt Designer plugin"

if build.with? "python3"
depends_on "pyqt" => "with-python3"
else
Expand All @@ -31,11 +33,19 @@ def install
s.gsub! "$$[QT_INSTALL_DATA]", "#{prefix}/data"
end

inreplace "features/qscintilla2.prf" do |s|
s.gsub! '$$[QT_INSTALL_LIBS]', lib
s.gsub! "$$[QT_INSTALL_HEADERS]", include
end

system "qmake", "qscintilla.pro", *args
system "make"
system "make", "install"
end

# Add qscintilla2 features search path, since it is not installed in Qt keg's mkspecs/features/
ENV["QMAKEFEATURES"] = "#{prefix}/data/mkspecs/features"

cd 'Python' do
Language::Python.each_python(build) do |python, version|
(share/"sip").mkpath
Expand All @@ -50,6 +60,22 @@ def install
system "make", "clean"
end
end

if build.with? "plugin"
mkpath prefix/"plugins/designer"
cd "designer-Qt4Qt5" do
inreplace "designer.pro" do |s|
s.sub! "$$[QT_INSTALL_PLUGINS]", "#{prefix}/plugins"
s.sub! "$$[QT_INSTALL_LIBS]", "#{lib}"
end
system "qmake", "designer.pro", *args
system "make"
system "make", "install"
end
# symlink Qt Designer plugin (note: not removed on qscintilla2 formula uninstall)
ln_sf prefix/"plugins/designer/libqscintillaplugin.dylib",
Formula["qt"].opt_prefix/"plugins/designer/"
end
end

test do
Expand Down

0 comments on commit 725e932

Please sign in to comment.