60 lines
1.4 KiB
Ruby
60 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
|
|
sha256 cellar: :any_skip_relocation, all: "bebc791aaa0345a6005430a3935a2cd23fb97ef7f196d63046cc3c27d1dac748"
|
|
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 <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
|