diff options
| author | Jack Nagel | 2014-03-05 20:12:51 -0600 |
|---|---|---|
| committer | Jack Nagel | 2014-03-05 20:45:44 -0600 |
| commit | 7c6cc92c76a4dba0100394c601b6717060d337c2 (patch) | |
| tree | b72c7d762151fd6d96d1c1cd36c60ec77d42d308 | |
| parent | ad7ff7992c6ca693914aedca7a7cec63476a42e1 (diff) | |
| download | homebrew-7c6cc92c76a4dba0100394c601b6717060d337c2.tar.bz2 | |
Remove special X11 proxy deps
| -rw-r--r-- | Library/Formula/gd.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/gdal.rb | 6 | ||||
| -rw-r--r-- | Library/Formula/libharu.rb | 7 | ||||
| -rw-r--r-- | Library/Formula/libwmf.rb | 8 | ||||
| -rw-r--r-- | Library/Formula/s-lang.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/dependency_collector.rb | 16 | ||||
| -rw-r--r-- | Library/Homebrew/requirement.rb | 15 | ||||
| -rw-r--r-- | Library/Homebrew/requirements/x11_dependency.rb | 40 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_dependency_collector.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_x11_dependency.rb | 46 |
10 files changed, 13 insertions, 162 deletions
diff --git a/Library/Formula/gd.rb b/Library/Formula/gd.rb index bb11cc330..807b9a9b5 100644 --- a/Library/Formula/gd.rb +++ b/Library/Formula/gd.rb @@ -28,36 +28,24 @@ class Gd < Formula cause "Undefined symbols when linking" end - def png_prefix - MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix - end - - def fontconfig_prefix - MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/fontconfig" : MacOS::X11.prefix - end - - def freetype_prefix - MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/freetype" : MacOS::X11.prefix - end - def install ENV.universal_binary if build.universal? args = %W{--disable-dependency-tracking --prefix=#{prefix}} if build.with? "libpng" - args << "--with-png=#{png_prefix}" + args << "--with-png=#{Formula["libpng"].opt_prefix}" else args << "--without-png" end if build.with? "fontconfig" - args << "--with-fontconfig=#{fontconfig_prefix}" + args << "--with-fontconfig=#{Formula["fontconfig"].opt_prefix}" else args << "--without-fontconfig" end if build.with? "freetype" - args << "--with-freetype=#{freetype_prefix}" + args << "--with-freetype=#{Formula["freetype"].opt_prefix}" else args << "--without-freetype" end diff --git a/Library/Formula/gdal.rb b/Library/Formula/gdal.rb index 35e29d4d1..91654a00f 100644 --- a/Library/Formula/gdal.rb +++ b/Library/Formula/gdal.rb @@ -55,10 +55,6 @@ 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. @@ -79,7 +75,7 @@ class Gdal < Formula # Backends supported by OS X. "--with-libiconv-prefix=/usr", "--with-libz=/usr", - "--with-png=#{png_prefix}", + "--with-png=#{Formula["libpng"].opt_prefix}", "--with-expat=/usr", "--with-curl=/usr/bin/curl-config", diff --git a/Library/Formula/libharu.rb b/Library/Formula/libharu.rb index cfb2b3fa8..c835b3163 100644 --- a/Library/Formula/libharu.rb +++ b/Library/Formula/libharu.rb @@ -16,16 +16,11 @@ class Libharu < Formula "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/libharu/files/libharu-2.2.1-libpng-1.5.patch?revision=1.1" end - def png_prefix - MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix - end - def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", - # libpng doesn't get picked up - "--with-png=#{png_prefix}" + "--with-png=#{Formula["libpng"].opt_prefix}" system "make install" end end diff --git a/Library/Formula/libwmf.rb b/Library/Formula/libwmf.rb index 3225078b2..f4139be21 100644 --- a/Library/Formula/libwmf.rb +++ b/Library/Formula/libwmf.rb @@ -10,15 +10,11 @@ class Libwmf < Formula depends_on :freetype depends_on :libpng - 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("libpng")}", - "--with-freetype=#{dep_prefix("freetype")}" + "--with-png=#{Formula["libpng"].opt_prefix}", + "--with-freetype=#{Formula["freetype"].opt_prefix}" system "make" ENV.j1 # yet another rubbish Makefile system "make install" diff --git a/Library/Formula/s-lang.rb b/Library/Formula/s-lang.rb index 66c254f96..7b3355cd6 100644 --- a/Library/Formula/s-lang.rb +++ b/Library/Formula/s-lang.rb @@ -10,14 +10,11 @@ class SLang < Formula depends_on 'pcre' => :optional depends_on 'oniguruma' => :optional - def png_prefix - MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix - end - def install + png = Formula["libpng"] system "./configure", "--prefix=#{prefix}", - "--with-pnglib=#{png_prefix}/lib", - "--with-pnginc=#{png_prefix}/include" + "--with-pnglib=#{png.lib}", + "--with-pnginc=#{png.include}" ENV.j1 system "make" system "make install" diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 7982b841e..8204a992f 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -102,11 +102,9 @@ class DependencyCollector # Xcode no longer provides autotools or some other build tools autotools_dep(spec, tags) when :x11 then X11Dependency.new(spec.to_s, tags) - when *X11Dependency::Proxy::PACKAGES - x11_dep(spec, tags) - when :cairo, :pixman - # We no longer use X11 psuedo-deps for cairo or pixman, - # so just return a standard formula dependency. + when :cairo, :fontconfig, :freetype, :libpng, :pixman + # We no longer use X11 proxy deps, but we support the symbols + # for backwards compatibility. Dependency.new(spec.to_s, tags) when :xcode then XcodeDependency.new(tags) when :macos then MinimumMacOSRequirement.new(tags) @@ -137,14 +135,6 @@ class DependencyCollector end end - def x11_dep(spec, tags) - if MacOS.version >= :mountain_lion - Dependency.new(spec.to_s, tags) - else - X11Dependency::Proxy.for(spec.to_s, tags) - end - end - def autotools_dep(spec, tags) return if MacOS::Xcode.provides_autotools? diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 85ef527fd..cb957af32 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -150,21 +150,6 @@ class Requirement end end - # We special case handling of X11Dependency and its subclasses to - # ensure the correct dependencies are present in the final list. - # If an X11Dependency is present after filtering, we eliminate - # all X11Dependency::Proxy objects from the list. If there aren't - # any X11Dependency objects, then we eliminate all but one of the - # proxy objects. - proxy = unless reqs.any? { |r| r.instance_of?(X11Dependency) } - reqs.find { |r| r.kind_of?(X11Dependency::Proxy) } - end - - reqs.reject! do |r| - r.kind_of?(X11Dependency::Proxy) - end - - reqs << proxy unless proxy.nil? reqs end diff --git a/Library/Homebrew/requirements/x11_dependency.rb b/Library/Homebrew/requirements/x11_dependency.rb index 4b030445c..c493d4521 100644 --- a/Library/Homebrew/requirements/x11_dependency.rb +++ b/Library/Homebrew/requirements/x11_dependency.rb @@ -39,44 +39,4 @@ class X11Dependency < Requirement min_version <=> other.min_version end end - - # When X11Dependency is subclassed, the new class should - # also inherit the information specified in the DSL above. - def self.inherited(mod) - instance_variables.each do |ivar| - mod.instance_variable_set(ivar, instance_variable_get(ivar)) - end - end - - # X11Dependency::Proxy is a base class for the X11 pseudo-deps. - # Rather than instantiate it directly, a separate class is built - # for each of the packages that we proxy to X11Dependency. - class Proxy < self - PACKAGES = [:libpng, :freetype, :fontconfig] - - class << self - def defines_const?(const) - if ::RUBY_VERSION >= "1.9" - const_defined?(const, false) - else - const_defined?(const) - end - end - - def for(name, tags=[]) - constant = name.capitalize - - if defines_const?(constant) - klass = const_get(constant) - else - klass = Class.new(self) do - def initialize(name, tags) super end - end - - const_set(constant, klass) - end - klass.new(name, tags) - end - end - end end diff --git a/Library/Homebrew/test/test_dependency_collector.rb b/Library/Homebrew/test/test_dependency_collector.rb index 0f07ba7e6..c6b34b684 100644 --- a/Library/Homebrew/test/test_dependency_collector.rb +++ b/Library/Homebrew/test/test_dependency_collector.rb @@ -101,16 +101,6 @@ class DependencyCollectorTests < Test::Unit::TestCase assert_nil @d.build(:libtool) end - def test_x11_proxy_dep_mountain_lion - MacOS.stubs(:version).returns(MacOS::Version.new("10.8")) - assert_equal Dependency.new("libpng"), @d.build(:libpng) - end - - def test_x11_proxy_dep_lion_or_older - MacOS.stubs(:version).returns(MacOS::Version.new("10.7")) - assert_equal X11Dependency::Proxy.new(:libpng), @d.build(:libpng) - end - def test_ld64_dep_pre_leopard MacOS.stubs(:version).returns(MacOS::Version.new("10.4")) assert_equal LD64Dependency.new, @d.build(:ld64) diff --git a/Library/Homebrew/test/test_x11_dependency.rb b/Library/Homebrew/test/test_x11_dependency.rb index 884a7cd27..6c56ac87f 100644 --- a/Library/Homebrew/test/test_x11_dependency.rb +++ b/Library/Homebrew/test/test_x11_dependency.rb @@ -19,35 +19,6 @@ class X11DependencyTests < Test::Unit::TestCase assert !y.eql?(x) end - def test_proxy_for - x = X11Dependency::Proxy.for("libpng") - assert_instance_of X11Dependency::Proxy::Libpng, x - assert_kind_of X11Dependency, x - end - - def test_proxy_eql_instances_are_eql - x = X11Dependency::Proxy.for("libpng") - y = X11Dependency::Proxy.for("libpng") - assert x.eql?(y) - assert y.eql?(x) - assert x.hash == y.hash - end - - def test_proxy_not_eql_when_hashes_differ - x = X11Dependency::Proxy.for("libpng") - y = X11Dependency::Proxy.for("fontconfig") - assert x.hash != y.hash - assert !x.eql?(y) - assert !y.eql?(x) - end - - def test_x_never_eql_to_proxy_x11_dep - x = X11Dependency.new("libpng") - p = X11Dependency::Proxy.for("libpng") - assert !x.eql?(p) - assert !p.eql?(x) - end - def test_x_env x = X11Dependency.new x.stubs(:satisfied?).returns(true) @@ -55,20 +26,3 @@ class X11DependencyTests < Test::Unit::TestCase x.modify_build_environment end end - -class X11DepCollectionTests < Test::Unit::TestCase - def setup - @set = ComparableSet.new - end - - def test_x_can_coxist_with_proxy - @set << X11Dependency.new << X11Dependency::Proxy.for("libpng") - assert_equal 2, @set.count - end - - def test_multiple_proxies_can_coexist - @set << X11Dependency::Proxy.for("libpng") - @set << X11Dependency::Proxy.for("fontconfig") - assert_equal 2, @set.count - end -end |
