homebrew-core/Formula/mdds.rb

57 lines
1.4 KiB
Ruby

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.3.tar.bz2"
sha256 "9771fe42e133443c13ca187253763e17c8bc96a1a02aec9e1e8893367ffa9ce5"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "69b451e38108463d874aa74896add69ed039c0aace5cd92ddf1af00aface4383"
end
head do
url "https://gitlab.com/mdds/mdds.git", branch: "master"
depends_on "automake" => :build
end
depends_on "autoconf" => :build
depends_on "boost"
fails_with gcc: "5" # for C++17
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 <mdds/flat_segment_tree.hpp>
int main() {
mdds::flat_segment_tree<unsigned, unsigned> fst(0, 4, 8);
}
EOS
system ENV.cxx, "test.cpp", "-o", "test",
"-std=c++11",
"-I#{include.children.first}"
system "./test"
end
end