Okular/Mac : store the correct install location in the okularpart "install_name"
Needs RevisionPublic

Authored by rjvbb on Jun 27 2018, 10:03 PM.

Details

Reviewers
aacid
Group Reviewers
Okular
Summary

On Mac, shared libraries typically need to have their install location as part of their "install_name" (or "id"). The link editor uses this information to hardcode the location where shared library dependencies are expected, and the dynamic loader will this fail if this information is not correct.

Okular recently (?) made the okularplugin library dependent on the okularpart (fortunately built as a shared library). This dependency is installed in the KDE plugin directory but the install_name is set to the default location for shared libraries ($prefix/lib/okularpart.dylib). As a result, the okularplugin fails to load.

This patch sets the required additional target property on both the okularpart and okularplugin shared libraries so they reflect the actual install location.

Test Plan

Without, loading libokularplugin.dylib fails:

can't open /opt/local/share/qt5/qml/org/kde/okular/libokularplugin.dylib (dlopen(/opt/local/share/qt5/qml/org/kde/okular/libokularplugin.dylib, 6): Library not loaded: /opt/local/lib/okularpart.dylib
  Referenced from: /opt/local/share/qt5/qml/org/kde/okular/libokularplugin.dylib
  Reason: image not found)
Exit 1

The patch solves this.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 398
Build 398: arc lint + arc unit
rjvbb created this revision.Jun 27 2018, 10:03 PM
Restricted Application added a project: Okular. · View Herald TranscriptJun 27 2018, 10:03 PM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
rjvbb requested review of this revision.Jun 27 2018, 10:03 PM
aacid requested changes to this revision.Feb 21 2020, 6:56 PM
aacid added a subscriber: aacid.

Please move as a Merge Request in https://invent.kde.org/kde/okular

We have pre-commit CI and lots of checks including clazy and clang-tidy there so it's a much better place for doing the review/approval/merge of the code.

This revision now requires changes to proceed.Feb 21 2020, 6:56 PM