diff options
| author | Mike McQuaid | 2013-12-14 19:45:33 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-12-14 19:45:33 +0000 |
| commit | fc1d1173b4e3d050a231fcee62500a4979f1932e (patch) | |
| tree | 75a980e8176cb733147da5dbedb4de3e9f162a06 /Library | |
| parent | 080cd150acf5d4381d47d2f8ed962a6544c3981c (diff) | |
| download | homebrew-fc1d1173b4e3d050a231fcee62500a4979f1932e.tar.bz2 | |
duplicity: wrap with PYTHONPATH.
Closes #24062.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/duplicity.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Formula/duplicity.rb b/Library/Formula/duplicity.rb index fac48eb62..b4b89959a 100644 --- a/Library/Formula/duplicity.rb +++ b/Library/Formula/duplicity.rb @@ -11,11 +11,26 @@ class Duplicity < Formula option :universal + # 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 python do ENV.universal_binary if build.universal? # Install mostly into libexec system python, "setup.py", "install", "--prefix=#{prefix}" + Dir["#{bin}/*"].each do |bin_file| + wrap bin_file, python.site_packages + end end end end |
