homebrew-core/Formula/apache-arrow-glib.rb

63 lines
1.7 KiB
Ruby

class ApacheArrowGlib < Formula
desc "GLib bindings for Apache Arrow"
homepage "https://arrow.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=arrow/arrow-1.0.1/apache-arrow-1.0.1.tar.gz"
mirror "https://archive.apache.org/dist/arrow/arrow-1.0.1/apache-arrow-1.0.1.tar.gz"
sha256 "149ca6aa969ac5742f3b30d1f69a6931a533fd1db8b96712e60bf386a26dc75c"
license "Apache-2.0"
head "https://github.com/apache/arrow.git"
livecheck do
url :stable
end
bottle do
sha256 "f3f1d7961bdb3f3ad95232a37460d1a92a88e4846c794ab2d8501bacff6d0b76" => :catalina
sha256 "09ea05316802811d6b5d02ead1705ed795c7209a09362f7d1bc545ad0eb92924" => :mojave
sha256 "d281fe60e0aa6ef2485a8172ab45e64d62549429836ea9fb0a8a4a5dee07a2cf" => :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