Page MenuHomeFreeBSD

Install/remove qtchooser wrappers on pkg-install/uninstall
ClosedPublic

Authored by tcberner on Jan 1 2020, 5:26 PM.

Details

Summary

misc/qtchooser provides a wrapper binary bin/qtchooser, that when called with
name foo, will lauch the corresponding binary from
lib/qt${current_qt_version}/bin/foo.

Previously qtchooser would install a list of 30-ish symlinks to itself automatically.
Now we switch this around.

qt-dist ports that define QT_BINARIES will now have a @postexec and @postunexec
entry added to their plist to run the shell-script update-qtchooser-wrapper
(installed by qtchooser).

update-qtchooser-wrapper removes all symlinks to bin/qtchooser that have no
corresponding binary in lib/qt*/bin, and readds links that are missing.

PR: 242905

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tcberner created this revision.Jan 1 2020, 5:26 PM
===>  Installing for qt5-qmake-5.14.0
===>  Checking if qt5-qmake is already installed
===>   Registering installation for qt5-qmake-5.14.0
[130amd64-kde-qt-job-01] Installing qt5-qmake-5.14.0...
Removing qtchooser links
done
Creating qtchooser links
    /usr/local/bin/qmake
done
===========================================================================
=>> Checking for extra files and directories
=>> Cleaning up wrkdir
===>  Cleaning for qt5-qmake-5.14.0
tcberner updated this revision to Diff 66216.Jan 1 2020, 5:32 PM

Use exit rather than return.

arrowd added a subscriber: arrowd.Jan 2 2020, 7:44 AM

Do we really need those echos in the script? AFAIK, java/javavmwrapper does basically the same thing, but do it silently.

Do we really need those echos in the script? AFAIK, java/javavmwrapper does basically the same thing, but do it silently.

I think when a script modifies the system on pkg-add/pkg-remove it should say what it does.

adridg added a subscriber: adridg.Jan 2 2020, 8:21 PM

Something for the documentation comment at the top:

# If a port installs Qt version-specific binaries (e.g. "designer" which existed as a Qt4 application
# and exists as a Qt5 application and will probably be a Qt6 application) which should have a
# qtchooser-based wrapper, the port should set `QT_BINARIES=yes`.
#
# When QT_BINARIES is set to yes, compatibility symlinks (designer -> qtchooser, so that
# qtchooser can run  designer-qt5 or whatever is the selected Qt version) are installed by the port.
adridg added inline comments.Jan 2 2020, 8:26 PM
misc/qtchooser/files/update-qtchooser-wrapper.in
32 ↗(On Diff #66216)

Should be break, and a comment like # If at least one versioned executable is found for this name, keep the qtchooser compatibility symlink for this name; otherwise, remove it.

tcberner updated this revision to Diff 66266.Jan 2 2020, 8:35 PM

Address changes suggested by @adridg

adridg accepted this revision.Jan 3 2020, 2:26 PM

(I think that documentation comment should also be in qt-dist.mk though)

This revision was not accepted when it landed; it landed in state Needs Review.Jan 25 2020, 8:19 PM
This revision was automatically updated to reflect the committed changes.
grarpamp_gmail.com edited the summary of this revision. (Show Details)Jan 26 2020, 8:58 AM