aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlex Dunn2015-04-19 13:50:32 -0700
committerBrett Koonce2015-04-19 20:16:21 -0700
commit53a668b30d97c2959a300b7ee3b47db80aaa3343 (patch)
tree0ca046bd7f7c5ac25d8a1732b0be32d1f61eeff5 /Library
parentdfd9f0d3c8db5f15f55f69d16fd259d46f8d5fbc (diff)
downloadhomebrew-53a668b30d97c2959a300b7ee3b47db80aaa3343.tar.bz2
chipmunk 7.0.0, add test
Closes #38836. Signed-off-by: Brett Koonce <koonce@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/chipmunk.rb40
1 files changed, 29 insertions, 11 deletions
diff --git a/Library/Formula/chipmunk.rb b/Library/Formula/chipmunk.rb
index 6444238cd..f10ad7648 100644
--- a/Library/Formula/chipmunk.rb
+++ b/Library/Formula/chipmunk.rb
@@ -1,17 +1,35 @@
-require 'formula'
-
class Chipmunk < Formula
- homepage 'http://chipmunk-physics.net/'
- url 'https://chipmunk-physics.net/release/Chipmunk-6.x/Chipmunk-6.2.1.tgz'
- sha1 '593a15a9032586e56b16d22d84f4f04c1f11a44e'
+ homepage "http://chipmunk-physics.net/"
+ url "http://chipmunk-physics.net/release/Chipmunk-7.x/Chipmunk-7.0.0.tgz"
+ sha256 "14ab380396a96b15951c42a2d7ca259a53ecab4e550a71857d13dcfd388a51cd"
+
+ head "https://github.com/slembcke/Chipmunk2D.git"
- depends_on 'cmake' => :build
+ depends_on "cmake" => :build
def install
- system "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}",
- "-DCMAKE_BUILD_TYPE=Release",
- "-DBUILD_DEMOS=OFF",
- "."
- system "make install"
+ system "cmake", ".", "-DBUILD_DEMOS=OFF", *std_cmake_args
+ system "make", "install"
+
+ doc.install Dir["doc/*"]
+ end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <stdio.h>
+ #include <chipmunk.h>
+
+ int main(void){
+ cpVect gravity = cpv(0, -100);
+ cpSpace *space = cpSpaceNew();
+ cpSpaceSetGravity(space, gravity);
+
+ cpSpaceFree(space);
+ return 0;
+ }
+ EOS
+ system ENV.cc, "-I#{include}/chipmunk", "-L#{lib}", "-lchipmunk",
+ testpath/"test.c", "-o", testpath/"test"
+ system "./test"
end
end