Successful build of KMyMoney 5.2 (Qt6/Master) on macOS ARM64

Successfully built and packaged KMyMoney 5.2 (Master) for macOS ARM64 using Craft. The official build scripts currently have a few blockers for Qt6 on macOS, specifically regarding compiler strictness, missing tool paths, and a broken install rule in the main CMakeLists.txt.

1. Initialize environment
source ~/CraftRoot/craft/craftenv.sh
craft --set branch=master kmymoney
craft --update

2. Build core dependencies
craft extragear/alkimia
craft libs/qt6/qtwebengine

3. Set compiler/path overrides (CRITICAL for macOS Clang/Qt6)
export CFLAGS=ā€œ-Wno-error=implicit-function-declarationā€
export CXXFLAGS=ā€œ-Wno-error=implicit-function-declarationā€
export LDFLAGS=ā€œ-L/Users/devel/CraftRoot/lib -liconvā€
export PATH=/Users/devel/CraftRoot/libexec:$PATH

4. Fix Gwenhywfar tool detection
craft --set ā€œargs=–without-x --with-guis=qt6 MOC=/Users/devel/CraftRoot/libexec/moc UIC=/Users/devel/CraftRoot/libexec/uicā€ libs/gwenhywfar
craft libs/gwenhywfar
craft libs/aqbanking

5. Patch KMyMoney source (Fixes fatal ā€˜no BUNDLE DESTINATION’ error at line 206)
craft --fetch kmymoney
cd /Users/devel/CraftRoot/download/git/extragear/kmymoney/kmymoney
perl -pi -e ā€˜s/install(TARGETS kmymoney/install(TARGETS kmymoney BUNDLE DESTINATION bin/g’ CMakeLists.txt

6. Final Build
craft --set ā€œargs=-DBUILD_WITH_QT6=ON -DCMAKE_OSX_ARCHITECTURES=arm64ā€ kmymoney
craft kmymoney

The final .app is located in /Users/devel/CraftRoot/bin/kmymoney.app due to the perl patch. To package: craft --package kmymoney
Mac was setup with user ā€œdevel" to clarify provided paths above.

1 Like

I’m guessing some of those changes could be added to the Craft blueprints, but I’m not that familiar with Craft.

We should probably replace ${INSTALL_TARGETS_DEFAULT_ARGS} with ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} in that line, to handle all platforms. Source here.

Done

Subject: Follow-up: Full Functional Verification of KMyMoney 5.2 on macOS (ARM64/M4)

Hi everyone,

Following up on my previous post regarding a successful build of KMyMoney 5.2 (Qt6/master) on macOS (M4). While I initially reported a successful compile, further testing revealed that the AqBanking/KBanking components required specific source patches and resource-linking to be fully functional.

I have now verified a 100% ā€œground-upā€ build from a clean Craft environment that resolves a ā€œMenu Hijackā€ issue and the AqBanking initialization errors. Below are the technical details and the specific ā€œrecipeā€ used.

1. The ā€œMenu Hijackā€ Fix (kbanking plugin)

Issue: On macOS, the settings_aqbanking action was automatically moved to the ā€œApp Name > Preferencesā€ slot by the Qt framework. This suppressed the main KMyMoney configuration window (the one with the sidebar).
Solution: In kmymoney/plugins/kbanking/kbanking.cpp, the MenuRole was explicitly set to NoRole.
Code Change:
settings_aqbanking->setMenuRole(QAction::NoRole);
Result: This restores the Sidebar-driven ā€œConfigure KMyMoneyā€ window and leaves AqBanking as a separate item under ā€œSettings.ā€

2. Banking Library Build Issues

Issue: Modern Clang (Xcode 15+) treats implicit function declarations as errors, and the Gwenhywfar/AqBanking build fails to locate Qt6 moc and uic.
Solution:

  • Use -Wno-error=implicit-function-declaration in CFLAGS/CXXFLAGS

  • Pass explicit MOC/UIC paths during the Gwenhywfar craft configuration

3. Missing Bundle Resources (Runtime Fix)

Issue: The app would launch, but ā€œConfigure AqBankingā€¦ā€ would fail to open with: Dialog description file not found (-51).
Root Cause: The .app bundle was missing internal links to the banking drivers and XML dialog blueprints.
Verification: Manually symlinking lib/gwenhywfar, lib/aqbanking, and their respective share folders into the .app/Contents/ directory resolved all runtime errors.

The Reproduction Steps (M4/ARM64)

For those looking to reproduce or update the CI scripts, these are the exact steps that resulted in a fully functional build:

# 1. Clean Bootstrap
rm -rf ~/CraftRoot
mkdir ~/CraftRoot
curl https://raw.githubusercontent.com/KDE/craft/master/setup/CraftBootstrap.py -o setup.py
python3 setup.py --prefix ~/CraftRoot # Select macOS/arm64
source ~/CraftRoot/craft/craftenv.sh

# 2. Patch Source (The Menu Fix)
craft --fetch kmymoney
# Apply: settings_aqbanking->setMenuRole(QAction::NoRole); to kbanking.cpp

# 3. Set M4 Environment Guardrails
export CFLAGS="-Wno-error=implicit-function-declaration"
export CXXFLAGS="-Wno-error=implicit-function-declaration"
export LDFLAGS="-L${CRAFT_ROOT}/lib -liconv"
export PATH=${CRAFT_ROOT}/libexec:$PATH

# 4. Build Core Stack
craft extragear/alkimia
craft libs/qt6/qtwebengine

# 5. Build Banking Drivers (Injected Paths)
craft --set "args=--without-x --with-guis=qt6 MOC=${CRAFT_ROOT}/libexec/moc UIC=${CRAFT_ROOT}/libexec/uic" libs/gwenhywfar
craft libs/gwenhywfar libs/aqbanking

# 6. Final Build with Bundle Flag
craft --set "args=-DBUILD_WITH_QT6=ON -DCMAKE_OSX_ARCHITECTURES=arm64 -DKDE_INSTALL_BUNDLEDIR=Applications/KDE" kmymoney
craft kmymoney

# 7. Final Bundle Repair (Symlinks)
APP_CON="~/CraftRoot/Applications/KDE/kmymoney.app/Contents"
ln -sf ~/CraftRoot/lib/gwenhywfar "$APP_CON/lib/"
ln -sf ~/CraftRoot/lib/aqbanking "$APP_CON/lib/"
ln -sf ~/CraftRoot/share/gwenhywfar "$APP_CON/Resources/"
ln -sf ~/CraftRoot/share/aqbanking "$APP_CON/Resources/"

The executable now ends up at: ~/CraftRoot/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney. I have not performed exhaustive testing, but so far I haven’t found anything additional. Hopefully this can help get the official macOS CI/CD going again.

Cool. Thanks for all the hard work that went into this. The necessary patch to fix the KMyMoney menu is in the git repo.

I wonder, if you can check the following patch against the gwenhywfar blueprint.

diff --git libs/_autotools/gwenhywfar/gwenhywfar.py libs/_autotools/gwenhywfar/gwenhywfar.py
index 79c9ea1b0..93ccbdfe0 100644
--- libs/_autotools/gwenhywfar/gwenhywfar.py
+++ libs/_autotools/gwenhywfar/gwenhywfar.py
@@ -56,6 +56,7 @@ class subinfo(info.infoclass):
 class Package(AutoToolsPackageBase):
     def __init__(self, **kwargs):
         super().__init__(**kwargs)
+        root = str(CraftCore.standardDirs.craftRoot())
         self.subinfo.options.configure.args += ["--with-guis=qt6"]
 
         # For appImage builds the --enable-local-install is needed so that
@@ -66,6 +67,12 @@ class Package(AutoToolsPackageBase):
         if CraftCore.compiler.isLinux:
             self.subinfo.options.configure.args += ["--enable-binreloc"]
 
+        if CraftCore.compiler.isMacOS:
+            self.subinfo.options.configure.cflags += " -Wno-implicit-function-declaration"
+            self.subinfo.options.configure.cxxflags += " -Wno-implicit-function-declaration"
+            self.subinfo.options.configure.ldflags += f" -L${root}/lib -liconv"
+            self.subinfo.options.configure.args += [f"--without-x MOC={root}/libexec/moc UIC={root}/libexec/uic"]
+
         # Disable autoreconf. Otherwise following errors prevent configuring:
         # configure.ac:618: warning: macro 'AM_PATH_LIBGCRYPT' not found in library
         # configure.ac:633: warning: macro 'AM_PATH_GPG_ERROR' not found in library

I have no idea how to add ${CRAFT_ROOT}/libexec to the path in the blueprint. Any reason, why this is needed? Maybe, the problem can be resolved in a different way.

Similar changes probably need to be added to AqBanking. But that is a second step.