diff options
| author | Larry Shaffer | 2014-08-06 09:17:49 -0600 |
|---|---|---|
| committer | Mike McQuaid | 2014-08-06 18:04:08 +0100 |
| commit | 9d0608805e003c5a059ce0d1b13d236df1572cc5 (patch) | |
| tree | dccd4f23aa7fb27072727156ba6597bafccf5901 /Library | |
| parent | 6bfc0274cdaf9c47004f47a02e45c7ac027c60ee (diff) | |
| download | homebrew-9d0608805e003c5a059ce0d1b13d236df1572cc5.tar.bz2 | |
qwt: designer plugin fix and qwtmathml option.
Closes #26152.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/qwt.rb | 71 |
1 files changed, 57 insertions, 14 deletions
diff --git a/Library/Formula/qwt.rb b/Library/Formula/qwt.rb index 60ad02ef7..01b1a1664 100644 --- a/Library/Formula/qwt.rb +++ b/Library/Formula/qwt.rb @@ -1,33 +1,76 @@ -require 'formula' +require "formula" class Qwt < Formula - homepage 'http://qwt.sourceforge.net/' - url 'https://downloads.sourceforge.net/project/qwt/qwt/6.1.0/qwt-6.1.0.tar.bz2' - sha1 '48a967038f7aa9a9c87c64bcb2eb07c5df375565' + homepage "http://qwt.sourceforge.net/" + url "https://downloads.sourceforge.net/project/qwt/qwt/6.1.0/qwt-6.1.0.tar.bz2" + sha1 "48a967038f7aa9a9c87c64bcb2eb07c5df375565" - depends_on 'qt' + option "with-qwtmathml", "Build the qwtmathml library" + option "without-plugin", "Skip building the Qt Designer plugin" + + depends_on "qt" + + # Update designer plugin linking back to qwt framework/lib after install + # See: https://sourceforge.net/p/qwt/patches/45/ + patch :DATA def install - inreplace 'qwtconfig.pri' do |s| - # change_make_var won't work because there are leading spaces + inreplace "qwtconfig.pri" do |s| s.gsub! /^\s*QWT_INSTALL_PREFIX\s*=(.*)$/, "QWT_INSTALL_PREFIX=#{prefix}" + s.sub! /\+(=\s*QwtDesigner)/, "-\\1" if build.without? "plugin" end - args = ['-config', 'release', '-spec'] + args = ["-config", "release", "-spec"] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang and MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end - system 'qmake', *args + + if build.with? "qwtmathml" + args << "QWT_CONFIG+=QwtMathML" + prefix.install "textengines/mathml/qtmmlwidget-license" + end + + system "qmake", *args system "make" - system "make install" + system "make", "install" + + # symlink Qt Designer plugin (note: not removed on qwt formula uninstall) + ln_sf prefix/"plugins/designer/libqwt_designer_plugin.dylib", + Formula["qt"].opt_prefix/"plugins/designer/" if build.with? "plugin" end - def caveats; <<-EOS.undent - The qwtmathml library contains code of the MML Widget from the Qt solutions package. - Beside the Qwt license you also have to take care of its license. - EOS + def caveats + if build.with? "qwtmathml";<<-EOS.undent + The qwtmathml library contains code of the MML Widget from the Qt solutions package. + Beside the Qwt license you also have to take care of its license: + #{opt_prefix}/qtmmlwidget-license + EOS + end end end + +__END__ +diff --git a/designer/designer.pro b/designer/designer.pro +index c269e9d..c2e07ae 100644 +--- a/designer/designer.pro ++++ b/designer/designer.pro +@@ -126,6 +126,16 @@ contains(QWT_CONFIG, QwtDesigner) { + + target.path = $${QWT_INSTALL_PLUGINS} + INSTALLS += target ++ ++ macx { ++ contains(QWT_CONFIG, QwtFramework) { ++ QWT_LIB = qwt.framework/Versions/$${QWT_VER_MAJ}/qwt ++ } ++ else { ++ QWT_LIB = libqwt.$${QWT_VER_MAJ}.dylib ++ } ++ QMAKE_POST_LINK = install_name_tool -change $${QWT_LIB} $${QWT_INSTALL_LIBS}/$${QWT_LIB} $(DESTDIR)$(TARGET) ++ } + } + else { + TEMPLATE = subdirs # do nothing |
