[Development] Qt 4.x and Qt 5 frameworks should use @rpath (QTBUG-31814)

Jake Petroules jake.petroules at petroules.com
Tue Aug 5 00:47:23 CEST 2014


On 2014-08-04, at 03:38 PM, Adam Strzelecki <ono at java.pl> wrote:

>> Before you do that, can you write up a proposal on what you want to accomplish and how to get there?
> 
> WHAT I WANT TO ACOMPLISH
> 
> (1) Remove need to rewrite Qt libraries (frameworks) headers during install and during macdeployqt
> (2) This makes possible to check whether libraries came from official SDK (i.e. md5 sums)
> (3) Won't invalidate frameworks signatures when changing their binary contents
> (4) Make SDK relocable, so it can be moved around w/o need to reinstall, also making drag&drop SDK installer possible for Mac
> 
> HOW TO GET THERE
> 
> Core changes to make things working:
> 
> (1) [qtbase/qmake] Add `QMAKE_INSTALL_NAME_PREFIX` variable which defaults to `@rpath` when using `lib_bundle` configuration.
> (2) [qtbase/qmake/UnixMakefile,PBX] When `QMAKE_INSTALL_NAME_PREFIX` is set and `absolute_library_soname` is not active prepend $QMAKE_INSTALL_NAME_PREFIX/ to $soname.
> (3) [qtbase/qmake] Set `QMAKE_RPATH_DIR` to relative to executable path $QT_INSTALL_LIBS by default for all Qt Mac projects, additionally `@executable_path/../Frameworks` to `app_bundle` projects **Jake would argue but please see reasoning at the very bottom**

NOTE: This will need to be @executable_path/../Frameworks for OS X, but @executable_path/Frameworks for iOS. We also want @loader_path/Frameworks for framework targets on both platforms in addition to @executable_path. Order (highest to lowest priority) should be:

(1) @executable_path ...
(2) @loader_path ...
(3) $QT_INSTALL_LIBS

> Build Qt SDK with @rpath
> 
> (4) [qtbase] Remove `absolute_library_soname` from Mac build, so all Qt frameworks are built by default with @rpath/ install id.
> (5) [installer-framework] Remove rewriting install ids as no longer necessary
> (6) [qtsdk] Remove padding folder
> 
> Make changes to macqtdeploy
> 
> (7) [qttools/macdeployqt] Remove rewriting Qt frameworks install ids after copying them to the bundle
> (8) [qttools/macdeployqt] Remove rewriting Qt frameworks paths in executable (they will be already @rpath/...)
> (9) [qttools/macdeployqt] Add `install_name_tool -delete_rpath $QT_INSTALL_LIBS SomeApp.app/Contents/MacOS/SomeApp`
> 
> That's it. No changes needed to Qt Creator, existing Qt projects, etc. etc.

...for now. ;)

> Further changes to drop putting any absolute paths during build, and copy frameworks to build (as Jake proposed) should be next step. As I said first I want to introduce @rpath but keep current workflow untouched. Then we can discuss further workflow improvements.
> 
> Regards,
> -- 
> Adam Strzelecki
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development


So I think at this point we can agree on this so far, on the condition that:

(1) The remaining absolute rpath will not be a permanent thing and is simply postponed to "Phase II"
(2) Copying frameworks to bundle will be DEFAULT workflow in "Phase II" (I have no problems with adding an option to turn it off)
-- 
Jake Petroules - jake.petroules at petroules.com
Chief Technology Officer - Petroules Corporation




More information about the Development mailing list