Skip to content

Commit

Permalink
Use opt helpers instead of hardcoded paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jacknagel committed Oct 27, 2014
1 parent 75c8d94 commit cc75e44
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Formula/avidemux.rb
Expand Up @@ -133,7 +133,7 @@ def install
mkdir_p app/"MacOS"
cp_r "./cmake/osx/Avidemux2.6", app/"MacOS/Avidemux2.6.app"
chmod 0755, app/"MacOS/Avidemux2.6.app"
cp_r Formula['qt'].opt_prefix/"lib/QtGui.framework/Resources/qt_menu.nib", app/"MacOS/" if build.with? 'qt'
cp_r "#{Formula['qt'].opt_lib}/QtGui.framework/Resources/qt_menu.nib", app/"MacOS/" if build.with? 'qt'
cp "./cmake/osx/Info.plist", app
(app/"Resources").install_symlink bin, lib
cp Dir["./cmake/osx/*.icns"], app/"Resources/"
Expand Down
4 changes: 2 additions & 2 deletions Formula/bash-git-prompt.rb
Expand Up @@ -16,9 +16,9 @@ def install

def caveats; <<-EOS.undent
You should add the following to your .bashrc (or equivalent):
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
fi
EOS
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/dar.rb
Expand Up @@ -25,8 +25,8 @@ class Dar < Formula
depends_on "upx" => :build if build.with? "upx"

def install
ENV.prepend_path 'PATH', "#{Formula['gnu-sed'].opt_prefix}/libexec/gnubin"
ENV.prepend_path 'PATH', "#{Formula['coreutils'].libexec}/gnubin" if build.with? "docs"
ENV.prepend_path 'PATH', "#{Formula['gnu-sed'].opt_libexec}/gnubin"
ENV.prepend_path 'PATH', "#{Formula['coreutils'].opt_libexec}/gnubin" if build.with? "docs"
ENV.libstdcxx if ENV.compiler == :clang && MacOS.version >= :mavericks

args = %W[
Expand Down
2 changes: 1 addition & 1 deletion Formula/easy-tag.rb
Expand Up @@ -23,7 +23,7 @@ class EasyTag < Formula
depends_on "wavpack" => :optional

def install
ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].lib}/python2.7/site-packages"
ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make"
Expand Down
3 changes: 2 additions & 1 deletion Formula/emscripten.rb
Expand Up @@ -86,7 +86,8 @@ def install
end

def caveats; <<-EOS.undent
Manually set LLVM_ROOT to \"#{opt_prefix}/libexec/llvm/bin\"
Manually set LLVM_ROOT to
#{opt_libexec}/llvm/bin
in ~/.emscripten after running `emcc` for the first time.
EOS
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/gcc.rb
Expand Up @@ -129,7 +129,7 @@ def install
args << "--disable-nls" if build.without? "nls"

if build.with?("java") || build.with?("all-languages")
args << "--with-ecj-jar=#{Formula["ecj"].opt_prefix}/share/java/ecj.jar"
args << "--with-ecj-jar=#{Formula["ecj"].opt_share}/java/ecj.jar"
end

if build.without?("multilib") || !MacOS.prefer_64_bit?
Expand Down
2 changes: 1 addition & 1 deletion Formula/git-flow-avh.rb
Expand Up @@ -26,7 +26,7 @@ def install
system "make", "prefix=#{libexec}", "install"
(bin/'git-flow').write <<-EOS.undent
#!/bin/bash
export FLAGS_GETOPT_CMD=#{HOMEBREW_PREFIX}/opt/gnu-getopt/bin/getopt
export FLAGS_GETOPT_CMD=#{Formula["gnu-getopt"].opt_bin}/getopt
exec "#{libexec}/bin/git-flow" "$@"
EOS

Expand Down
2 changes: 1 addition & 1 deletion Formula/gnome-doc-utils.rb
Expand Up @@ -26,7 +26,7 @@ class GnomeDocUtils < Formula
def install
# Find our docbook catalog
ENV['XML_CATALOG_FILES'] = "#{etc}/xml/catalog"
ENV.append_path 'PYTHONPATH', HOMEBREW_PREFIX/"opt/libxml2/lib/python2.7/site-packages"
ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages"

system "./configure", "--prefix=#{prefix}",
"--disable-scrollkeeper",
Expand Down
2 changes: 1 addition & 1 deletion Formula/gst-libav.rb
Expand Up @@ -43,6 +43,6 @@ def install
end

test do
system Formula["gstreamer"].opt_prefix/"bin/gst-inspect-1.0", "libav"
system "#{Formula["gstreamer"].opt_bin}/gst-inspect-1.0", "libav"
end
end
2 changes: 1 addition & 1 deletion Formula/ircd-irc2.rb
Expand Up @@ -62,7 +62,7 @@ def plist; <<-EOS.undent
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/ircd</string>
<string>#{opt_sbin}/ircd</string>
<string>-t</string>
</array>
<key>RunAtLoad</key>
Expand Down
3 changes: 1 addition & 2 deletions Formula/itstool.rb
Expand Up @@ -23,8 +23,7 @@ class Itstool < Formula
depends_on 'libxml2' => 'with-python'

def install
ENV.append_path 'PYTHONPATH', "#{Formula["libxml2"].lib}/python2.7/site-packages"

ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages"
system "./autogen.sh" if build.head?
system "./configure", "--prefix=#{prefix}"
system "make install"
Expand Down
2 changes: 1 addition & 1 deletion Formula/keybase.rb
Expand Up @@ -20,7 +20,7 @@ def install
(bin/"keybase").write <<-EOS.undent
#!/bin/sh
export KEYBASE_BIN="#{bin}/keybase"
exec "#{HOMEBREW_PREFIX}/opt/node/bin/node" "#{libexec}/bin/main.js" "$@"
exec "#{Formula["node"].opt_bin}/node" "#{libexec}/bin/main.js" "$@"
EOS
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/knot.rb
Expand Up @@ -90,7 +90,7 @@ def plist; <<-EOS.undent
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/knotd</string>
<string>#{opt_sbin}/knotd</string>
<string>-c</string>
<string>#{etc}/knot.conf</string>
</array>
Expand Down
2 changes: 1 addition & 1 deletion Formula/liblwgeom.rb
Expand Up @@ -59,7 +59,7 @@ def install
]

if build.head?
args << "--with-pgconfig=#{Formula["postgresql"].opt_prefix.realpath}/bin/pg_config"
args << "--with-pgconfig=#{Formula["postgresql"].opt_bin}/pg_config"
end

system './autogen.sh'
Expand Down
2 changes: 1 addition & 1 deletion Formula/mysql-cluster.rb
Expand Up @@ -127,7 +127,7 @@ def caveats; <<-EOS.undent
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql-cluster)" --datadir=#{var}/mysql-cluster/mysqld_data --tmpdir=/tmp
mysql_install_db --verbose --user=`whoami` --basedir="#{opt_prefix}" --datadir=#{var}/mysql-cluster/mysqld_data --tmpdir=/tmp
For a first cluster, you may start with a single MySQL Server (mysqld),
a pair of Data Nodes (ndbd) and a single management node (ndb_mgmd):
Expand Down
6 changes: 3 additions & 3 deletions Formula/nginx.rb
Expand Up @@ -124,16 +124,16 @@ def post_install
def passenger_caveats; <<-EOS.undent
To activate Phusion Passenger, add this to #{etc}/nginx/nginx.conf, inside the 'http' context:
passenger_root #{HOMEBREW_PREFIX}/opt/passenger/libexec/lib/phusion_passenger/locations.ini;
passenger_root #{Formula["passenger"].opt_libexec}/lib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
EOS
end

def caveats
s = <<-EOS.undent
Docroot is: #{HOMEBREW_PREFIX}/var/www
Docroot is: #{var}/www
The default port has been set in #{HOMEBREW_PREFIX}/etc/nginx/nginx.conf to 8080 so that
The default port has been set in #{etc}/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
EOS
s << passenger_caveats if build.with? "passenger"
Expand Down
2 changes: 1 addition & 1 deletion Formula/pgtap.rb
Expand Up @@ -41,7 +41,7 @@ def install
system './Build', 'install'
end

pg_config = Formula["postgresql"].opt_prefix/'bin/pg_config'
pg_config = "#{Formula["postgresql"].opt_bin}/pg_config"
system "make", "PG_CONFIG=#{pg_config}"
system "make", "PG_CONFIG=#{pg_config}", "install"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/pow.rb
Expand Up @@ -12,7 +12,7 @@ def install
(bin/"pow").write <<-EOS.undent
#!/bin/sh
export POW_BIN="#{bin}/pow"
exec "#{HOMEBREW_PREFIX}/opt/node/bin/node" "#{libexec}/lib/command.js" "$@"
exec "#{Formula["node"].opt_bin}/node" "#{libexec}/lib/command.js" "$@"
EOS
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/pygtkglext.rb
Expand Up @@ -11,7 +11,7 @@ class Pygtkglext < Formula
depends_on 'pygobject'

def install
ENV['PYGTK_CODEGEN'] = Formula["pygobject"].opt_prefix/'bin/pygobject-codegen-2.0'
ENV['PYGTK_CODEGEN'] = "#{Formula["pygobject"].opt_bin}/pygobject-codegen-2.0"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
Expand Down
2 changes: 1 addition & 1 deletion Formula/pyqt.rb
Expand Up @@ -34,7 +34,7 @@ def install
end

Language::Python.each_python(build) do |python, version|
ENV.append_path "PYTHONPATH", HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages"
ENV.append_path "PYTHONPATH", "#{Formula["sip"].opt_lib}/python#{version}/site-packages"

args = ["--confirm-license",
"--bindir=#{bin}",
Expand Down
2 changes: 1 addition & 1 deletion Formula/python.rb
Expand Up @@ -234,7 +234,7 @@ def distutils_fix_superenv(args)
# superenv handles that cc finds includes/libs!
inreplace "setup.py",
"do_readline = self.compiler.find_library_file(lib_dirs, 'readline')",
"do_readline = '#{HOMEBREW_PREFIX}/opt/readline/lib/libhistory.dylib'"
"do_readline = '#{Formula["readline"].opt_lib}/libhistory.dylib'"
end

def distutils_fix_stdenv
Expand Down
2 changes: 1 addition & 1 deletion Formula/python3.rb
Expand Up @@ -192,7 +192,7 @@ def distutils_fix_superenv(args)
# superenv makes cc always find includes/libs!
inreplace "setup.py",
"do_readline = self.compiler.find_library_file(lib_dirs, 'readline')",
"do_readline = '#{HOMEBREW_PREFIX}/opt/readline/lib/libhistory.dylib'"
"do_readline = '#{Formula["readline"].opt_lib}/libhistory.dylib'"
end

def distutils_fix_stdenv
Expand Down
2 changes: 1 addition & 1 deletion Formula/shrewsoft-vpn-client.rb
Expand Up @@ -79,7 +79,7 @@ def plist; <<-EOF.undent
<string>net.shrew.iked</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/iked</string>
<string>#{opt_sbin}/iked</string>
<string>-F</string>
</array>
<key>RunAtLoad</key>
Expand Down
4 changes: 2 additions & 2 deletions Formula/xplanetfx.rb
Expand Up @@ -37,8 +37,8 @@ def install

prefix.install "bin", "share"

path = "#{Formula["coreutils"].opt_prefix}/libexec/gnubin"
path += ":#{Formula["gnu-sed"].opt_prefix}/libexec/gnubin" if build.with?("gnu-sed")
path = "#{Formula["coreutils"].opt_libexec}/gnubin"
path += ":#{Formula["gnu-sed"].opt_libexec}/gnubin" if build.with?("gnu-sed")
if build.with?("perlmagick")
perl_version = `/usr/bin/perl -e 'printf "%vd", $^V;'`
ENV.prepend_create_path "PERL5LIB", "#{HOMEBREW_PREFIX}/lib/perl5/site_perl/#{perl_version}"
Expand Down
5 changes: 1 addition & 4 deletions Formula/zenity.rb
Expand Up @@ -13,12 +13,9 @@ class Zenity < Formula
depends_on 'scrollkeeper'

def install
ENV.append_path 'PYTHONPATH', HOMEBREW_PREFIX/"opt/libxml2/lib/python2.7/site-packages"

ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages"
system "./configure", "--prefix=#{prefix}"

system "make"
system "make install"
end

end

0 comments on commit cc75e44

Please sign in to comment.