56 lines
2.2 KiB
Ruby
56 lines
2.2 KiB
Ruby
class Flann < Formula
|
|
desc "Fast Library for Approximate Nearest Neighbors"
|
|
homepage "https://github.com/mariusmuja/flann"
|
|
url "https://github.com/mariusmuja/flann/archive/1.9.1.tar.gz"
|
|
sha256 "b23b5f4e71139faa3bcb39e6bbcc76967fbaf308c4ee9d4f5bfbeceaa76cc5d3"
|
|
license "BSD-3-Clause"
|
|
revision 10
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "1d8425ca4d79dcf978e9bb43e7b1a52480febf9b9deadc8b966ffa2d004b2971"
|
|
sha256 cellar: :any, big_sur: "f6555dce8d62d9dde8da5ee6ea7a6efc1e9a80339060bb4b7af3fd1e7e845584"
|
|
sha256 cellar: :any, catalina: "101ec3e673a5b69c5f6cf6c79af0fbfca3a00ef90b7a4dde0a4bad638a187d1a"
|
|
sha256 cellar: :any, mojave: "ab351183f61258ac6fefd9f64677c4b917929674fb36eff89aa9d85c825dfef8"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "hdf5"
|
|
|
|
on_linux do
|
|
# Fix for Linux build: https://bugs.gentoo.org/652594
|
|
# Not yet fixed upstream: https://github.com/mariusmuja/flann/issues/369
|
|
patch do
|
|
url "https://raw.githubusercontent.com/buildroot/buildroot/0c469478f64d0ddaf72c0622a1830d855306d51c/package/flann/0001-src-cpp-fix-cmake-3.11-build.patch"
|
|
sha256 "aa181d0731d4e9a266f7fcaf5423e7a6b783f400cc040a3ef0fef77930ecf680"
|
|
end
|
|
end
|
|
|
|
resource("dataset.dat") do
|
|
url "https://www.cs.ubc.ca/research/flann/uploads/FLANN/datasets/dataset.dat"
|
|
sha256 "dcbf0268a7ff9acd7c3972623e9da722a8788f5e474ae478b888c255ff73d981"
|
|
end
|
|
|
|
resource("testset.dat") do
|
|
url "https://www.cs.ubc.ca/research/flann/uploads/FLANN/datasets/testset.dat"
|
|
sha256 "d9ff91195bf2ad8ced78842fa138b3cd4e226d714edbb4cb776369af04dda81b"
|
|
end
|
|
|
|
resource("dataset.hdf5") do
|
|
url "https://www.cs.ubc.ca/research/flann/uploads/FLANN/datasets/dataset.hdf5"
|
|
sha256 "64ae599f3182a44806f611fdb3c77f837705fcaef96321fb613190a6eabb4860"
|
|
end
|
|
|
|
def install
|
|
system "cmake", ".", *std_cmake_args, "-DBUILD_PYTHON_BINDINGS:BOOL=OFF", "-DBUILD_MATLAB_BINDINGS:BOOL=OFF"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
resource("dataset.dat").stage testpath
|
|
resource("testset.dat").stage testpath
|
|
resource("dataset.hdf5").stage testpath
|
|
system "#{bin}/flann_example_c"
|
|
system "#{bin}/flann_example_cpp"
|
|
end
|
|
end
|