Skip to content

Documentation: Qt callPackage approach incompatible with pkgs/by-name #287015

@Aleksanaa

Description

@Aleksanaa

Problem

Our Qt section says:

It is important to import Qt modules directly, that is: `qtbase`, `qtdeclarative`, etc. *Do not* import Qt package sets such as `qt5` because the Qt versions of dependencies may not be coherent, causing build and runtime failures.
Additionally all Qt packages must include `wrapQtAppsHook` in `nativeBuildInputs`, or you must explicitly set `dontWrapQtApps`.
`pkgs.callPackage` does not provide injections for `qtbase` or the like.
Instead you want to either use `pkgs.libsForQt5.callPackage`, or `pkgs.qt6Packages.callPackage`, depending on the Qt version you want to use.

But this is not compatible with the new by-name directory structure.

Proposal

There are already plenty of packages in pkgs/by-name invoking qt5 or qt6 directly. And if the structure of both sets remain the same, maybe we can use callPackage ./../.. { qt6 = qt5; } or something?

Checklist


Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions