diff --git a/README b/README index 4137e28..7dd9bc0 100644 --- a/README +++ b/README @@ -81,7 +81,7 @@ will not be read. Making this possible needs more research and effort. Generating Provides from qmldir files ------------------------------------- -Every module installed into the QML import path contains aqmldir` file with +Every module installed into the QML import path contains a `qmldir` file with metainformation. They usually contain a `module` line which specifies the identifier (those which don't are ignored) and a list of exports and plugins. Just the module identifier is not enough to generate the capability, major and diff --git a/qml-autoreqprov.changes b/qml-autoreqprov.changes index 86ca116..ee7bfa8 100644 --- a/qml-autoreqprov.changes +++ b/qml-autoreqprov.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 5 10:48:58 UTC 2021 - Christophe Giboudeaux + +- Update qml.req for Qt 6.2. qmlimportscanner is now installed in + %_qt6_libexecdir and has no symlink in /usr/bin. qmake will be + queried to find the install dir. + ------------------------------------------------------------------- Wed Jan 27 08:54:39 UTC 2021 - Fabian Vogt diff --git a/qml-autoreqprov.spec b/qml-autoreqprov.spec index 90e67f5..1b8e9e8 100644 --- a/qml-autoreqprov.spec +++ b/qml-autoreqprov.spec @@ -17,7 +17,7 @@ Name: qml-autoreqprov -Version: 1.0 +Version: 1.1 Release: 0 Summary: Automatic dependency generator for QML files and modules License: GPL-3.0-or-later @@ -36,6 +36,8 @@ Requires: (libqt5-qtdeclarative-tools if libQtQuick5) Requires: (qmlpluginexports-qt5 if libqt5-qtdeclarative-devel) Requires: (qmlpluginexports-qt6 if qt6-qml-devel) Requires: (qt6-declarative-tools if libQt6Qml6) +# Version 1.1 is not compatible with qt6-declarative < 6.2 +Conflicts: qt6-declarative-tools < 6.2.0 %description Automatic dependency generator for QML files and modules. diff --git a/qml.req b/qml.req index f58dcd8..6300ea6 100644 --- a/qml.req +++ b/qml.req @@ -4,13 +4,13 @@ set -euo pipefail -qtver= +qtvers= ret=0 while [ $# -gt 0 ]; do case $1 in --qtver) - qtver=$2 + qtvers=$2 shift ;; *) @@ -21,24 +21,27 @@ while [ $# -gt 0 ]; do done # Guess Qt version -if [[ -z $qtver ]]; then - for ver in $(seq 5 7); do - if command -v "qmlimportscanner${ver}" &>/dev/null || - command -v "qmlimportscanner-qt${ver}" &>/dev/null; then - qtver="${qtver}${ver}" - fi - done - - # No qmlimportscanner found - probably building Qt itself, - # where these deps aren't needed anyway. - [[ -z ${qtver} ]] && exit 0 +qtver= +[[ -n ${qtvers} ]] || qtvers="5 6 7" - if [[ ${#qtver} -ne 1 ]]; then - echo "Failed to guess Qt version!" >&2 - exit 1 - fi +for ver in ${qtvers}; do + command -v "qmake${ver}" &>/dev/null || command -v "qmake-qt${ver}" &>/dev/null && qtver="${qtver}${ver}" +done + +# zero or more than one qmake found. Abort. +if [[ ${#qtver} -ne 1 ]]; then + echo "Failed to guess Qt version!" >&2 + exit 1 fi +if [[ ${qtver} == 5 ]]; then + importscanner="qmlimportscanner-qt5" +else + importscanner="$(qmake${qtver} -query QT_HOST_LIBEXECS)/qmlimportscanner" +fi + +command -v "${importscanner}" &>/dev/null || echo "Failed to locate qmlimportscanner" + declare -A dependencies # foundDependency qt5qmlimport(Module.Uri.42) 69 # In the dependencies array, it sets the version of qt5qmlimport(Module.Uri.42) to 69, if lower @@ -48,9 +51,6 @@ foundDependency() { fi } -importscanner="qmlimportscanner${qtver}" -command -v "$importscanner" &>/dev/null || importscanner="qmlimportscanner-qt${qtver}" - # TODO: Get exit status of qmlimportscanner while read import min; do foundDependency "qt${qtver}qmlimport(${import})" "$min"