57 lines
1.6 KiB
Ruby
57 lines
1.6 KiB
Ruby
class ApacheArrowGlib < Formula
|
|
desc "GLib bindings for Apache Arrow"
|
|
homepage "https://arrow.apache.org/"
|
|
url "https://www.apache.org/dyn/closer.cgi?path=arrow/arrow-0.15.1/apache-arrow-0.15.1.tar.gz"
|
|
sha256 "9a2c58c72310eafebb4997244cbeeb8c26696320d0ae3eb3e8512f75ef856fc9"
|
|
revision 1
|
|
head "https://github.com/apache/arrow.git"
|
|
|
|
bottle do
|
|
sha256 "40f8f387d085231e4196326e5077a0a2a57d26fba3cf1aad354e8b8ba12543da" => :catalina
|
|
sha256 "fd32a9689862003253b5508c00455cedf8ddb353a43307d258d124b12342312e" => :mojave
|
|
sha256 "6166b657fec8b598460df8b12428d60ac2c5c67cb08521cfd33e4d73578b5920" => :high_sierra
|
|
end
|
|
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "apache-arrow"
|
|
depends_on "glib"
|
|
|
|
def install
|
|
cd "c_glib" do
|
|
system "./configure", "--prefix=#{prefix}"
|
|
system "make"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~SOURCE
|
|
#include <arrow-glib/arrow-glib.h>
|
|
int main(void) {
|
|
GArrowNullArray *array = garrow_null_array_new(10);
|
|
g_object_unref(array);
|
|
return 0;
|
|
}
|
|
SOURCE
|
|
apache_arrow = Formula["apache-arrow"]
|
|
glib = Formula["glib"]
|
|
flags = %W[
|
|
-I#{include}
|
|
-I#{apache_arrow.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-L#{lib}
|
|
-L#{apache_arrow.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-DNDEBUG
|
|
-larrow-glib
|
|
-larrow
|
|
-lglib-2.0
|
|
-lgobject-2.0
|
|
-lgio-2.0
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|