class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.19.0.tar.gz" sha256 "d3671630712c6b3e6a47e12ce0376a75c8915a0072bfec17ed10f3767549be93" head "https://github.com/Project-OSRM/osrm-backend.git" bottle do cellar :any sha256 "8b771a3f519c6f19f13e4e60f8e7493cfbe0e7293895f03d8324f7cc6c453856" => :mojave sha256 "0a055f3732a598f0f42fb7e9b0091c8662eba79459b90684c4b5935299f680a7" => :high_sierra sha256 "d2196fefcad4ac94ed008796272d49ee7fe674f6a95c204a41cebb1f382f6be1" => :sierra end depends_on "cmake" => :build depends_on "boost" depends_on "libstxxl" depends_on "libxml2" depends_on "libzip" depends_on "lua" # "invalid use of non-static data member 'offset'" # https://github.com/Project-OSRM/osrm-backend/issues/3719 depends_on :macos => :el_capitan 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 node1 = 'visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"' node2 = 'visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"' node3 = 'visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"' (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