class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.17.2.tar.gz" sha256 "7c32926f71e1a34c76ed85609ca6f2e9d4cb1faf81a04b3273ef01f0147417ee" head "https://github.com/Project-OSRM/osrm-backend.git" bottle do cellar :any sha256 "bfd5771df129cdd1f8816a618cca5bbf26bcfbb889cade213365f56202a4421f" => :high_sierra sha256 "77e23d6bdf9085c82ccdd64a646662d689ba6379f816923f94300e01b1dd583d" => :sierra sha256 "5266b41a1ae6f469f817cdc9abdbf3d8441631ac1e58d63251a76499411a3333" => :el_capitan end # "invalid use of non-static data member 'offset'" # https://github.com/Project-OSRM/osrm-backend/issues/3719 depends_on :macos => :el_capitan depends_on "cmake" => :build depends_on "boost" depends_on "libstxxl" depends_on "libxml2" depends_on "libzip" depends_on "lua" depends_on "tbb" def install mkdir "build" do system "cmake", "..", "-DENABLE_CCACHE:BOOL=OFF", *std_cmake_args system "make" system "make", "install" end pkgshare.install "profiles" end test do (testpath/"test.osm").write <<~EOS EOS (testpath/"tiny-profile.lua").write <<~EOS function way_function (way, result) result.forward_mode = mode.driving result.forward_speed = 1 end EOS safe_system "#{bin}/osrm-extract", "test.osm", "--profile", "tiny-profile.lua" safe_system "#{bin}/osrm-contract", "test.osrm" assert_predicate testpath/"test.osrm", :exist?, "osrm-extract generated no output!" end end