From 0318e67f48c087d1fe1c9fb4385f9bbbe86baf9e Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sun, 17 Mar 2013 20:07:52 +0100 Subject: [PATCH] chouchdb: Needs Erlang <= R15B, print workaround. Adds an Requirement for Erlang not greater than R15B. Closes Homebrew/homebrew#18548. Signed-off-by: Samuel John --- Formula/couchdb.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Formula/couchdb.rb b/Formula/couchdb.rb index 250e2a169c..5e9e081672 100644 --- a/Formula/couchdb.rb +++ b/Formula/couchdb.rb @@ -1,5 +1,35 @@ require 'formula' +class Erlang16Incompat < Requirement + fatal true + + def version + Formula.factory('erlang').version + end + + satisfy do + version =~ /R(\d{2})B/ + $1.to_i > 15 + end + + def message; <<-EOS.undent + Erlang <= R15B03-1 is required to install. + + You have a erlang version #{version} + + The work-around is: + + brew unlink erlang + cd #{HOMEBREW_REPOSITORY} + git checkout 168742f Library/Formula/erlang.rb + brew install erlang + brew install couchdb + + EOS + end +end + + class Couchdb < Formula homepage "http://couchdb.apache.org/" url 'http://www.apache.org/dyn/closer.cgi?path=/couchdb/1.2.1/apache-couchdb-1.2.1.tar.gz' @@ -7,6 +37,7 @@ class Couchdb < Formula head 'http://git-wip-us.apache.org/repos/asf/couchdb.git' + depends_on Erlang16Incompat depends_on 'help2man' => :build depends_on 'spidermonkey' depends_on 'icu4c'