Make the use of paths to packages proxied through X11 consistent

This commit is contained in:
Jack Nagel 2013-07-13 22:56:45 -05:00
parent 850001f7d3
commit d89e9a0c8b
5 changed files with 23 additions and 15 deletions

View file

@ -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",

View file

@ -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

View file

@ -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"

View file

@ -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")',

View file

@ -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"