From cc79c7f602713d6a581610b9f2882aeac3c82376 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 14 Jan 2019 13:11:12 +0100 Subject: [PATCH] libpbuild: function to install required shared libs added --- Pmodules/libpbuild.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 7b1eef7..f0876da 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -414,6 +414,17 @@ pbuild::install() { make install } +pbuild::install_shared_libs() { + local -r binary="${PREFIX}/$1" + local -r pattern="$2" + local -r dstdir="${3:-${PREFIX}/lib}" + + test -e "${binary}" || std::die 3 "${binary}: does not exist or is not executable!" + mkdir -p "${dstdir}" + local -r libs=( $(ldd "${binary}" | awk "/ => \// && /${pattern}/ {print \$3}") ) + cp -avL "${libs[@]}" "${dstdir}" +} + pbuild::post_install() { : }