mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-12 18:54:50 +03:00
buildEnv: Link libraries and executables from the opt directory
This commit is contained in:
parent
1e05a2eb88
commit
885f79c638
1 changed files with 9 additions and 0 deletions
|
@ -52,6 +52,15 @@ let
|
||||||
|
|
||||||
postBuild = postBuild + ''
|
postBuild = postBuild + ''
|
||||||
"${buildPackages.perl}/bin/perl" "${./setup-hook-builder.pl}"
|
"${buildPackages.perl}/bin/perl" "${./setup-hook-builder.pl}"
|
||||||
|
|
||||||
|
# Some ROS programs keep libraries and binaries in /opt.
|
||||||
|
if [ -d "$out/opt" ]; then
|
||||||
|
declare -A optMv=([lib]=lib [lib64]=lib [bin]=bin)
|
||||||
|
for dir in ''${!optMv[@]}; do
|
||||||
|
mkdir -p "$out/''${optMv["$dir"]}"
|
||||||
|
find -L "$out/opt" -mindepth 3 -maxdepth 3 -type f -executable -path "*/$dir/*" -not -name '.*' -exec ln -sf '{}' "$out/''${optMv["$dir"]}" \;
|
||||||
|
done
|
||||||
|
fi
|
||||||
'' + optionalString wrapPrograms ''
|
'' + optionalString wrapPrograms ''
|
||||||
if [ -d "$out/bin" ]; then
|
if [ -d "$out/bin" ]; then
|
||||||
find -L "$out/bin" -executable -type f -xtype l -print0 | \
|
find -L "$out/bin" -executable -type f -xtype l -print0 | \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue