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.1.tar.bz2"
|
|
sha256 "3ab33fce58e6acf9540cc1a52264be6863ef80f55ac287194cc98cda48e71fe6"
|
|
license "MIT"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "8a63652b99ca762bad33fe447ce2c1da5b031ca7be197019b1af9bc0709d1621"
|
|
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
|