Page MenuHomeFreeBSD

Centralize qt-ports pkg-scripts
ClosedPublic

Authored by adridg on Feb 21 2021, 9:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 5:40 PM
Unknown Object (File)
Feb 22 2024, 3:52 PM
Unknown Object (File)
Dec 20 2023, 7:25 AM
Unknown Object (File)
Nov 21 2023, 10:03 PM
Unknown Object (File)
Nov 15 2023, 5:09 PM
Unknown Object (File)
Oct 31 2023, 6:30 PM
Unknown Object (File)
Oct 14 2023, 4:08 PM
Unknown Object (File)
Sep 30 2023, 3:28 PM
Subscribers

Details

Reviewers
tcberner
bapt
Summary

When a Qt port is installed, it may need to add a line to qconfig-modules.h. When it is uninstalled, it may need to remove a line. When its options change (and pkg-upgrade does a deinstall-reinstall) the line may need to be added or removed (may depend on port options, too).

When a Qt port is installed, if it has versionable binaries that share a name across Qt versions, it needs to update symlinks to qtchooser.

The ports framework handles this with a collection of @postexec and @postunexec and a PKGDEINSTALL script.

Known PRs are 253356 and 253360, where lines are duplicated, or not remove when needed. This PR centralizes the update actions to one script, admittedly a long-ish and generic one, that ensures that the qconfig-modules.h maintains consistency and the qtchooser symlinks are updated accordingly.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Uses/qt-dist.mk
1

This is an artifact of pushing patches to ports through git and then across to Phab.

201

I'm not sure how much this costs; the script could possibly be split in two, or generated in a different way to be specifically-catering to the situation of this particular port. That would take a little bit more work, and right now, would obscure the point being made.

365

This chunk moves some variable settings outside of post-install (and the qtchooser update was misplaced outside the M5 block -- not a bad thing as long as we have only M5, though). We use these to massage the settings in the script.

An alternative would be to comment / filter the script based on settings here, generating a specialized install/uninstall script

380–381

This chunk is moved out of QT_DEFINES block because every Qt package now has a script. This is needed because a Qt package can have no DEFINES even if it previously did (ports OPTIONS change, for instance) and then it still needs to remove itself from qconfig-modules.h.

What could be done is specialize the script for the specific package: like in pkg-plist, introduce substitutions that produce a comment line (or not) depending on settings, and do those replacements and then filter out comment lines. The source script might then look something like this

@install POST-INSTALL)
@install@has_config add_config
@install@has_no_config remove_config
@install@has_binaries update_binaries
@install /usr/bin/true
@install ;;
@deinstall POST_DEINSTALL)
@deinstall remove_config
@deinstall@is_core clean_config
@deinstall@has_binaries update_binaries
@deinstall /usr/bin/true
@deinstall ;;

We could then do a substitution (@deinstall -> ##) and then a filter (deleting lines with ##) to specialize the script for the purpose of the package.

Chased all of my thoughts about minifying the scripts; there is now a "custom" version of the script for install- and deinstall, and the contents are tailored to the needs of the particular port.

adridg marked an inline comment as not done.Feb 22 2021, 3:01 PM

What could be done is specialize the script for the specific package:

This is what I have done; it makes the "source" script a bit hard to read (although I've done my best to align it in column 25 with tabs and document that, too) but the specific parts that are needed for the port are picked up and used as the install- and deinstall-script. I've put some effort into "minifying" the script, using short constructions where possible (e.g. : instead of /usr/bin/true).

Moin moin

A quick rebuild of kf5-* and plasma5-* showed no issues.

mfg Tobias

Uses/qt-dist.mk
375

^ pkg-change.in ?

378

^ I think we can just drop this TODO while here...

Apart from those two comment issues mentioned above, this looks good to me.

This revision is now accepted and ready to land.Feb 23 2021, 7:14 PM