Accepting request 923271 from KDE:Qt5

- 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. (forwarded request 923265 from cgiboudeaux)

OBS-URL: https://build.opensuse.org/request/show/923271
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/qml-autoreqprov?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2021-10-11 13:30:13 +00:00 committed by Git OBS Bridge
commit 090d255cfe
4 changed files with 31 additions and 22 deletions

2
README
View File

@ -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

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 5 10:48:58 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- 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 <fabian@ritter-vogt.de>

View File

@ -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.

40
qml.req
View File

@ -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"