nix-ros-overlay/catkin-setup-hook/setup-hook.sh

35 lines
719 B
Bash
Raw Normal View History

2019-03-21 00:23:14 -04:00
isCatkinPackage() {
local pkg="$1"
[ -d "$pkg/share" ] && \
[ -n "$(find "$pkg/share" \
-maxdepth 2 -mindepth 2 \
-name package.xml -print -quit)" ]
}
_addRosPackagePath() {
if isCatkinPackage "$1"; then
addToSearchPath ROS_PACKAGE_PATH "$1"
fi
}
addEnvHooks "$hostOffset" _addRosPackagePath
_catkinPostPatchHook() {
patchShebangs cfg
}
postPatchHooks+=(_catkinPostPatchHook)
2019-03-21 00:23:14 -04:00
_catkinPreConfigureHook() {
cmakeFlags+=" -DCATKIN_ENABLE_TESTING=${doCheck:-OFF}"
2019-03-21 00:23:14 -04:00
}
preConfigureHooks+=(_catkinPreConfigureHook)
_catkinPostInstallHook() {
pushd $out
rm -f *setup.*sh
rm -f _setup_util.py env.sh .rosinstall
popd
}
postInstallHooks+=(_catkinPostInstallHook)
2019-03-21 00:23:14 -04:00
export ROS_DISTRO="@distro@"