Bug 266915 - astro/stellarium: Fails to build if devel/qt6-base is installed but not x11-toolkits/qt6-charts
Summary: astro/stellarium: Fails to build if devel/qt6-base is installed but not x11-t...
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-ports-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-10-09 11:20 UTC by Tomoaki AOKI
Modified: 2022-11-04 10:14 UTC (History)
4 users (show)

See Also:
fernape: maintainer-feedback? (danfe)


Attachments
Patch to force Qt5 even if devel/qt6-base is installed. (478 bytes, patch)
2022-10-09 11:24 UTC, Tomoaki AOKI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoaki AOKI 2022-10-09 11:20:04 UTC
astro/stellarium finds Qt6 if devel/qt6-base is installed, but as astro/stellarium/Makefile is created for Qt5, fails to build if x11-toolkits/qt6-charts is not installed.

As Qt6 is not yet widely used on ports, it would be better ignoring Qt6 and force Qt5 for now.
Comment 1 Tomoaki AOKI 2022-10-09 11:24:07 UTC
Created attachment 237163 [details]
Patch to force Qt5 even if devel/qt6-base is installed.

Patch to force Qt5 even if devel/qt6-base is installed.
Applicable over /usr/ports.
This fixed build at least for me.
Comment 2 Tomoaki AOKI 2022-10-09 11:54:47 UTC
Forgot to quote error mode.

===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/astro/stellarium/work/.build
-- Found CMake 3.24.0
-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Platform: FreeBSD-13.1-STABLE (amd64)
-- Building Stellarium 1.0 (v1.22.3; Mode: Release)
-- Found Threads: TRUE  
-- Found Qt6: /usr/local/lib/qt6/bin/qmake (found suitable version 6.4.0)
-- Found OpenGL: /usr/local/lib/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Found XKB: /usr/local/lib/libxkbcommon.so (found suitable version "1.4.1", minimum required is "0.5.0") 

-- Found WrapVulkanHeaders: /usr/local/include  
-- Could NOT find Qt6Charts (missing: Qt6Charts_DIR)
CMake Error at CMakeLists.txt:572 (FIND_PACKAGE):
  Found package configuration file:                                             
                                                                                
    /usr/local/lib/cmake/Qt6/Qt6Config.cmake                                    
                                                                                
  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT        
  FOUND.  Reason given by package:                                              
                                                                                
  Failed to find required Qt component "Charts".                                
                                                                                
  Expected Config file at                                                       
  "/usr/local/lib/cmake/Qt6Charts/Qt6ChartsConfig.cmake" does NOT exist         
                                                                                
                                                                                
                                                                                
  Configuring with --debug-find-pkg=Qt6Charts might reveal details why the      
  package was not found.                                                        
                                                                                
  Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some     
  of the path variables that find_package uses to try and find the package.     
                                                                                
                                                                                
                                                                                
-- Configuring incomplete, errors occurred!
See also "/usr/ports/astro/stellarium/work/.build/CMakeFiles/CMakeOutput.log".
See also "/usr/ports/astro/stellarium/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/astro/stellarium
*** Error code 1

Stop.
make: stopped in /usr/ports/astro/stellarium
egrep: empty (sub)expression
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20221009-42535-rdudr6 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=stellarium-0.22.2 UPGRADE_PORT_VER=0.22.2 make WITH+="NVIDIA,NVIDIA_GL"
** Fix the problem and try again.
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2022-10-10 04:33:17 UTC
Moin moin 

it would likely make sense to add qt5/qt6 flavors to the port.


mfg Toibas
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-10-10 07:47:15 UTC
(In reply to Tobias C. Berner from comment #3)
> it would likely make sense to add qt5/qt6 flavors to the port.
Yes, it would be nice I guess, but it feels like our Qt6 framework is a bit premature and counterintuitive.  E.g. find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui REQUIRED) maps straight to ``USE_QT=core gui'' with Qt5, but there are no such components with Qt6, etc.
Comment 5 Tobias C. Berner freebsd_committer freebsd_triage 2022-10-10 08:04:23 UTC
(In reply to Alexey Dokuchaev from comment #4)

The idea is to split Qt6 once the package/ports have sub-packages. 


mfg Tobias
Comment 6 Tomoaki AOKI 2022-10-10 08:57:43 UTC
(In reply to Alexey Dokuchaev from comment #4)
devel/qt6-base incorporates multiple components including core, concurrent, dbus, gui and some more. And some more are ported independently.

Not sure all components required by stellarium are already ported to FreeBSD.

But first of all, to allow Qt6 build of stellarium, all dependencies should be FLAVORized without conflicting each other. It could be a lot of work to avoid conflicting.

A quick and rough investigation, astro/calcmysky and devel/qxlsx seems to be able to build with Qt6. (Just looking into upstream CMakeLists.txt.)

But maybe built package would conflict each other as is.
Comment 7 Tobias C. Berner freebsd_committer freebsd_triage 2022-10-10 09:39:04 UTC
(In reply to Tomoaki AOKI from comment #6)

If it only requires core, then it USES=qt:6 and USE_QT=base is enough. 

The only thing that the ports tree is missing for Qt6 is the webengine related stuff.


mfg Tobias
Comment 8 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-11-04 09:38:06 UTC
(In reply to Tomoaki AOKI from comment #6)
> A quick and rough investigation, astro/calcmysky and devel/qxlsx seems to be
> able to build with Qt6.
Yes, they are.

> But maybe built package would conflict each other as is.
Right, that's one of the reasons why I've eventually dropped the "two flavors" idea.  Maybe I'll revisit it later, but prefer to stick to Qt5 for the time being.
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-11-04 10:12:53 UTC
A commit in branch main references this bug:

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

commit a76969f7c21a86ac26dc3af3a4d8907960934552
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-11-04 09:43:12 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-11-04 09:43:12 +0000

    astro/{calcmysky,stellarium}: update both ports to the latest versions

    It's unfortunate transition time when they cannot be updated separately,
    not at least without some ugly patching.

    Make Stellarium use static release tarball instead of the generated by
    GitHub one.  While currently it does not win us much, next version will
    be additionally offering smaller .tar.xz distfile which we'll switch to
    more easily.

    Enforce Qt5 build for now.  While Stellarium and its dependencies are
    Qt6-ready, providing correct and coherent flavors for all of them is
    too much work for little gain.  Everyone should be using Qt5 anyways.

    PR:     266915

 astro/calcmysky/Makefile   |   4 +-
 astro/calcmysky/distinfo   |   6 +-
 astro/calcmysky/pkg-descr  |   4 +-
 astro/calcmysky/pkg-plist  |   8 +-
 astro/stellarium/Makefile  |  22 ++----
 astro/stellarium/distinfo  |  12 ++-
 astro/stellarium/pkg-plist | 180 +--------------------------------------------
 7 files changed, 26 insertions(+), 210 deletions(-)