git: 9f62e710c45f - main - devel/qbs: update to 1.20, latest upstream, and changed ports norms

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Tue, 30 Nov 2021 00:29:21 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9f62e710c45f743a1254569450683f12f7a0f46f

commit 9f62e710c45f743a1254569450683f12f7a0f46f
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2021-11-28 22:11:13 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-11-30 00:29:19 +0000

    devel/qbs: update to 1.20, latest upstream, and changed ports norms
    
    - Bump version and fix build.
    - See CHANGES, 20200115: ${PREFIX}/share/man is for manpages, so
      remove the patch that put the manpages elsewhere, and update plist.
    - When looking for qmake, look for suffixed names as well; we
      stopped using qtchooser some time ago, and adopted a qmake-qt5.
      Linux hosts do this with a check, we'll just `true` it in.
    - Pull in an upstream patch to warn when there is no qmake;
      massage it to look for suffixed qmakes as well.
    
    PR:             258444
    Reported by:    yuri
---
 devel/qbs/Makefile                                 |  6 ++-
 devel/qbs/distinfo                                 |  6 +--
 devel/qbs/files/patch-27bd9ac.diff                 | 60 ++++++++++++++++++++++
 devel/qbs/files/patch-doc_man_man.pri              |  9 ----
 .../files/patch-src_app_qbs-setup-qt_setupqt.cpp   | 11 ++++
 devel/qbs/pkg-plist                                | 10 +++-
 6 files changed, 87 insertions(+), 15 deletions(-)

diff --git a/devel/qbs/Makefile b/devel/qbs/Makefile
index 9d2a1011cd53..8fba68171daf 100644
--- a/devel/qbs/Makefile
+++ b/devel/qbs/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	qbs
 DISTVERSIONPREFIX=	src-
-DISTVERSION=	1.19.2
+DISTVERSION=	1.20.0
 CATEGORIES=	devel
 MASTER_SITES=	QT/official_releases/${PORTNAME}/${PORTVERSION}
 DIST_SUBDIR=	KDE/Qt/qbs
@@ -48,6 +48,10 @@ pre-configure:
 	${MKDIR} ${CONFIGURE_WRKSRC}
 	${ECHO_CMD} 'QMAKE_LIBDIR_FLAGS = -L${CONFIGURE_WRKSRC}/lib' >> ${CONFIGURE_WRKSRC}/.qmake.cache
 
+# Workaround strip(1) problems
+post-stage:
+	-${RM} ${STAGEDIR}${LOCALBASE}/libexec/qbs/ecp.*
+
 # The file in question is not used on FreeBSD. To silence stage-qa, remove it from stage-dir.
 post-install:
 	${RM} ${STAGEDIR}${DATADIR}/modules/bundle/update-specs.sh
diff --git a/devel/qbs/distinfo b/devel/qbs/distinfo
index efa3b31ef481..a35bafe80dc5 100644
--- a/devel/qbs/distinfo
+++ b/devel/qbs/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1627317013
-SHA256 (KDE/Qt/qbs/qbs-src-1.19.2.tar.gz) = 91fd5ca08f170e8178dd5183579f03e56965648770b7e7a09258550aee53950f
-SIZE (KDE/Qt/qbs/qbs-src-1.19.2.tar.gz) = 4961194
+TIMESTAMP = 1638137269
+SHA256 (KDE/Qt/qbs/qbs-src-1.20.0.tar.gz) = 44961a4bb61580ae821aaf25ebb5a5737bd8fb79ec0474aa2592cdd45cc5171f
+SIZE (KDE/Qt/qbs/qbs-src-1.20.0.tar.gz) = 5033322
diff --git a/devel/qbs/files/patch-27bd9ac.diff b/devel/qbs/files/patch-27bd9ac.diff
new file mode 100644
index 000000000000..bd61d639e203
--- /dev/null
+++ b/devel/qbs/files/patch-27bd9ac.diff
@@ -0,0 +1,60 @@
+This comes from the upstream issue
+	https://bugreports.qt.io/browse/QBS-1672
+and is the diff available at
+	https://codereview.qt-project.org/c/qbs/qbs/+/371943
+
+adridg@: I have added the `versions` part of the code, that
+additionally looks for -qt5 (which we have) and unsuffixed
+and -qt (neither of which we have) executables. This matches
+the code in the setupqt.cpp files, elsewhere.
+
+diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
+index b1239a7..422863b 100644
+--- share/qbs/module-providers/Qt/setup-qt.js
++++ share/qbs/module-providers/Qt/setup-qt.js
+@@ -53,24 +53,30 @@
+     if (qmakeFilePaths && qmakeFilePaths.length > 0)
+         return qmakeFilePaths;
+     console.info("Detecting Qt installations...");
+-    var pathValue = Environment.getEnv("PATH");
+-    if (!pathValue)
+-        return [];
+-    var dirs = splitNonEmpty(pathValue, qbs.pathListSeparator);
+-    var suffix = exeSuffix(qbs);
+     var filePaths = [];
+-    for (var i = 0; i < dirs.length; ++i) {
+-        var candidate = FileInfo.joinPaths(dirs[i], "qmake" + suffix);
+-        var canonicalCandidate = FileInfo.canonicalPath(candidate);
+-        if (!canonicalCandidate || !File.exists(canonicalCandidate))
+-            continue;
+-        if (FileInfo.completeBaseName(canonicalCandidate) !== "qtchooser")
+-            candidate = canonicalCandidate;
+-        if (!filePaths.contains(candidate)) {
+-            console.info("Found Qt at '" + toNative(candidate) + "'.");
+-            filePaths.push(candidate);
++    var pathValue = Environment.getEnv("PATH");
++    if (pathValue) {
++        var dirs = splitNonEmpty(pathValue, qbs.pathListSeparator);
++        var versions = ["", "-qt5", "-qt4"];
++        var suffix = exeSuffix(qbs);
++        for (var i = 0; i < dirs.length; ++i) { for (var iver = 0; iver < versions.length; ++iver) {
++            var candidate = FileInfo.joinPaths(dirs[i], "qmake" + versions[iver] + suffix);
++            var canonicalCandidate = FileInfo.canonicalPath(candidate);
++            if (!canonicalCandidate || !File.exists(canonicalCandidate))
++                continue;
++            if (FileInfo.completeBaseName(canonicalCandidate) !== "qtchooser")
++                candidate = canonicalCandidate;
++            if (!filePaths.contains(candidate)) {
++                console.info("Found Qt at '" + toNative(candidate) + "'.");
++                filePaths.push(candidate);
++            } }
+         }
+     }
++    if (filePaths.length === 0) {
++        console.warn("Could not find any qmake executables in PATH. Either make sure a qmake "
++        + "executable is present in PATH or set the moduleProviders.Qt.qmakeFilePaths property "
++        + "to point a qmake executable.");
++    }
+     return filePaths;
+ }
+ 
diff --git a/devel/qbs/files/patch-doc_man_man.pri b/devel/qbs/files/patch-doc_man_man.pri
deleted file mode 100644
index 9c2a757c1567..000000000000
--- a/devel/qbs/files/patch-doc_man_man.pri
+++ /dev/null
@@ -1,9 +0,0 @@
---- doc/man/man.pri.orig	2017-12-26 13:19:41 UTC
-+++ doc/man/man.pri
-@@ -1,5 +1,5 @@
- qbs_no_man_install: return()
- 
- man.files = $$PWD/qbs.1
--man.path = $${QBS_INSTALL_PREFIX}/share/man/man1
-+man.path = $${QBS_INSTALL_PREFIX}/man/man1
- INSTALLS += man
diff --git a/devel/qbs/files/patch-src_app_qbs-setup-qt_setupqt.cpp b/devel/qbs/files/patch-src_app_qbs-setup-qt_setupqt.cpp
new file mode 100644
index 000000000000..7824f9aba426
--- /dev/null
+++ b/devel/qbs/files/patch-src_app_qbs-setup-qt_setupqt.cpp
@@ -0,0 +1,11 @@
+--- src/app/qbs-setup-qt/setupqt.cpp.orig	2021-11-28 22:25:29 UTC
++++ src/app/qbs-setup-qt/setupqt.cpp
+@@ -70,7 +70,7 @@ static QStringList qmakeExecutableNames()
+ {
+     const QString baseName = HostOsInfo::appendExecutableSuffix(QStringLiteral("qmake"));
+     QStringList lst(baseName);
+-    if (HostOsInfo::isLinuxHost()) {
++    if (true || HostOsInfo::isLinuxHost()) {
+         // Some distributions ship binaries called qmake-qt5 or qmake-qt4.
+         lst << baseName + QLatin1String("-qt5") << baseName + QLatin1String("-qt4");
+     }
diff --git a/devel/qbs/pkg-plist b/devel/qbs/pkg-plist
index 73b5a6f5c839..bdeb47c32272 100644
--- a/devel/qbs/pkg-plist
+++ b/devel/qbs/pkg-plist
@@ -43,7 +43,7 @@ include/qbs/use_installed_corelib.pri
 lib/libqbscore.prl
 lib/libqbscore.so
 lib/libqbscore.so.1
-lib/libqbscore.so.1.19
+lib/libqbscore.so.1.20
 lib/libqbscore.so.%%SHLIB_VERSION%%
 lib/qbs/plugins/libclangcompilationdbgenerator.so
 lib/qbs/plugins/libiarewgenerator.so
@@ -54,7 +54,7 @@ lib/qbs/plugins/libqbs_qt_scanner.so
 lib/qbs/plugins/libvisualstudiogenerator.so
 libexec/qbs/dmgbuild
 libexec/qbs/qbs_processlauncher
-man/man1/qbs.1.gz
+share/man/man1/qbs.1.gz
 %%PORTDOCS%%%%DOCSDIR%%/html/attributions.html
 %%PORTDOCS%%%%DOCSDIR%%/html/building-applications.html
 %%PORTDOCS%%%%DOCSDIR%%/html/building-qbs.html
@@ -584,6 +584,8 @@ man/man1/qbs.1.gz
 %%DATADIR%%/imports/qbs/Probes/ClangClBinaryProbe.qbs
 %%DATADIR%%/imports/qbs/Probes/ClangClProbe.qbs
 %%DATADIR%%/imports/qbs/Probes/ConanfileProbe.qbs
+%%DATADIR%%/imports/qbs/Probes/CosmicProbe.qbs
+%%DATADIR%%/imports/qbs/Probes/DmcProbe.qbs
 %%DATADIR%%/imports/qbs/Probes/FrameworkProbe.qbs
 %%DATADIR%%/imports/qbs/Probes/GccBinaryProbe.qbs
 %%DATADIR%%/imports/qbs/Probes/GccProbe.qbs
@@ -691,8 +693,12 @@ man/man1/qbs.1.gz
 %%DATADIR%%/modules/cpp/MingwBaseModule.qbs
 %%DATADIR%%/modules/cpp/UnixGCC.qbs
 %%DATADIR%%/modules/cpp/android-gcc.qbs
+%%DATADIR%%/modules/cpp/cosmic.js
+%%DATADIR%%/modules/cpp/cosmic.qbs
 %%DATADIR%%/modules/cpp/cpp.js
 %%DATADIR%%/modules/cpp/darwin.js
+%%DATADIR%%/modules/cpp/dmc.js
+%%DATADIR%%/modules/cpp/dmc.qbs
 %%DATADIR%%/modules/cpp/freebsd-gcc.qbs
 %%DATADIR%%/modules/cpp/freebsd.js
 %%DATADIR%%/modules/cpp/gcc.js