Hello everyone,
My question is related to do a release of packages that depends on a 3rd party library. Until now, I have solved my problem for the doc buildfarm by adding a command in the CMakeList.txt
which launch a script to install the 3rd parties in the system (headers and libs). I know this could be considered as a trick but it worked fine for me.
Here the command I used in the CMakeList.txt
:
# install third parties
execute_process(COMMAND sudo bash install.bash
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/third_parties/
)
After that, I tried to do the release version of my packages. So, I read the tutorial of "Wrapping an external library in ROS" which says that this way is deprecated. And, I read then the tutorial "Releasing a Third Party Package (with bloom)" but I do not understand very well the steps for releasing the 3rd party code.
My package structure are the next:
- maggie_drivers (repo)
- maggie_drivers (metapkg)
- maggie_ir_drivers (pkg with 3rd party deps)
- maggie_labjack_drivers (pkg with 3rd party deps)
- maggie_rfid_drivers (pkg with 3rd party deps)
- maggie_*_drivers (other pkgs)
Here the link to GitHub.
For the maggie_ir_drivers
package, I have directly the code of the 3rd party, that is, I have 2 folders, with the headers and the libs I need to compile my package.
Until now, to install this 3rd party I had to run this bash script:
#!/bin/bash
# get machine architecture
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == "x86_64" ]; then
LIBPATH=./x64
else
LIBPATH=./x86
fi
LOCALINCLUDE=/usr/local/include/irtrans
LOCALLIB=/usr/local/lib/
### copy headers
echo "Copying headers..."
mkdir $LOCALINCLUDE --parents
cp $LIBPATH/*.h $LOCALINCLUDE
### copy libs
echo "Copying libs..."
cp $LIBPATH/*.so $LOCALLIB
# config links
ldconfig
For the maggie_rfid_drivers
package the 3rd party is similar, a folder with the headers and the libs to be installed in the system by a bash script. Here the script.
Finally, for the maggie_labjack_drivers
package, I have something different. The 3rd party code are divided in two, one installed by a github repository and other by a ZIP file. For the first one, I need to patch the bash script that install the code because of a bug. The second one is simpler, is a makefile project and only is necessary to unzip and to do a make install
.
Thanks in advance.
Edit:
Still with no solution. It seems the execute_process
is not being executed when the Jenking job install the releases. So, there is an error searching the headers form the 3rd parties.
Originally posted by raul.perula on ROS Answers with karma: 71 on 2015-05-11
Post score: 0
Original comments
Comment by William on 2015-05-11:
If you want to build these things on the ROS build farm, then you should definitely use the "Releasing a Third Party Package (with bloom)", but I don't know what exactly you're having an issue with, so I can't help more.
Comment by raul.perula on 2015-05-12:
Ok @william. Sorry for not to give many details. Now I edit my own question.
Could you tell me if the steps on that tutorial are valid for me?
Thanks.
Comment by ahendrix on 2015-05-12:
Yes, "Releasing a Third Party Package (with bloom)" is the tutorial you should be following.
Comment by raul.perula on 2015-05-14:
Ok, @ahendrix. The problem is this tutorial is not so clear for me. I do not understand how I could release my 3rd party properly.
For instance, I do not know if I should create a separate package with my script.
I am totally lost with this tutorial.
Comment by raul.perula on 2015-05-19:
Nobody can help me with this? Or at least give me a reference to a project which use something similar?
Comment by William on 2015-06-10:
@raul.perula Step 2.4 is technically not required for it to work, but it's a pretty straight forward thing to ask "install the package.xml". If you're using CMake then you just add an install rule; otherwise all build systems should allow you to install arbitrary files. Why are you blocked?
Comment by raul.perula on 2015-06-11:
As @ahendrix said, I need several patchs. So, if you see mi "Edit 1", you can see that I need to call a bash script, not a CMake compilation and installation. I have been following the steps carefully and seeing the "eml" example, but I miss more info in the Tutorial.