Autoproj: Adding Yarp as a dependency of the Yarp transport

Hi,

I am trying to set up the Yarp transport so that it could be imported
and built by autoproj.

For the transport sources themselves, it's quite clear to me, as I
played with autoproj for managing my own packages.

The problem I am facing is about the dependency to yarp.
I want autoproj to look for Yarp on my system (actually I already
installed it manually), for instance by looking at a header file, a
cmake file or a pc file, and either:
- link to it if it has found it
- install it otherwise, using either a tarball or a svn trunk

I need some help to configure my autoproj install to do that!

Thanks,

Charles.

Autoproj: Adding Yarp as a dependency of the Yarp transport

On 04/06/2011 04:39 PM, Charles Lesire-Cabaniols wrote:
> I am trying to set up the Yarp transport so that it could be imported
> and built by autoproj.
>
> For the transport sources themselves, it's quite clear to me, as I
> played with autoproj for managing my own packages.
>
> The problem I am facing is about the dependency to yarp.
> I want autoproj to look for Yarp on my system (actually I already
> installed it manually), for instance by looking at a header file, a
> cmake file or a pc file, and either:
> - link to it if it has found it
> - install it otherwise, using either a tarball or a svn trunk
>
> I need some help to configure my autoproj install to do that!

This is not really how you are supposed to do in autoproj right now. I
actually want to keep away from making autoproj do these things, as I
feel it is the realm of cmake.

Now, autoproj is ruby, so it is doable.

You have the following options:

1. osdeps with fallback
=======================
Autoproj, if there is *both* an osdeps definition *and* a package with
the same name will install the osdeps if available for the current OS
and fallback into building the package otherwise.

This is meant to be used if a package is available as prebuilt package
for some OSes but not on other, and then have it built on these other OSes

If you are running autoproj on an OS on which the osdeps is defined, the
only way to force it to build the package regardless is to add an osdeps
file in the autoproj/ directory which "undefines" the osdeps, e.g.

yarp:

2. only provide an autoproj package and use the ignore_packages field
======================================================================
in the manifest
===============

That's what you do if you want autoproj to completely ignore a package,
because you installed it yourself (outside of autoproj) and want it to
just stop caring. The syntax is:

ignore_packages:
- yarp

in autoproj/manifest

3. do autodetection in the .autobuild files
===========================================
That's finally what one would do to do what you just asked. Check for .h
file, .pc file (you can easily check for pkg-config packages using
utilrb's PkgConfig class, see
http://rock-robotics.org/api/utilrb/Utilrb/PkgConfig.html). The general
idea would be

cmake_package 'yarp' do
# do some setting up for YARP
# and don't forget to define the import in source.yml !!!
...
end

if Utilrb::PkgConfig.has_package?('yarp')
# The manifest API does not allow to modify the set of ignore
# packages yet, unfortunately. This is a ugly hack
Autoproj.manifest.data['ignore_packages'] ||= Array.new
Autoproj.manifest.data['ignore_packages'] << 'yarp'
end

Hope this helps

Sylvain

Autoproj: Adding Yarp as a dependency of the Yarp transport

On 06/04/2011 17:11, Sylvain Joyeux wrote:
> On 04/06/2011 04:39 PM, Charles Lesire-Cabaniols wrote:
>> I am trying to set up the Yarp transport so that it could be imported
>> and built by autoproj.
>>
>> For the transport sources themselves, it's quite clear to me, as I
>> played with autoproj for managing my own packages.
>>
>> The problem I am facing is about the dependency to yarp.
>> I want autoproj to look for Yarp on my system (actually I already
>> installed it manually), for instance by looking at a header file, a
>> cmake file or a pc file, and either:
>> - link to it if it has found it
>> - install it otherwise, using either a tarball or a svn trunk
>>
>> I need some help to configure my autoproj install to do that!
> This is not really how you are supposed to do in autoproj right now. I
> actually want to keep away from making autoproj do these things, as I
> feel it is the realm of cmake.
>
> Now, autoproj is ruby, so it is doable.
>
> You have the following options:
>
> 1. osdeps with fallback
> =======================
> Autoproj, if there is *both* an osdeps definition *and* a package with
> the same name will install the osdeps if available for the current OS
> and fallback into building the package otherwise.
>
> This is meant to be used if a package is available as prebuilt package
> for some OSes but not on other, and then have it built on these other OSes
>
> If you are running autoproj on an OS on which the osdeps is defined, the
> only way to force it to build the package regardless is to add an osdeps
> file in the autoproj/ directory which "undefines" the osdeps, e.g.
>
> yarp:
>
> 2. only provide an autoproj package and use the ignore_packages field
> ======================================================================
> in the manifest
> ===============
>
> That's what you do if you want autoproj to completely ignore a package,
> because you installed it yourself (outside of autoproj) and want it to
> just stop caring. The syntax is:
>
> ignore_packages:
> - yarp
>
> in autoproj/manifest
>
> 3. do autodetection in the .autobuild files
> ===========================================
> That's finally what one would do to do what you just asked. Check for .h
> file, .pc file (you can easily check for pkg-config packages using
> utilrb's PkgConfig class, see
> http://rock-robotics.org/api/utilrb/Utilrb/PkgConfig.html). The general
> idea would be
>
> cmake_package 'yarp' do
> # do some setting up for YARP
> # and don't forget to define the import in source.yml !!!
> ...
> end
>
> if Utilrb::PkgConfig.has_package?('yarp')
> # The manifest API does not allow to modify the set of ignore
> # packages yet, unfortunately. This is a ugly hack
> Autoproj.manifest.data['ignore_packages'] ||= Array.new
> Autoproj.manifest.data['ignore_packages']<< 'yarp'
> end
>
> Hope this helps
>
> Sylvain

Ok, thanks. There is no os package for Yarp, so I will try the second
option.

Charles