libdbi 0.9.0 (new formula)

This is a new formula for libdbi, which is a database independent
abstraction layer for C.

Closes Homebrew/homebrew#39737.

Signed-off-by: Xu Cheng <xucheng@me.com>
master
Rob Gowin 2015-05-13 17:14:48 -05:00 committed by Xu Cheng
parent c6abd262d7
commit 697138c96b
1 changed files with 26 additions and 0 deletions

26
Formula/libdbi.rb Normal file
View File

@ -0,0 +1,26 @@
class Libdbi < Formula
homepage "http://libdbi.sourceforge.net"
url "https://downloads.sourceforge.net/project/libdbi/libdbi/libdbi-0.9.0/libdbi-0.9.0.tar.gz"
sha256 "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503"
def install
system "./configure", "--disable-debug", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <stdio.h>
#include <dbi/dbi.h>
int main(void) {
dbi_inst instance;
dbi_initialize_r(NULL, &instance);
printf("dbi version = %s\\n", dbi_version());
dbi_shutdown_r(instance);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-ldbi", "-o", "test"
system "./test"
end
end