From c51f311c3d1af3ee9d24bdfbdad1e815b92bfba1 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 7 Mar 2014 18:10:16 +0000 Subject: [PATCH] mkvtoolnix: check for Ruby 1.9. Closes Homebrew/homebrew#27329. --- Formula/mkvtoolnix.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Formula/mkvtoolnix.rb b/Formula/mkvtoolnix.rb index d4912c8520..62ede871ff 100644 --- a/Formula/mkvtoolnix.rb +++ b/Formula/mkvtoolnix.rb @@ -1,5 +1,28 @@ require 'formula' +class Ruby19 < Requirement + fatal true + default_formula "ruby" + + satisfy :build_env => false do + next unless which "ruby" + version = /\d\.\d/.match `ruby --version 2>&1` + next unless version + version >= Version.new("1.9") + end + + def modify_build_environment + ruby = which "ruby" + return unless ruby + ENV.prepend_path "PATH", ruby.dirname + end + + def message; <<-EOS.undent + The mkvtoolnix buildsystem needs Ruby >=1.9 + EOS + end +end + class Mkvtoolnix < Formula homepage 'http://www.bunkus.org/videotools/mkvtoolnix/' url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-6.8.0.tar.xz' @@ -8,7 +31,7 @@ class Mkvtoolnix < Formula head 'https://github.com/mbunkus/mkvtoolnix.git' depends_on 'pkg-config' => :build - depends_on 'ruby' => :build if MacOS.version < :mavericks + depends_on Ruby19 depends_on 'boost' => 'c++11' depends_on 'libvorbis' depends_on 'libmatroska' => 'c++11'