File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -841,8 +841,21 @@ void changeIdentification(const QString &id, const QString &binaryPath)
841
841
setenv (" LD_LIBRARY_PATH" ,newPath.toUtf8 ().constData (),1 );
842
842
}
843
843
}
844
- LogNormal () << " Changing rpath in" << binaryPath << " to" << id;
845
- runPatchelf (QStringList () << " --set-rpath" << id << binaryPath);
844
+
845
+ QStringList rpath = oldRpath.split (" :" , QString::SkipEmptyParts);
846
+ rpath.prepend (id);
847
+ rpath.removeDuplicates ();
848
+ foreach (QString path, QStringList (rpath)) {
849
+ // remove any non-relative path that would point outside the package
850
+ if (!path.startsWith (" $ORIGIN" ))
851
+ {
852
+ LogWarning () << " Removing absolute rpath of " << path << " in " << binaryPath;
853
+ rpath.removeAll (path);
854
+ }
855
+ }
856
+
857
+ LogNormal () << " Changing rpath in" << binaryPath << " to" << rpath.join (" :" );
858
+ runPatchelf (QStringList () << " --set-rpath" << rpath.join (" :" ) << binaryPath);
846
859
847
860
// qt_prfxpath:
848
861
if (binaryPath.contains (" libQt5Core" )) {
You can’t perform that action at this time.
0 commit comments