From d89e9a0c8bf34cea9278cbe27b85ac607ede846a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 13 Jul 2013 22:56:45 -0500 Subject: [PATCH] Make the use of paths to packages proxied through X11 consistent --- Formula/gdal.rb | 6 +++++- Formula/libharu.rb | 2 +- Formula/libwmf.rb | 10 ++++++---- Formula/pil.rb | 7 ++++--- Formula/s-lang.rb | 13 +++++++------ 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Formula/gdal.rb b/Formula/gdal.rb index b37e0b6442..5daf84a59a 100644 --- a/Formula/gdal.rb +++ b/Formula/gdal.rb @@ -56,6 +56,10 @@ class Gdal < Formula depends_on "poppler" end + def png_prefix + MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix + end + def get_configure_args args = [ # Base configuration. @@ -76,7 +80,7 @@ class Gdal < Formula # Backends supported by OS X. "--with-libiconv-prefix=/usr", "--with-libz=/usr", - "--with-png=#{(MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix}", + "--with-png=#{png_prefix}", "--with-expat=/usr", "--with-curl=/usr/bin/curl-config", diff --git a/Formula/libharu.rb b/Formula/libharu.rb index 9600f5eb17..cfb2b3fa8b 100644 --- a/Formula/libharu.rb +++ b/Formula/libharu.rb @@ -17,7 +17,7 @@ class Libharu < Formula end def png_prefix - MacOS::X11.installed? ? MacOS::X11.prefix : HOMEBREW_PREFIX/:opt/:libpng + MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix end def install diff --git a/Formula/libwmf.rb b/Formula/libwmf.rb index 5be1d5843e..811452e7a8 100644 --- a/Formula/libwmf.rb +++ b/Formula/libwmf.rb @@ -10,13 +10,15 @@ class Libwmf < Formula depends_on :freetype depends_on :libpng - def install - dep_prefix = (MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix + def dep_prefix(dep) + MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/#{dep}" : MacOS::X11.prefix + end + def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", - "--with-png=#{dep_prefix}", - "--with-freetype=#{dep_prefix}" + "--with-png=#{dep_prefix("libpng")}", + "--with-freetype=#{dep_prefix("freetype")}" system "make" ENV.j1 # yet another rubbish Makefile system "make install" diff --git a/Formula/pil.rb b/Formula/pil.rb index ef0934a5de..7a688b3e20 100644 --- a/Formula/pil.rb +++ b/Formula/pil.rb @@ -16,6 +16,10 @@ class Pil < Formula DATA end + def freetype_prefix + MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/freetype" : MacOS::X11.prefix + end + def install # Find the arch for the Python we are building against. # We remove 'ppc' support, so we can pass Intel-optimized CFLAGS. @@ -26,9 +30,6 @@ class Pil < Formula archs.delete :x86_64 if Hardware.is_32_bit? ENV['ARCHFLAGS'] = archs.as_arch_flags - freetype = Formula.factory('freetype') - freetype_prefix = Formula.factory('freetype').installed? ? freetype.prefix : MacOS::X11.prefix - inreplace "setup.py" do |s| # Tell setup where Freetype2 is on 10.5/10.6 s.gsub! 'add_directory(include_dirs, "/sw/include/freetype2")', diff --git a/Formula/s-lang.rb b/Formula/s-lang.rb index 294f6dbdc6..9c0e8d06f8 100644 --- a/Formula/s-lang.rb +++ b/Formula/s-lang.rb @@ -6,17 +6,18 @@ class SLang < Formula mirror 'http://pkgs.fedoraproject.org/repo/pkgs/slang/slang-2.2.4.tar.bz2/7fcfd447e378f07dd0c0bae671fe6487/slang-2.2.4.tar.bz2' sha1 '34e68a993888d0ae2ebc7bc31b40bc894813a7e2' - depends_on :libpng # For png-module.so + depends_on :libpng depends_on 'pcre' => :optional depends_on 'oniguruma' => :optional - def install - pnglib = MacOS::X11.installed? ? MacOS::X11.lib : HOMEBREW_PREFIX/'lib' - pnginc = MacOS::X11.installed? ? MacOS::X11.include : HOMEBREW_PREFIX/'include' + def png_prefix + MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix + end + def install system "./configure", "--prefix=#{prefix}", - "--with-pnglib=#{pnglib}", - "--with-pnginc=#{pnginc}" + "--with-pnglib=#{png_prefix}/lib" + "--with-pnginc=#{png_prefix}/include" ENV.j1 system "make" system "make install"