Skip to content

Commit

Permalink
Handle different names of libdc1394 package in different distributions (
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored and Nicogene committed Feb 14, 2022
1 parent 17e33bc commit f6dd8f3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Upgrade apt packages Debian Sid [Debian Sid]
if: matrix.docker_image == 'debian:sid'
run: |
# The Debian sid docker image is generated only
# once a month, so to actually test with the latest
# packages we need to manually upgrade the packages
apt-get -y upgrade
- name: Dependencies [Docker]
run: |
chmod +x ./.ci/install_debian.sh
Expand All @@ -186,14 +194,6 @@ jobs:
run: |
apt-get -y -t buster-backports install cmake
- name: Upgrade apt packages Debian Sid [Debian Sid]
if: matrix.docker_image == 'debian:sid'
run: |
# The Debian sid docker image is generated only
# once a month, so to actually test with the latest
# packages we need to manually upgrade the packages
apt-get -y upgrade
- name: Install CMake from Kitware APT Repository [Docker/Ubuntu Bionic]
if: matrix.docker_image == 'ubuntu:bionic'
run: |
Expand Down Expand Up @@ -227,11 +227,6 @@ jobs:
cd build
cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF .
- name: Install additional dependencies not available on Ubuntu Bionic [Docker except ubuntu:bionic]
if: (matrix.docker_image != 'ubuntu:bionic')
run: |
apt-get -y install nlohmann-json3-dev
- name: Build [Docker]
run: |
cd build
Expand Down Expand Up @@ -413,11 +408,6 @@ jobs:
cd build
cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF .
- name: Install dependencies unsupported in Ubuntu 18.04
if: contains(matrix.os, '20.04')
run: |
sudo apt-get -y install nlohmann-json3-dev
- name: Configure [Windows]
if: contains(matrix.os, 'windows')
shell: bash
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ cd robotology-superbuild
sudo bash ./scripts/install_apt_dependencies.sh
~~~

If you are **not** using Ubuntu 18.04, you also need to install:
~~~
sudo apt-get install nlohmann-json3-dev
~~~
Besides the packages listed in `apt.txt` file, the script `install_apt_dependencies.sh` also installs some other packages depending on the distribution used, please inspect the script for more information.

For what regards CMake, the robotology-superbuild requires CMake 3.16 . If you are using a recent Debian-based system such as Ubuntu 20.04, the default CMake is recent enough and you do not need to do further steps.

Expand Down
2 changes: 1 addition & 1 deletion apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ libace-dev
libboost-filesystem-dev
libboost-system-dev
libboost-thread-dev
libdc1394-22-dev
libedit-dev
libeigen3-dev
libgsl0-dev
Expand All @@ -21,6 +20,7 @@ libsdl1.2-dev
libtinyxml-dev
libv4l-dev
libxml2-dev
lsb-release
portaudio19-dev
qml-module-qt-labs-folderlistmodel
qml-module-qt-labs-settings
Expand Down
23 changes: 23 additions & 0 deletions scripts/install_apt_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,26 @@
SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; cd -P "$(dirname "$(readlink "$BASH_SOURCE" || echo .)")"; pwd)

xargs -a ${SCRIPT_DIR}/../apt.txt apt-get install -y

# Handle libdc1394 package (see https://github.com/robotology/robotology-superbuild/issues/854)
# On Ubuntu 18.04 or Debian Buster install libdc1394-22-dev, otherwise libdc1394-dev
# Remove once Ubuntu 18.04 and Debian Buster compatibility is dropped
ROBSUP_DISTRO_NAME=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
ROBSUP_DISTRO_VERSION=$(lsb_release -r | cut -d: -f2 | sed s/'^\t'//)
ROBSUP_DISTRO_CODENAME=$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//)

if [[ ("$ROBSUP_DISTRO_NAME" == "Ubuntu" && "$ROBSUP_DISTRO_VERSION" == "22.04") || ("$ROBSUP_DISTRO_NAME" == "Debian" && "$ROBSUP_DISTRO_CODENAME" == "bullseye") || ("$ROBSUP_DISTRO_NAME" == "Debian" && "$ROBSUP_DISTRO_CODENAME" == "bookworm") ]]
then
apt-get install -y libdc1394-dev
else
apt-get install -y libdc1394-22-dev
fi

# Handle nlohmann-json3-dev dependency
# Remove once Ubuntu 18.04 compatibility is dropped
if [[ ("$ROBSUP_DISTRO_NAME" == "Ubuntu" && "$ROBSUP_DISTRO_VERSION" == "18.04") ]]
then
:
else
apt-get install -y nlohmann-json3-dev
fi

0 comments on commit f6dd8f3

Please sign in to comment.