aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-01-04 13:06:41 +0000
committerMike McQuaid2014-01-04 13:19:23 +0000
commitdce2bd350ffb4f8e97b19c9922d1ee77dfae34c4 (patch)
tree932e61d88122901d8ccd841353989b2357745c87 /Library
parent6c07d038601a03bc51ecc930cf2031ced786291c (diff)
downloadhomebrew-dce2bd350ffb4f8e97b19c9922d1ee77dfae34c4.tar.bz2
googlecl: cleanup python usage.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/googlecl.rb25
1 files changed, 4 insertions, 21 deletions
diff --git a/Library/Formula/googlecl.rb b/Library/Formula/googlecl.rb
index c578482ef..043dc6506 100644
--- a/Library/Formula/googlecl.rb
+++ b/Library/Formula/googlecl.rb
@@ -9,29 +9,12 @@ class Googlecl < Formula
conflicts_with 'osxutils', :because => 'both install a google binary'
- # TODO: Move this into Library/Homebrew somewhere (see also ansible.rb).
- def wrap bin_file, pythonpath
- bin_file = Pathname.new bin_file
- libexec_bin = Pathname.new libexec/'bin'
- libexec_bin.mkpath
- mv bin_file, libexec_bin
- bin_file.write <<-EOS.undent
- #!/bin/sh
- PYTHONPATH="#{pythonpath}:$PYTHONPATH" "#{libexec_bin}/#{bin_file.basename}" "$@"
- EOS
- end
-
def install
- inreplace 'src/googlecl/__init__.py',
- "__author__ = 'tom.h.miller@gmail.com (Tom Miller)'",
- "__author__ = 'tom.h.miller@gmail.com (Tom Miller)'; import site; site.addsitedir('#{python.private_site_packages}')"
-
- system python, "setup.py", "install",
- "--prefix=#{prefix}",
- "--single-version-externally-managed",
- "--record=installed.txt"
+ system "python", "setup.py", "install",
+ "--prefix=#{prefix}", "--single-version-externally-managed",
+ "--record=installed.txt"
- wrap "#{bin}/google", python.site_packages
+ bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
end
test do