aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/gdal.rb6
-rw-r--r--Library/Formula/libharu.rb2
-rw-r--r--Library/Formula/libwmf.rb10
-rw-r--r--Library/Formula/pil.rb7
-rw-r--r--Library/Formula/s-lang.rb13
5 files changed, 23 insertions, 15 deletions
diff --git a/Library/Formula/gdal.rb b/Library/Formula/gdal.rb
index b37e0b644..5daf84a59 100644
--- a/Library/Formula/gdal.rb
+++ b/Library/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/Library/Formula/libharu.rb b/Library/Formula/libharu.rb
index 9600f5eb1..cfb2b3fa8 100644
--- a/Library/Formula/libharu.rb
+++ b/Library/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/Library/Formula/libwmf.rb b/Library/Formula/libwmf.rb
index 5be1d5843..811452e7a 100644
--- a/Library/Formula/libwmf.rb
+++ b/Library/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/Library/Formula/pil.rb b/Library/Formula/pil.rb
index ef0934a5d..7a688b3e2 100644
--- a/Library/Formula/pil.rb
+++ b/Library/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/Library/Formula/s-lang.rb b/Library/Formula/s-lang.rb
index 294f6dbdc..9c0e8d06f 100644
--- a/Library/Formula/s-lang.rb
+++ b/Library/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"