Snap ROS - Add rosdep sources.list


I want to use the following ROS package:
It requires some rosdep sources.

Either I need to use the prebuilt package ros-kinetic-raspicam-node (I don’t know if I can do that).
Or build from source (as a catkin package) but it requires the following packages: libraspberrypi0, libraspberrypi-dev

What I tried:

    plugin: nil
    prepare: |
      sudo apt-get update
      sudo apt-get install software-properties-common
      sudo add-apt-repository --yes ppa:ubuntu-raspi2/ppa
      sudo apt-get update
      sudo apt-get install --yes libraspberrypi0 libraspberrypi-dev
    plugin: catkin
    rosdistro: kinetic
    rosinstall-files: [raspicam.rosinstall]
    catkin-packages: [raspicam_node, my_other_package_using_raspicam]
    after: [setup-packages]
    build-packages: [libraspberrypi0, libraspberrypi-dev]
    stage-packages: [libraspberrypi0, libraspberrypi-dev]

I see in the logs that the packages are installed correctly:

Pulling setup-packages 
'raspicam' has dependencies that need to be staged: setup-packages
Skipping pull setup-packages (already ran)
Building setup-packages 
libraspberrypi0 is already the newest version (1.20161003.2350bf2-1).
libraspberrypi-dev is already the newest version (1.20161003.2350bf2-1).
Staging setup-packages

But then I get this and I don’t understand why.
It looks like the staging of raspicam part doesn’t know the PPA repo that was added by the setup-packages part.

Hit xenial InRelease                                                                                  
Hit xenial-updates InRelease                                                                          
Hit xenial-security InRelease                                                                         
Ign xenial InRelease                                                                                    
Hit xenial Release                                                                                      
Ign xenial Release.gpg                                                                                  
Fetched 0 B in 0s (0 B/s)                                                                                                                  
Failed to fetch stage packages: Error downloading packages for part 'raspicam': The package 'libraspberrypi0' was not found..

Any help would be really appreciated. Thanks !

After 2 days of investigation, I finally found the problem… which was pretty obvious (often the case when the problem is found :slight_smile:)

I knew the existence of the PLUGIN_STAGE_SOURCES property, because I also tried that option to add the PPA repo.

What I hadn’t noticed, is that the PLUGIN_STAGE_SOURCES is actually already used by the catkin plugin. That’s why the packages were found during build but not during staging.

For the moment, I will fork the plugin and manually add the source list I’m missing, until I find a cleaner solution.

It seems like you figured a work around out on your own, so just a note.

sudo apt-get install software-properties-common This looks like it could be moved to a build-package. Having it there instead of prepare might be cleaner.

+1 to being able to add sources.list to the catkin plugin.

Related to this fix being able to override PLUGIN_STAGE_SOURCES, this would be useful. I’m using a private apt repo to control packages integrated into the project. Doing this without code modification would be nice.