Skip to content

Commit 59457bf

Browse files
committed
Tweak the deps packaging
1 parent ec6ee85 commit 59457bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

linuxdeploy-plugin-python.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,14 @@ patch_binary() {
240240
fi
241241
else
242242
echo "Patching C-extension module ${name}"
243-
local rel=$(dirname $(readlink -f $1))
243+
local rpath="$(${patchelf} --print-rpath $1)"
244+
local rel="$(dirname $(readlink -f $1))"
244245
rel=${rel#${APPDIR}/usr}
245246
rel=$(echo $rel | sed 's|/[_a-zA-Z0-9.-]*|/..|g')
246-
"${patchelf}" --set-rpath '$ORIGIN:$ORIGIN'"${rel}/lib" "$1"
247+
if grep -qv '$ORIGIN'"${rel}/lib" <<< "${rpath}" ; then
248+
[[ ! -z "${rpath}" ]] && rpath="${rpath}:"
249+
"${patchelf}" --set-rpath "${rpath}"'$ORIGIN'"${rel}/lib" "$1"
250+
fi
247251
fi
248252

249253
local deps

0 commit comments

Comments
 (0)