class Gpsd < Formula desc "Global Positioning System (GPS) daemon" homepage "http://catb.org/gpsd/" url "https://download.savannah.gnu.org/releases/gpsd/gpsd-3.21.tar.xz" mirror "https://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-3.21.tar.xz" sha256 "5512a7d3c2e86be83c5555652e5b4cc9049e8878a4320be7f039eb1a7203e5f0" livecheck do url "https://download.savannah.gnu.org/releases/gpsd/" regex(/href=.*?gpsd[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do cellar :any sha256 "e41f44df2cf96b33b2f62e65ff2ef9154d872bc8fac88b3bdaeb503246d77c2b" => :catalina sha256 "caafc4aea3632fdbe8df1ce265c025430a816d2ad7c26f973c254887ec6a2a8f" => :mojave sha256 "bc0775e450c0129fd71a4abd163a7645ac9b3e1698009b2735fafeb838e09e79" => :high_sierra end depends_on "scons" => :build def install system "scons", "chrpath=False", "python=False", "strip=False", "prefix=#{prefix}/" system "scons", "install" end def caveats <<~EOS gpsd does not automatically detect GPS device addresses. Once started, you need to force it to connect to your GPS: GPSD_SOCKET="#{var}/gpsd.sock" #{sbin}/gpsdctl add /dev/tty.usbserial-XYZ EOS end plist_options manual: "#{HOMEBREW_PREFIX}/sbin/gpsd -N -F #{HOMEBREW_PREFIX}/var/gpsd.sock /dev/tty.usbserial-XYZ" def plist <<~EOS Label #{plist_name} ProgramArguments #{opt_sbin}/gpsd -N -F #{var}/gpsd.sock RunAtLoad KeepAlive WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/gpsd.log StandardErrorPath #{var}/log/gpsd.log EOS end test do assert_match version.to_s, shell_output("#{sbin}/gpsd -V") end end