Detect QML Dependencies

Fabian Vogt fabian at ritter-vogt.de
Fri Mar 31 07:27:06 BST 2023


Hi,

Am Donnerstag, 30. März 2023, 11:42:45 CEST schrieb Sandro Knauß:
> Hey,
> 
> in Debian we package more and more QML applications and face the problem, that 
> we don't have tooling to easily get a list of QML dependencies out of the qml 
> files. I normally end up doing a grep in the qml files and than I need to 
> translate these dependencies to the corresponding Debian packages. What is 
> quite error prune.
> Does anyone have already a working solution to detect the QML dependencies - 
> maybe there is alaready a qmllinter/qmlchecker tool that returns the needed 
> QML dependencies and create package dependencies?
> 
> That is currently my way:
> 
> grep -r --include="*qml" '^import ' | sed 's/^.*\.qml:import \([^ ]*.*\)/\1/g' 
> | sort | uniq

In openSUSE both sides are fully automated: .qml files are scanned for imports
and mapped to qtXqmlimport(org.kde.foo.X) >= Y capabilities and QML modules
automatically provide those.

Documentation is here:
https://build.opensuse.org/package/view_file/openSUSE:Factory/qml-autoreqprov/README?expand=1

For generating the qmlimport requirements we just use qmlimportscanner, part of
qtdeclarative.

Cheers,
Fabian

> Regards,
> 
> hefee






More information about the Distributions mailing list