From 7442c8fa1cff694a3be1229a5aceaeb95abdb179 Mon Sep 17 00:00:00 2001 From: Frizlab Date: Fri, 26 Sep 2014 23:05:50 +0200 Subject: mvptree 1.0 (new formula) --- Library/Formula/mvptree.rb | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Library/Formula/mvptree.rb (limited to 'Library') diff --git a/Library/Formula/mvptree.rb b/Library/Formula/mvptree.rb new file mode 100644 index 000000000..0fa8b8ccf --- /dev/null +++ b/Library/Formula/mvptree.rb @@ -0,0 +1,49 @@ +require "formula" + +class Mvptree < Formula + homepage "http://www.phash.org" + url "http://www.phash.org/releases/mvptree-1.0.tar.gz" + sha1 "586bdc458116bed61caf7310804a70d55af9ce6e" + + # Patch submitted to upstream by mail + # Fixes a "permission denied" problem in the Makefile + patch :DATA + + def install + lib.mkpath + include.mkpath + system "make", "install", "DESTDIR=#{prefix}" + end + + test do + (testpath/'test.c').write <<-EOS.undent + #include + #include + int main() { + MVPDP *pt = dp_alloc(MVP_BYTEARRAY); + dp_free(pt, (MVPFreeFunc)0); + return 0; + } + EOS + system ENV.cc, "-g", "-c", "test.c", "-o", "test.o" + system ENV.cc, "-g", "test.o", "#{lib}/libmvptree.a", "-o", "test" + system "./test" + end +end + +__END__ +diff --git a/Makefile b/Makefile +index bb155e2..29876b1 100644 +--- a/Makefile ++++ b/Makefile +@@ -43,8 +43,9 @@ clean : + + install : $(HFLS) $(LIBRARY) + install -c -m 444 $(HFLS) $(DESTDIR)/include +- install -c -m 444 $(LIBRARY) $(DESTDIR)/lib ++ install -c -m 644 $(LIBRARY) $(DESTDIR)/lib + $(RANLIB) $(DESTDIR)/lib/$(LIBRARY) ++ chmod 444 $(DESTDIR)/lib/$(LIBRARY) + + $(LIBRARY) : $(OBJS) + ar cr $(LIBRARY) $? -- cgit v1.2.3