Permalink
Browse files

qt: add shared 'plugins' path for use by formulae

This path is located in `lib/qt4/plugins` in the Homebrew prefix, thus
formulae wishing to make their plug-ins available to Qt Designer can
install them in `lib/qt4/plugins` inside their formula prefix. These
will be later symlinked into the Homebrew prefix.

This new path is only searched by Qt Designer and in addition to the
path that contains the plug-ins distributed with Qt.
  • Loading branch information...
UniqMartin committed Dec 27, 2015
1 parent c407ef9 commit 80be187665ec72374ed246617fbad0ae5adb62cf
Showing with 11 additions and 1 deletion.
  1. +11 −1 Formula/qt.rb
View
@@ -1,7 +1,7 @@
class Qt < Formula
desc "Cross-platform application and UI framework"
homepage "https://www.qt.io/"
revision 1
revision 2
head "https://code.qt.io/qt/qt.git", :branch => "4.8"
@@ -125,12 +125,22 @@ def install
include.install_symlink path => path.parent.basename(".framework")
end
# Make `HOMEBREW_PREFIX/lib/qt4/plugins` an additional plug-in search path
# for Qt Designer to support formulae that provide Qt Designer plug-ins.
system "/usr/libexec/PlistBuddy",
"-c", "Add :LSEnvironment:QT_PLUGIN_PATH string \"#{HOMEBREW_PREFIX}/lib/qt4/plugins\"",
"#{bin}/Designer.app/Contents/Info.plist"
Pathname.glob("#{bin}/*.app") { |app| mv app, prefix }
end
def caveats; <<-EOS.undent
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
Qt Designer no longer picks up changes to the QT_PLUGIN_PATH environment
variable as it was tweaked to search for plug-ins provided by formulae in
#{HOMEBREW_PREFIX}/lib/qt4/plugins
EOS
end

0 comments on commit 80be187

Please sign in to comment.