/
mdds.rb
55 lines (45 loc) 路 1.38 KB
/
mdds.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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.1.1.tar.bz2"
sha256 "8a3767f0a60c53261b5ebbaa717381446813aef8cf28fe9d0ea1371123bbe3f1"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, all: "aaa2d7bc7911b603839da712738b0fdce8d5c078dbbd9fa3c375fdc2e10c3398"
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++17",
"-I#{include.children.first}"
system "./test"
end
end