class Mdds < Formula desc "Multi-dimensional data structure and indexing algorithm" homepage "https://gitlab.com/mdds/mdds" url "https://kohei.us/files/mdds/src/mdds-2.0.2.tar.bz2" sha256 "13211f2f2e387ef3b74d73a1dcee52a1ad5ce06df8f8e6647679df9278a3116a" license "MIT" bottle do sha256 cellar: :any_skip_relocation, all: "800ca1b6aab72e6e32965fd3e156c05e603c5686473c61611e2ae1c7c99b1d9b" end head do url "https://gitlab.com/mdds/mdds.git" depends_on "automake" => :build end depends_on "autoconf" => :build depends_on "boost" on_linux do depends_on "gcc" # for C++17 end fails_with gcc: "5" def install args = %W[ --prefix=#{prefix} --disable-openmp ] # Gets it to work when the CLT is installed inreplace "configure.ac", "$CPPFLAGS -I/usr/include -I/usr/local/include", "$CPPFLAGS -I/usr/local/include" if build.head? system "./autogen.sh", *args else system "autoconf" system "./configure", *args end system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include int main() { mdds::flat_segment_tree fst(0, 4, 8); } EOS system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11", "-I#{include.children.first}" system "./test" end end