Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignition-fuel-tools6: new formula #1272

Merged
merged 5 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Aliases/ignition-fuel-tools6

This file was deleted.

67 changes: 67 additions & 0 deletions Formula/ignition-fuel-tools6.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
class IgnitionFuelTools6 < Formula
desc "Tools for using Fuel API to download robot models"
homepage "https://ignitionrobotics.org"
url "https://github.com/ignitionrobotics/ign-fuel-tools/archive/eea5e1d3c8ac1e18eb90e6a82fb7bdb4f566c495.tar.gz"
version "5.999.999~0~20210111~eea5e1"
sha256 "b868e39916dc21fc86e80c18d5004c0e7b26d7ac0a4af99eb8c77e72ea8bf5f1"
license "Apache-2.0"

head "https://github.com/ignitionrobotics/ign-fuel-tools", branch: "main"

depends_on "cmake"
depends_on "ignition-cmake2"
depends_on "ignition-common3"
depends_on "ignition-msgs7"
depends_on "jsoncpp"
depends_on "libyaml"
depends_on "libzip"
depends_on macos: :high_sierra # c++17
depends_on "pkg-config"

def install
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=Off"

mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end
end

test do
(testpath/"test.cpp").write <<-EOS
#include <ignition/fuel_tools.hh>
int main() {
ignition::fuel_tools::ServerConfig srv;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(ignition-fuel_tools5 QUIET REQUIRED)
include_directories(${IGNITION-FUEL_TOOLS_INCLUDE_DIRS})
link_directories(${IGNITION-FUEL_TOOLS_LIBRARY_DIRS})
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-fuel_tools5::ignition-fuel_tools5)
EOS
# test building with pkg-config
system "pkg-config", "ignition-fuel_tools5"
cflags = `pkg-config --cflags ignition-fuel_tools5`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lignition-fuel_tools5",
chapulina marked this conversation as resolved.
Show resolved Hide resolved
"-lc++",
"-o", "test"
system "./test"
# test building with cmake
mkdir "build" do
system "cmake", ".."
system "make"
system "./test_cmake"
end
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end