Skip to content

Commit

Permalink
Updated YARP formula
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-romano committed Sep 1, 2016
1 parent 203762c commit 4ddef5f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
1 change: 0 additions & 1 deletion gazebo-yarp-plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def install
end

test do

(testpath/"test.sh").write <<-EOS.undent
#!/bin/bash
yarp namespace /brew_test
Expand Down
39 changes: 19 additions & 20 deletions yarp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,28 @@ class Yarp < Formula

head do
url "https://github.com/robotology/yarp.git", :branch => "master"

option "with-python", "Build with Python bindings"

depends_on "python" => :optional
depends_on "swig" if build.with? "python"
end

option "without-qt5", "Build without GUI applications"
option "with-yarprun-log", "Build with yarprun_log support"
option "with-opencv", "Build the opencv_grabber device"
option "with-lua", "Build with Lua bindings"
option "with-python", "Build with Python bindings"
option "with-yarprun-log", "Build with LOG support for YARPRUN processes"
option "with-bindings", "Build with binding (LUA, Python) support"
option "with-serial", "Build the serial/serialport devices"

depends_on "pkg-config" => :build
depends_on "cmake" => :build
depends_on "ace"
depends_on "gsl"
depends_on "sqlite"
depends_on "readline"
depends_on "jpeg"
depends_on "homebrew/science/opencv" => :optional
depends_on "qt5" => :recommended
depends_on "lua" => :optional
depends_on "swig" if build.with? "lua"
if build.with? "bindings"
depends_on "lua"
depends_on "swig"
depends_on :python


end

def install
args = std_cmake_args + %W[
Expand All @@ -49,39 +46,41 @@ def install
-DENABLE_yarpcar_xmlrpc_carrier=TRUE
-DENABLE_yarpcar_bayer_carrier=TRUE
-DENABLE_yarpcar_priority_carrier=TRUE
-DCREATE_IDLS=TRUE
]

args << "-DCREATE_GUIS=TRUE" if build.with? "qt5"
args << "-DENABLE_YARPRUN_LOG=ON" if build.with? "yarprun-log"
args << "-DENABLE_yarpmod_opencv_grabber=ON" if build.with? "opencv"

if build.with? "lua"
if build.with? "bindings"
args << "-DYARP_COMPILE_BINDINGS=ON"
args << "-DCREATE_LUA=ON"
args << "-DCREATE_PYTHON=ON"
args << "-DCMAKE_INSTALL_LUADIR=#{lib}/lua"
end

if build.with? "serial"
args << "-DENABLE_yarpmod_serial=ON"
args << "-DENABLE_yarpmod_serialport=ON"
end

if build.head? && build.with?("python")
args << "-DYARP_COMPILE_BINDINGS=ON"
args << "-DCREATE_PYTHON=ON"
end

system "cmake", *args
system "make", "install"
bash_completion.install "scripts/yarp_completion"

end

def caveats
<<-EOS.undent
s = <<-EOS.undent
You need to add in your ~/.bash_profile or similar:
export YARP_DATA_DIRS=#{HOMEBREW_PREFIX}/share/yarp
EOS

if build.with? "bindings"
s += " export LUA_CPATH=\";;;#{lib}/lua/?.so\""
end
s
end

test do
Expand Down

0 comments on commit 4ddef5f

Please sign in to comment.