class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.13.0.tar.gz" sha256 "a5b9fe1a7d96292a573a023f8ef7d2ce862855f2f0d6d2c189c542a0ffa8b49a" head "https://github.com/Project-OSRM/osrm-backend.git" bottle do cellar :any sha256 "31e05d8141255e14b5db67bd2eb14ee82d37cb4f808d1846d0b1a967c1683f79" => :high_sierra sha256 "57427a2d2e13e14e4fb732758ac9558f1c897bd8587eb8e9ed14629d9a45ce3d" => :sierra sha256 "71e809b6ac16b881839adee5c38a0b6f605c7de8aaf35cd2bdfdf7a8dafa88a1" => :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