Skip to content

Commit

Permalink
cattle 1.2.1
Browse files Browse the repository at this point in the history
build from tag
install examples and tests
add a test

Closes #4736.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
  • Loading branch information
ilovezfs committed Sep 12, 2016
1 parent 0348bcb commit 557e465
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions 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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 557e465

Please sign in to comment.