Skip to content

Commit 695f548

Browse files
committed
Patch the relative symlinks for packages libaries
1 parent 40738aa commit 695f548

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

linuxdeploy-plugin-python.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,7 @@ patch_binary() {
201201
echo "Patching dependency ${name}"
202202
strip "$1"
203203
"${patchelf}" --set-rpath '$ORIGIN' "$1"
204-
if [ "$(command -v symlinks)" ]; then
205-
ln -s "$1" "${APPDIR}/usr/lib/${name}"
206-
symlinks -c "${APPDIR}/usr/lib/${name}"
207-
else
208-
ln -rs "$1" "${APPDIR}/usr/lib"
209-
fi
204+
ln -s "$2"/"$1" "${APPDIR}/usr/lib/${name}"
210205
fi
211206
else
212207
echo "Patching C-extension module ${name}"
@@ -240,9 +235,10 @@ cd "$APPDIR/${prefix}/bin"
240235
python=$(ls "python"?"."?)
241236
mkdir -p "${APPDIR}/usr/lib"
242237
cd "${APPDIR}/${prefix}/lib/${python}"
243-
find "lib-dynload" -name '*.so' -type f | while read file; do patch_binary "${file}"; done
244-
find "site-packages" -name '*.so' -type f | while read file; do patch_binary "${file}"; done
245-
find "site-packages" -name 'lib*.so*' -type f | while read file; do patch_binary "${file}"; done
238+
relpath="../../${prefix}/lib/${python}"
239+
find "lib-dynload" -name '*.so' -type f | while read file; do patch_binary "${file}" "${relpath}"; done
240+
find "site-packages" -name '*.so' -type f | while read file; do patch_binary "${file}" "${relpath}"; done
241+
find "site-packages" -name 'lib*.so*' -type f | while read file; do patch_binary "${file}" "${relpath}"; done
246242

247243

248244
# Copy any TCl/Tk shared data

0 commit comments

Comments
 (0)