diff --git a/Formula/cattle.rb b/Formula/cattle.rb index 9d5b931a21f5a..dfa3050c29a55 100644 --- a/Formula/cattle.rb +++ b/Formula/cattle.rb @@ -1,8 +1,11 @@ class Cattle < Formula desc "Brainfuck language toolkit" homepage "https://github.com/andreabolognani/cattle" - url "https://github.com/andreabolognani/cattle/archive/cattle-1.2.0.tar.gz" - sha256 "ff0b424011c56f61cb463f1d3fb32e58e40da41260298c407bd0748eb506468d" + # Source archive tarball results in "./ChangeLog: No such file or directory" + # Reported 12 Sep 2016 https://github.com/andreabolognani/cattle/issues/4 + url "https://github.com/andreabolognani/cattle.git", + :tag => "cattle-1.2.1", + :revision => "338a34f7abc35334afd378f305c6e1fb0d0abd7d" head "https://github.com/andreabolognani/cattle.git" bottle do @@ -12,12 +15,6 @@ class Cattle < Formula sha256 "798aa25810d5dbfa2526cf0edf9117798b311c6ae6ce42b3a05c0bc90d087125" => :mountain_lion end - # https://github.com/andreabolognani/cattle/issues/2 - patch do - url "https://github.com/andreabolognani/cattle/pull/3.diff" - sha256 "876802fd965050d95e9cd7836b71a3cac5cd2508bf7f45b17192803a6fe19c17" - end - depends_on "gtk-doc" => :build depends_on "pkg-config" => :build depends_on "autoconf" => :build @@ -27,12 +24,28 @@ class Cattle < Formula depends_on "gobject-introspection" def install - inreplace "autogen.sh", "libtoolize", "glibtoolize" + pkgshare.mkpath + cp_r ["examples", "tests"], pkgshare + rm Dir["#{pkgshare}/{examples,tests}/{Makefile.am,.gitignore}"] + inreplace "autogen.sh", "libtoolize", "glibtoolize" system "sh", "autogen.sh" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "install" end + + test do + cp_r (pkgshare/"examples").children, testpath + cp_r (pkgshare/"tests").children, testpath + system ENV.cc, "common.c", "run.c", "-o", "test", + "-I#{include}/cattle-1.0", + "-I#{Formula["glib"].include}/glib-2.0", + "-I#{Formula["glib"].lib}/glib-2.0/include", + "-L#{lib}", + "-L#{Formula["glib"].lib}", + "-lcattle-1.0", "-lglib-2.0", "-lgio-2.0", "-lgobject-2.0" + assert_match "Unbalanced brackets", shell_output("./test program.c 2>&1", 1) + end end