chipmunk 7.0.0, add test
Closes Homebrew/homebrew#38836. Signed-off-by: Brett Koonce <koonce@gmail.com>
This commit is contained in:
parent
1a5c041018
commit
ffb42c67ab
1 changed files with 29 additions and 11 deletions
|
@ -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"
|
||||
|
||||
depends_on 'cmake' => :build
|
||||
head "https://github.com/slembcke/Chipmunk2D.git"
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue