class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.4.3.tar.gz" sha256 "501b9302d4ae622f04305debacd2f59941409c6345056ebb272779ac375f874d" head "https://github.com/Project-OSRM/osrm-backend.git" bottle do cellar :any rebuild 1 sha256 "ba73d99520b070d69c8b973fbd395adc67c871a0866dd4b236b662b4b8f5f7cf" => :sierra sha256 "0e3f746ad5aebf89dd08635ad6430b0b9726dea62be2543e539d9e75cebc2d25" => :el_capitan sha256 "e5d20ef724178e01a29bd7cc68edc50654a99a8ed95c37ce7fad729ab098295b" => :yosemite end depends_on "cmake" => :build depends_on "boost" depends_on "libstxxl" depends_on "libxml2" depends_on "libzip" depends_on "lua51" 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