Opened 13 days ago

Last modified 12 days ago

#69793 new defect

KeePassXC @2.7.7_1 - No Longer Works Unless qt 5.8 or Later Is Installed

Reported by: RobK88 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: mountainlion Cc: RobK88
Port: keepassxc

Description

The port for KeePassXC @2.7.7_1 no longer works unless qt 5.8 or higher is installed. Yet on older Mac OS X versions such as Mtn Lion, port info keepassxc still shows qt 5.7 dependencies:

bash-3.2$ port info keepassxc
KeePassXC @2.7.7_1 (security, aqua)
Sub-ports:            KeePassXC-devel
Variants:             debug, universal

Description:          KeePassXC is a community fork of KeePassX with the goal to extend and improve it with new features and
                      bugfixes to provide a feature-rich, fully cross-platform and modern open-source password manager.
Homepage:             https://github.com/keepassxreboot/keepassxc

Fetch Dependencies:   gnupg2
Extract Dependencies: xz
Build Dependencies:   pkgconfig, cmake, clang-16, qt57-qttools
Library Dependencies: argon2, botan, libgcrypt, libomp, libsodium, minizip, readline, qrencode, ykpers, zlib, legacy-support,
                      macports-libcxx, qt57-qtbase, qt57-qtmacextras, qt57-qtsvg
Conflicts with:       KeePassXC-devel
Platforms:            darwin
License:              (GPL-2 or GPL-3)
Maintainers:          none

Please note that KeePassXC builds and rums just fine on Mtn Lion and later with just qt 5.7.

(Note: older Mac OS X versions (such as Mtn Lion) only support qt 5.7).

I recommend that the Portfile be changed back so qt 5.7 is allowed again. e.g. Change qt5.min.version in the Portfile back to 5.7.0:

qt5.min_version 5.7.0

Change History (8)

comment:1 Changed 13 days ago by RobK88

Cc: RobK88 added

comment:2 Changed 13 days ago by RobK88

I should add that officially the KeePassXC project only supports building KeePassXC using qt 5.8 and later. Yet qt 5.7 appears to work just fine. qt 5.7 is needed for older Mac OS X versions like Mtn Lion.

P.S. KeePassXC also builds on Lion using qt 5.6. But the interface does not work properly using qt 5.6. qt 5.7 appears to be the minimum working version for KeePassXC.

Last edited 13 days ago by RobK88 (previous) (diff)

comment:3 Changed 13 days ago by RobK88

Perhaps, the best solution is as follows:

1) Change qt.min.version to 5.7.0 2) If qt 5.7 is used to build the KeeePassXC port then display a Note stating that qt 5.7 is not officially supported by the developers of KeePassXC. But KeePassXC appears to work.

What is the easiest way to check the installed version of qt in a Portfile?

comment:4 Changed 13 days ago by ryandesign (Ryan Carsten Schmidt)

Please see [802a1ba2268ceefefb6c8115d9cd9ea106b2aca8/macports-ports]. I set the port's minimum Qt version to 5.8.0 because it did not build with earlier versions.

comment:5 Changed 13 days ago by ryandesign (Ryan Carsten Schmidt)

comment:6 Changed 12 days ago by RobK88

I hate to disagree. But I am running KeepassXC v 2.7.6 on Mtn Lion (built using qt 5.7) without any issues.

I was also able to build KeePassXC v2.7.6 on Lion (using qt 5.6) but when you run KeePassXC, the GUI does not work properly. One cannot properly resize panes inside the main Window.

So it looks like qt 5.7 is the real minimum version of qt for KeePassXC running on Macs.

I have not tried building KeePassXC v2.7.7 on Mtn Lion using qt 5.7. I will have to copy the Portfile to my local repo and change it so it will build when qt 5.7 is present. But I suspect it will work just fine. I will let you know. If it does, I will submit a PR to change qt5.min_version 5.7.0.

Please note that the use of qt 5.7 is not officially supported by the developers of KeePassXC. That is why I suggest we add a Note to the Portfile notifying people that qt 5.7 is not officially supported etc. when KeePassXC is being build using qt 5.7.

comment:7 Changed 12 days ago by RobK88

You are right. KeePassXC no longer builds on Mtn Lion using qt 5.7 since KeePassXC v2.7.7 is now using a new function QDateTime::fromSecsSinceEpoch() introduced in qt 5.8:

/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/keepassxc-2.7.7/src/format/OPUXReader.cpp:159:44: error: no member named 'fromSecsSinceEpoch' in 'QDateTime'
                        value = QDateTime::fromSecsSinceEpoch(valueMap.value(key).toULongLong(), Qt::UTC).toString();
                                ~~~~~~~~~~~^
/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/keepassxc-2.7.7/src/format/OPUXReader.cpp:194:45: error: no member named 'fromSecsSinceEpoch' in 'QDateTime'
        const auto createdTime = QDateTime::fromSecsSinceEpoch(itemMap.value("createdAt").toULongLong(), Qt::UTC);
                                 ~~~~~~~~~~~^
/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/keepassxc-2.7.7/src/format/OPUXReader.cpp:195:46: error: no member named 'fromSecsSinceEpoch' in 'QDateTime'
        const auto modifiedTime = QDateTime::fromSecsSinceEpoch(itemMap.value("updatedAt").toULongLong(), Qt::UTC);
                                  ~~~~~~~~~~~^
3 errors generated.
make[2]: *** [src/CMakeFiles/keepassx_core.dir/format/OPUXReader.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/build'
make[1]: *** [src/CMakeFiles/keepassx_core.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/build'
Command failed:  cd "/opt/local/var/macports/build/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/work/build" && /usr/bin/make -j2 -w all VERBOSE=ON 
Exit code: 2
Error: Failed to build KeePassXC: command execution failed
Error: See /opt/local/var/macports/logs/_Users_grinch_Development_Macports_local-repo_security_KeePassXC/KeePassXC/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

But it is easy to fix with a patch to use the deprecated function in qt 5.7 - QDateTime::fromTime_t() when qt 5.7 is being used. When I have time I will submit a PR with a patch so KeeePassXC will work again on Mtn Lion and newer Mac OS X Macs that still use qt 5.7.

comment:8 Changed 12 days ago by ryandesign (Ryan Carsten Schmidt)

Ideally, please submit the patch to the developers of KeePassXC. We would rather not carry patches in MacPorts.

Note: See TracTickets for help on using tickets.