From 88189482587178c95bfdc2f13944151d8f1e8f02 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 15 Dec 2013 14:22:21 -0800 Subject: [PATCH] charm-tools: sandbox build to hide python libs See Homebrew/homebrew#23378. --- Formula/charm-tools.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Formula/charm-tools.rb b/Formula/charm-tools.rb index 115d7529dbf17..c69244cee2a0d 100644 --- a/Formula/charm-tools.rb +++ b/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