From 4925ddefb91930dd8a0c17765d43e63098f44558 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sat, 4 Feb 2023 19:58:16 +1000 Subject: [PATCH] Fixup install_scripts_stuff on Linux --- vinca/templates/build_ament_python.sh.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vinca/templates/build_ament_python.sh.in b/vinca/templates/build_ament_python.sh.in index 8fc5127..24d2dfd 100644 --- a/vinca/templates/build_ament_python.sh.in +++ b/vinca/templates/build_ament_python.sh.in @@ -8,11 +8,12 @@ grep -q "install[-_]scripts" setup.cfg if [ $? -eq 0 ]; then INSTALL_SCRIPTS_ARG="" else - # this is not quite what we want as PKG_NAME contains ros-humble- .. - # INSTALL_SCRIPTS_ARG="--install-scripts=$PREFIX/lib/$PKG_NAME" - # therefore for now throw an error as packages should have a setup.cfg - echo "This package is missing a setup.cfg, stopping." - exit 1 + # Remove e.g. ros-humble- from PKG_NAME + PKG_NAME_SHORT=${PKG_NAME#*ros-@(ros_distro)-} + # Substitute "-" with "_" + PKG_NAME_SHORT=${PKG_NAME_SHORT//-/_} + INSTALL_SCRIPTS_ARG="--install-scripts=$PREFIX/lib/$PKG_NAME_SHORT" + echo "WARNING: setup.cfg not set, will set INSTALL_SCRIPTS_ARG to: $INSTALL_SCRIPTS_ARG" fi # Old: This installs the binaries in the wrong location - see https://github.com/RoboStack/ros-humble/issues/41