Bug 258444 - devel/qbs: qbs doesn't find Qt components
Summary: devel/qbs: qbs doesn't find Qt components
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL: https://bugreports.qt.io/browse/QBS-1672
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-12 03:09 UTC by Yuri Victorovich
Modified: 2021-12-06 18:04 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2021-09-12 03:09:12 UTC
For example, the Tok project (https://invent.kde.org/network/tok) says that the command 'qbs' should be used to build it.

But qbs fails:
> Detecting Qt installations...
> ERROR: /disk-samsung/freebsd-ports/net-im/tok/work/tok-2fbfe1eb86ab76b2abebd45555da61404f5da6b6/src/Shared.qbs:7:1 Error while handling product 'tokInternal':
> /usr/ports/net-im/tok/work/tok-2fbfe1eb86ab76b2abebd45555da61404f5da6b6/src/Shared.qbs:66:5 Dependency 'Qt.widgets' not found for product 'tokInternal'.

- even though Qt5 widgets are installed.

Something is wrong with paths in qbs.

As a reference, Arch Linux also just calls qbs: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=tok-git
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2021-09-13 06:20:34 UTC
Moin moin 

> qbs
[...]
3 warnings and 1 error generated.
ERROR: Process failed with exit code 1.
The following products could not be built for configuration default:
org.kde.Tok, tokInternal


works on my machine and fails at compile errors.


mfg Tobias
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2021-09-20 15:55:05 UTC
One related inconsistency in qbs is that it expects the 'qmake' executable while the FreeBSD port installs 'qmake-qt5'.

The workaround is to always run:
> qbs moduleProviders.Qt.qmakeFilePaths:/usr/local/bin/qmake-qt5
Comment 3 Adriaan de Groot freebsd_committer freebsd_triage 2021-11-30 00:28:38 UTC
Simple way to check (doesn't need an entire tok checkout):

=== main.cpp
int main() {}
===

=== hello.qbs
Application {
    name: "hello"
    files: "main.cpp"
    Depends { name: "cpp" }
    Depends { name: "Qt.core" }
}
===

Output is

===
Build graph does not yet exist for configuration 'default'. Starting from scratch.
Resolving project for configuration default
Detecting Qt installations...
Found Qt at '/usr/local/lib/qt5/bin/qmake'.
Setting up Qt at '/usr/local/lib/qt5/bin/qmake'...
...
===

As tcberner points out, Tok has other build problems once qbs auto-finds our qmakes.
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-11-30 00:29:42 UTC
A commit in branch main references this bug:

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 (new)           | 60 ++++++++++++++++++++++
 devel/qbs/files/patch-doc_man_man.pri (gone)       |  9 ----
 .../patch-src_app_qbs-setup-qt_setupqt.cpp (new)   | 11 ++++
 devel/qbs/pkg-plist                                | 10 +++-
 6 files changed, 87 insertions(+), 15 deletions(-)
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2021-11-30 01:47:31 UTC
Not sure about the very latest version, but the combination of BINARY_ALIAS=   qmake=${_QMAKE} and --no-install qbs.installPrefix:${PREFIX} helps the problem in the OP.