Skip to content

Commit

Permalink
Set CMAKE_INSTALL_LIBDIR=lib in debian/control for ROS1 packages
Browse files Browse the repository at this point in the history
Newer debhelper versions will set CMAKE_INSTALL_LIBDIR=lib/<arch>.
This will cause packages that use GNUInstallDirs to install to this
location instead of lib and can confuse ROS tools.

closes ros-infrastructure#642
  • Loading branch information
poggenhans committed Sep 18, 2022
1 parent 35af61f commit 4ee1f4b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@

from bloom.packages import get_package_data

from bloom.rosdistro_api import get_distribution_type

from bloom.util import code
from bloom.util import to_unicode
from bloom.util import execute_command
Expand Down Expand Up @@ -344,6 +346,9 @@ def generate_substitutions_from_package(
data['Package'] = sanitize_package_name(package.name)
# Installation prefix
data['InstallationPrefix'] = installation_prefix
# ROS version
ros_distro_type = get_distribution_type(ros_distro)
data['RosVersion'] = int(ros_distro_type[3:])
# Resolve dependencies
evaluate_package_conditions(package, ros_distro)
depends = [
Expand Down
3 changes: 3 additions & 0 deletions bloom/generators/debian/templates/catkin/rules.em
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ override_dh_auto_configure:
# In case we're installing to a non-standard location, look for a setup.sh
# in the install tree that was dropped by catkin, and source it. It will
# set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
# Note that CMAKE_INSTALL_LIBDIR is set to lib/<multiarch> by default, but
# only affects packages that use GNUInstallDirs.
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_configure -- \
-DCATKIN_BUILD_BINARY_PACKAGE="1" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
$(BUILD_TESTING_ARG)
Expand Down
2 changes: 2 additions & 0 deletions bloom/generators/debian/templates/cmake/rules.em
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ override_dh_auto_configure:
# In case we're installing to a non-standard location, look for a setup.sh
# in the install tree and source it. It will set things like
# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
@[if RosDistro == 1] # CMAKE_INSTALL_LIBDIR is set for packages that use GNUInstallDirs.@[end if]
if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
dh_auto_configure -- \
-DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \
@[if RosDistro == 1] -DCMAKE_INSTALL_LIBDIR="lib" \@[end if]
-DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \
$(BUILD_TESTING_ARG)

Expand Down

0 comments on commit 4ee1f4b

Please sign in to comment.