homebrew-core/Formula/odpi.rb

41 lines
1.1 KiB
Ruby
Raw Normal View History

class Odpi < Formula
desc "Oracle Database Programming Interface for Drivers and Applications"
homepage "https://oracle.github.io/odpi/"
url "https://github.com/oracle/odpi/archive/v2.2.0.tar.gz"
sha256 "2d0ce57c4eb705c54a4739828f24c4c3c92f3a40c6857adf712787191f910466"
2018-02-11 16:46:48 +00:00
bottle do
cellar :any
sha256 "fba4a194950340a9728f4cf9174a2346cb94bec163be02428f6bb2f5cd08f06d" => :high_sierra
sha256 "d66cce8c4ffa76aa730f6b9dd414ca2d305e1b0db2f47b6936692e4cc239b5e3" => :sierra
sha256 "55fbdde7662bea5fac2f820525b62ec1ae78c7b78b3a11e5f233354efbe510d2" => :el_capitan
end
def install
system "make"
lib.install Dir["lib/*"]
include.install Dir["include/*"]
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include <dpi.h>
int main()
{
dpiContext* context = NULL;
dpiErrorInfo errorInfo;
dpiContext_create(DPI_MAJOR_VERSION, DPI_MINOR_VERSION, &context, &errorInfo);
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lodpic", "-o", "test"
system "./test"
end
end