class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.6.0.tar.gz" sha256 "42875ecdc0cab65fe3bb861f40b17f2dbd71764c030a07a0f0863b8f405eeb0d" head "https://github.com/Project-OSRM/osrm-backend.git" bottle do cellar :any sha256 "1c68222d39d25a43338bbcf2f17ff577c3a8ad2be1e6024ac5b4a6e4b2a13a15" => :sierra sha256 "91c17b4af7b6b78354c7fc97a9285e0407ee6b77027970e606fffaec8bc11e44" => :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@5.1" depends_on "luabind" depends_on "tbb" def install mkdir "build" do system "cmake", "..", *std_cmake_args system "make" system "make", "install" end pkgshare.install "profiles" end test do (testpath/"test.osm").write <<-EOS.undent EOS (testpath/"tiny-profile.lua").write <<-EOS.undent 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 File.exist?("#{testpath}/test.osrm"), "osrm-extract generated no output!" end end