class OsmiumTool < Formula desc "Libosmium-based command-line tool for processing OpenStreetMap data" homepage "http://osmcode.org/osmium-tool/" url "https://github.com/osmcode/osmium-tool/archive/v1.8.0.tar.gz" sha256 "3e996ddcdedcfc3ac70dec3687d59a100dbfb04d00ed3f03df6b3e8d0bd92755" bottle do cellar :any sha256 "38cad32aa92035906161ea8eb3fad6857aff23e930869ba767bb7071f2d95c26" => :high_sierra sha256 "5b11e95a4d33405ec3f57aadd2e90a4694ba010a492ab15174c8c7d20aa9be88" => :sierra sha256 "ad19ecff2341a5554588fdc82841180bc6648f7ffd18264cffaf5c92f9fd27cc" => :el_capitan end depends_on "cmake" => :build depends_on "libosmium" => :build depends_on "boost" def install protozero = Formula["libosmium"].opt_libexec/"include" system "cmake", ".", "-DPROTOZERO_INCLUDE_DIR=#{protozero}", *std_cmake_args system "make", "install" end test do (testpath/"test.osm").write <<~EOS EOS output = shell_output("#{bin}/osmium fileinfo test.osm") assert_match /Compression.+generator=handwritten/m, output system bin/"osmium", "tags-filter", "test.osm", "w/name=line", "-f", "osm" end end