From 986cb6764e4d00ebea9974bbbab09924f145be2f Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 15 Dec 2013 14:22:21 -0800 Subject: charm-tools: sandbox build to hide python libs See #23378. --- Library/Formula/charm-tools.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/charm-tools.rb b/Library/Formula/charm-tools.rb index 115d7529d..c69244cee 100644 --- a/Library/Formula/charm-tools.rb +++ b/Library/Formula/charm-tools.rb @@ -10,7 +10,19 @@ class CharmTools < Formula def install python do - system python, "setup.py", "install", "--prefix=#{prefix}" + system python, "setup.py", "install", "--prefix=#{libexec}" + end + + # charm-tools installs its own copies of many, many common python + # libraries; these shim scripts makes sure the privately-installed + # tools can find them + Dir[libexec/'bin/*charm*'].each do |tool| + toolname = File.basename(tool) + (bin/toolname).write <<-EOS.undent + #!/bin/sh + export PYTHONPATH=#{libexec}/lib/python2.7/site-packages + exec #{tool} + EOS end end -- cgit v1.2.3