From 2a56b79451476b42601d6d924e8da6c99deb5d2f Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Tue, 3 Feb 2015 09:53:56 +0100 Subject: [PATCH] ccextractor: cmake-based install and proper test added Closes Homebrew/homebrew#36491. Signed-off-by: Mike McQuaid --- Formula/ccextractor.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Formula/ccextractor.rb b/Formula/ccextractor.rb index 80d38c5683..8ccd1bbf36 100644 --- a/Formula/ccextractor.rb +++ b/Formula/ccextractor.rb @@ -3,6 +3,10 @@ class Ccextractor < Formula url "https://downloads.sourceforge.net/project/ccextractor/ccextractor/0.75/ccextractor.src.0.75.zip" sha1 "c36f8eadb2074d88782d6628e07c762e80e4c31c" head "https://github.com/ccextractor/ccextractor.git" + revision 1 + + depends_on "cmake" => :build + depends_on "libpng" bottle do cellar :any @@ -12,15 +16,15 @@ class Ccextractor < Formula end def install - cd "mac" do - system "bash", "./build.command" - bin.install "ccextractor" - end - (share+"examples").install "docs/ccextractor.cnf.sample" + system "cmake", "src", *std_cmake_args + system "make" + system "make", "install" + (share/"examples").install "docs/ccextractor.cnf.sample" end test do - # Without a closed captioned file to play with, we're limited here. - assert_match /outputfilename/, pipe_output("#{bin}/ccextractor 2>&1") + touch testpath/"test" + system "ccextractor", "test" + assert File.exist? "test.srt" end end