diff options
| author | Samuel John | 2012-12-13 19:55:53 +0100 |
|---|---|---|
| committer | Adam Vandenberg | 2012-12-14 09:24:06 -0800 |
| commit | 2b42d5be618dfa772a7b1c5fdcabb6b0ca5521b6 (patch) | |
| tree | e9f9e2d7ef558d0641196914661b6a5468a98e77 /Library | |
| parent | 63dcf18de973015acafecf1638e7f031c0994ed3 (diff) | |
| download | homebrew-2b42d5be618dfa772a7b1c5fdcabb6b0ca5521b6.tar.bz2 | |
pil: Uninstall correctly.
Installs now into the cellar, so that uninstall works.
Closes #16558.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/pil.rb | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Library/Formula/pil.rb b/Library/Formula/pil.rb index e9865b1e7..150a6f24c 100644 --- a/Library/Formula/pil.rb +++ b/Library/Formula/pil.rb @@ -9,7 +9,7 @@ class Pil < Formula depends_on :freetype depends_on 'jpeg' => :recommended - depends_on 'little-cms'=> :optional unless build.include? 'with-little-cms' + depends_on 'little-cms' => :optional unless build.include? 'with-little-cms' # The patch is to fix a core dump in Bug in PIL's quantize() with 64 bit architectures. # http://mail.python.org/pipermail/image-sig/2012-June/007047.html @@ -46,8 +46,24 @@ class Pil < Formula "add_directory(include_dirs, \"#{HOMEBREW_PREFIX}/include\")" end - system "python", "setup.py", "build_ext" - system "python", "setup.py", "install", "--prefix=#{prefix}" + # In order to install into the Cellar, the dir must exist and be in the + # PYTHONPATH. + temp_site_packages = lib/which_python/'site-packages' + mkdir_p temp_site_packages + ENV['PYTHONPATH'] = temp_site_packages + args = [ + "--no-user-cfg", + "--verbose", + "install", + "--force", + "--install-scripts=#{share}/python", + "--install-lib=#{temp_site_packages}", + "--install-data=#{share}", + "--install-headers=#{include}", + "--record=installed-files.txt" + ] + system "python", "-s", "setup.py", *args + end def caveats; <<-EOS.undent @@ -56,6 +72,10 @@ class Pil < Formula the build will fail. EOS end + + def which_python + "python" + `python -c 'import sys;print(sys.version[:3])'`.strip + end end __END__ |
