53 lines
1.6 KiB
Ruby
53 lines
1.6 KiB
Ruby
class Mavsdk < Formula
|
|
desc "API and library for MAVLink compatible systems written in C++11"
|
|
homepage "https://mavsdk.mavlink.io"
|
|
url "https://github.com/mavlink/MAVSDK.git",
|
|
tag: "v0.35.0",
|
|
revision: "0a556e5bf418937dceef9c45a2ba75f2d36f62fe"
|
|
license "BSD-3-Clause"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, big_sur: "16e3e80a65b84f409ee3631881277e8a5a471a114b3d678a57cb54dcf1d94e0e"
|
|
sha256 cellar: :any, catalina: "d5da90b3f15d68022aa5e2b10f834017691cee5670da5bdd70d9a8d8bbb26423"
|
|
sha256 cellar: :any, mojave: "6ba8c322043d8c6110b85f7b98bc5f9dcbc48e7e1796ff0640f37c667d700036"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
def install
|
|
system "cmake", *std_cmake_args,
|
|
"-Bbuild/default",
|
|
"-DBUILD_BACKEND=ON",
|
|
"-H."
|
|
system "cmake", "--build", "build/default", "--target", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <mavsdk/mavsdk.h>
|
|
#include <mavsdk/plugins/info/info.h>
|
|
int main() {
|
|
mavsdk::Mavsdk mavsdk;
|
|
mavsdk.version();
|
|
mavsdk::System& system = mavsdk.system();
|
|
auto info = std::make_shared<mavsdk::Info>(system);
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cxx, "-std=c++11", testpath/"test.cpp", "-o", "test",
|
|
"-I#{include}/mavsdk",
|
|
"-L#{lib}",
|
|
"-lmavsdk",
|
|
"-lmavsdk_info"
|
|
system "./test"
|
|
|
|
assert_equal "Usage: backend_bin [-h | --help]",
|
|
shell_output("#{bin}/mavsdk_server --help").split("\n").first
|
|
end
|
|
end
|