Update manjaro-settings-manager to Qt6

Hi there,

I recently went on a remove-qt5 binge on my personal devices. Doing that, I bumped into a problem - manjaro-settings-manager is installed by default and still uses it.

Long story short, I’ve now got a branch that builds it against Qt6. No AI involved ^^. I can’t post links yet though.

Ideally, it - or a version of it - would get upstreamed, but I’ve not contributed to Manjaro before so don’t really know the process. Looks like the GitLab is closed and previous aspiring contributors have been asked to create a thread in the forum, so, here I am.

10 Likes

I don’t know the process, either. Perhaps, if you have an account at some git host provider (gitlab, gitea, github doesn’t matter) you could use this for sharing. Another option would be sending by email :facepalm:

1 Like

I run my own gitea and the code is up there, I just… can’t post the link ^^. Anti-spam measures I assume.

the link - lupine/manjaro-settings-manager - manjaro-settings-manager - Gitea: Git with a cup of tea , or maybe https://code.ur.gs/lupine/manjaro-settings-manager/compare/master...nt-qt6-upgrade?expand=1

3 Likes

Yes, looks good to me. Great thanks! I think @philm should have a look.

3 Likes

Is it possible for someone who would like to contribute to open PR on the project’s gitlab (or GitHub) ?

2 Likes

While you’re at it there is this issue I posted about also but couldn’t contribute directly on the GitLab site.

1 Like

I created the qt6 branch from your fork.

However, it doesn’t appear quite ready yet…

EDIT: Testing in progress…

4 Likes

What commands did you run?

cmake -B build -DQT_DEFAULT_MAJOR_VERSION=6
cmake --build build

works for me, that is, the settings manager builds and runs. I only had to install the vulkan headers.

I was able to build it. Apparently it was one of the old Cmake flags from the Qt5 version.

EDIT: It appears it was KDE_INSTALL_USE_QT_SYS_PATHS='ON' causing the failure.

That flag wasn’t necessary, I only used CMAKE_BUILD_TYPE='RelWithDebInfo' & CMAKE_INSTALL_PREFIX='/usr'.

That’s not required, it’s only for KDE development.

-- The following OPTIONAL packages have not been found:

 * Python3
 * WrapVulkanHeaders

-- Configuring done (1.4s)

Thanks for looking! Happy to collaborate on any needed changes, or feel free to just take it as a base and directly fix anything that needs it. I did briefly test it locally, but nothing in-depth.

“It compiles, ship it!”

1 Like

It does and I was thinking about shipping it for testing purposes. What about the KCM module? It still installs desktop files in /usr/lib/kservices5/, so I’m keeping it disabled for now.

I built separate packages for testing I may push to unstable here soon.

manjaro-settings-manager-qt6
manjaro-settings-manager-kstatus-notifier
manjaro-settings-manager-notifier-qt6

1 Like

Ah, good spot. Looks like the .desktop files need modifying - Service menu plasma 6 - #12 by set - Help - KDE Discuss . Let me see

It appears KCM desktop files should go in usr/share/applications/ with a kcm_ prefix for the filename from what I can tell from other Plasma 6 packages.

EDIT: Initial Merge Request created as a draft:

https://gitlab.manjaro.org/applications/manjaro-settings-manager/-/merge_requests/153

1 Like

OK, I just pushed 43e192cbd6c2213a6a7a64d3a803f074884cffe8, which fixes the .desktop file location (but leaves them prefixed msm_ rather than kcm_ - I’m not certain about that one yet). It also does s/kcmshell5/kcmshell6/

The issue was the SERVICES_INSTALL_DIR variable, which was coming from KDEInstallDirs in ECM, which is actually KDEInstallDirs5. For whatever reason, you can’t use KDEInstallDirs6 without qt5 installed, but we can just use KDE_INSTALL_APPDIR instead.

I think KDEInstallDirs6 was specifically intended to only be used as a transitional variable for qt5 compatibility, with the expectation that qt5 would become phased out, and that as such KDE_INSTALL_APPDIR would be the only used variable from there on.

There was a similar analogy with regard to the qt6-based KDE packages. Initially they all had the 6 suffix added so as to distinguish them from those using qt5. Then, the qt5-based stuff was renamed with a 5 suffix, and then at a yet later stage, the 6 suffix was dropped from the qt6-based packages. :backhand_index_pointing_down:

  1. packagename = qt5
    packagename6 = qt6
    :fast_down_button:
  2. packagename5 = qt5
    packagename6 = qt6
    :fast_down_button:
  3. packagename5 = qt5
    packagename = qt6
2 Likes

…only installed one desktop file for the KCM module:

.
└── usr
    ├── lib
    └── share
        └── systemsettings
            └── categories
                └── manjaro-category.desktop

6 directories, 1 file

Am I missing something in the manjaro-settings-manager-kcm-qt6 package function? Is there a cmake_install.cmake to use for it like the notifier packages?

Current PKGBUILD since GitLab is having issues:

pkgbase=manjaro-settings-manager
pkgname=(
  'manjaro-settings-manager-qt6'
  'manjaro-settings-manager-kcm-qt6'
  'manjaro-settings-manager-notifier-qt6'
  'manjaro-settings-manager-kstatus-notifier'
)
pkgver=0.6.0
pkgrel=1
pkgdesc="Manjaro Linux System Settings Tool"
arch=('x86_64')
url="https://gitlab.manjaro.org/applications/manjaro-settings-manager"
license=('GPL-3.0-or-later')
depends=(
  'ckbcomp'
  'hicolor-icon-theme'
  'hwinfo'
  'icu'
  'kauth'
  'kcoreaddons'
  'kitemmodels'
  'qt6-base'
  'xdg-utils'
)
makedepends=(
  'extra-cmake-modules'
  'git'
  'kcmutils'
  'kconfigwidgets'
  'kdoctools'
  'kstatusnotifieritem'
  'qt6-tools'
)
checkdepends=(
  'appstream'
  'desktop-file-utils'
)
_commit=43e192cbd6c2213a6a7a64d3a803f074884cffe8  # branch/qt6
source=("git+https://gitlab.manjaro.org/applications/manjaro-settings-manager.git#commit=${_commit}")
sha256sums=('94530e3fdb4d1160eb70d13ad86c474766ea71eaf1d51a25e10ae08e0bd55b16')

prepare() {
  cd "$pkgbase"

  # Bump PROJECT_VERSION
  sed -i "s/0.5.8/$pkgver/g" CMakeLists.txt
}

build() {
  export CFLAGS+=" -ffat-lto-objects"
  export CXXFLAGS+=" -ffat-lto-objects"

  local cmake_options=(
    -B build
    -S "$pkgbase"
    -D CMAKE_BUILD_TYPE='RelWithDebInfo'
    -D CMAKE_INSTALL_PREFIX='/usr'
  )
  cmake "${cmake_options[@]}"
  cmake --build build
}

check() {
  local ctest_flags=(
    --test-dir build
    --output-on-failure
    --parallel $(nproc)
  )
  ctest "${ctest_flags[@]}"

  cd "$pkgbase"
  desktop-file-validate "src/msm/$pkgbase.desktop"
  desktop-file-validate src/notifier/notifier/msm_notifier_settings.desktop
  desktop-file-validate src/notifier/notifier_kde/msm_kde_notifier_settings.desktop
}

package_manjaro-settings-manager-qt6() {
  optdepends=(
    'manjaro-settings-manager-notifier-qt6: Qt based'
    'manjaro-settings-manager-kstatus: KStatusNotifierItem based'
  )
  provides=('manjaro-settings-manager')
  conflicts=(
    'kcm-msm'
    'manjaro-settings-manager'
  )

  DESTDIR="$pkgdir" cmake --install build

  rm -f "$pkgdir"/usr/bin/msm_notifier
  rm -f "$pkgdir"/usr/bin/msm_kde_notifier
  rm -rf "$pkgdir"/usr/lib/qt/
  rm -rf "$pkgdir"/usr/share/systemsettings/
  rm -f "$pkgdir"/usr/share/applications/msm_notifier_settings.desktop
  rm -f "$pkgdir"/usr/share/applications/msm_kde_notifier_settings.desktop
  rm -rf "$pkgdir"/etc/
}

package_manjaro-settings-manager-kcm-qt6() {
  pkgdesc+=" (KCM for Plasma 6)"
  depends=(
    'kcmutils'
    'kconfigwidgets'
    'manjaro-settings-manager-qt6'
  )
  provides=('manjaro-settings-manager-kcm')
  conflicts=('manjaro-settings-manager-kcm')
  replaces=('kcm-msm')

  DESTDIR="$pkgdir" cmake --install build

  rm -rf "$pkgdir"/etc/
  rm -rf "$pkgdir"/usr/bin/
  rm -rf "$pkgdir"/usr/lib/{kf6,plugins}/
  rm -rf "$pkgdir"/usr/share/{applications,dbus-1,icons,polkit-1}/
}

package_manjaro-settings-manager-notifier-qt6() {
  pkgdesc+=" (Notifier)"
  depends=('manjaro-settings-manager-qt6')
  provides=(
    'manjaro-settings-manager-kde-notifier'
    'manjaro-settings-manager-notifier'
  )
  conflicts=(
    'manjaro-settings-manager-kde-notifier'
    'manjaro-settings-manager-notifier'
  )

  DESTDIR="$pkgdir" cmake --install build/src/notifier/notifier
}

package_manjaro-settings-manager-kstatus-notifier() {
  pkgdesc+=" (KStatus Notifier for Plasma 6)"
  depends=(
    'kstatusnotifieritem'
    'manjaro-settings-manager-qt6'
  )
  conflicts=(
    'manjaro-settings-manager-notifier'
    'manjaro-settings-manager-knotifier'
  )
  replaces=(
    'manjaro-settings-manager-kde-notifier'
    'manjaro-settings-manager-knotifier'
  )

  DESTDIR="$pkgdir" cmake --install build/src/notifier/notifier_kde
}

You’re explicitly removing them down in line 115 of that PKGBUILD, right?

If I run DESTDIR="$(pwd)/install" cmake --install build; tree install, I get:

install
├── etc
│   └── xdg
│       └── autostart
│           ├── msm_kde_notifier.desktop
│           └── msm_notifier.desktop
└── usr
    ├── bin
    │   ├── manjaro-settings-manager
    │   ├── msm_kde_notifier
    │   └── msm_notifier
    ├── lib
    │   ├── kf6
    │   │   └── kauth
    │   │       ├── msm_kernel_authhelper
    │   │       ├── msm_keyboard_authhelper
    │   │       ├── msm_language_packages_authhelper
    │   │       ├── msm_locale_authhelper
    │   │       ├── msm_mhwd_authhelper
    │   │       └── msm_users_authhelper
    │   └── plugins
    │       ├── msm_kernel.so
    │       ├── msm_language_packages.so
    │       └── msm_mhwd.so
    └── share
        ├── applications
        │   ├── manjaro-settings-manager.desktop
        │   ├── msm_kde_notifier_settings.desktop
        │   ├── msm_kernel.desktop
        │   ├── msm_language_packages.desktop
        │   ├── msm_mhwd.desktop
        │   └── msm_notifier_settings.desktop
        ├── dbus-1
        │   ├── system.d
        │   │   ├── org.manjaro.msm.kernel.conf
        │   │   ├── org.manjaro.msm.keyboard.conf
        │   │   ├── org.manjaro.msm.languagepackages.conf
        │   │   ├── org.manjaro.msm.locale.conf
        │   │   ├── org.manjaro.msm.mhwd.conf
        │   │   └── org.manjaro.msm.users.conf
        │   └── system-services
        │       ├── org.manjaro.msm.kernel.service
        │       ├── org.manjaro.msm.keyboard.service
        │       ├── org.manjaro.msm.languagepackages.service
        │       ├── org.manjaro.msm.locale.service
        │       ├── org.manjaro.msm.mhwd.service
        │       └── org.manjaro.msm.users.service
        ├── icons
        │   └── hicolor
        │       └── scalable
        │           └── apps
        │               └── manjaro-settings-manager.svg
        ├── polkit-1
        │   └── actions
        │       ├── org.manjaro.msm.kernel.policy
        │       ├── org.manjaro.msm.keyboard.policy
        │       ├── org.manjaro.msm.languagepackages.policy
        │       ├── org.manjaro.msm.locale.policy
        │       ├── org.manjaro.msm.mhwd.policy
        │       └── org.manjaro.msm.users.policy
        └── systemsettings
            └── categories
                └── manjaro-category.desktop

I guess the various rm commands in the PKGBUILDs are for divvying up the output into different packages, and just need adjusting?

Oh, whoops. Honestly I have no idea what files are even part of the KCM module–especially with the Plasma 6 changes. We haven’t packaged it for a long time. @LordTermor used to help me out, but he’s not very active at the moment.

diff --git a/PKGBUILD b/PKGBUILD
index eb94bdc..05a2bd8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -115,7 +115,8 @@ package_manjaro-settings-manager-kcm-qt6() {
   rm -rf "$pkgdir"/etc/
   rm -rf "$pkgdir"/usr/bin/
   rm -rf "$pkgdir"/usr/lib/{kf6,plugins}/
-  rm -rf "$pkgdir"/usr/share/{applications,dbus-1,icons,polkit-1}/
+  rm -f "$pkgdir"/usr/share/applications/{"$pkgbase",msm_notifier_settings,msm_kde_notifier_settings}.desktop
+  rm -rf "$pkgdir"/usr/share/{dbus-1,icons,polkit-1}/
 }
 
 package_manjaro-settings-manager-notifier-qt6() {

Now we have:

.
└── usr
    ├── lib
    └── share
        ├── applications
        │   ├── msm_kernel.desktop
        │   ├── msm_language_packages.desktop
        │   └── msm_mhwd.desktop
        └── systemsettings
            └── categories
                └── manjaro-category.desktop

7 directories, 4 files
1 Like

What actually is the KCM module? Where is it?

EDIT: Apparently these are them:

They should be installed in /usr/lib/qt6/plugins/, maybe?

KDE_INSTALL_USE_QT_SYS_PATHS='ON' fails, so not sure if that’s required.

Previously, the three .desktop files were in /usr/lib/kservices5/, and not included in the manjaro-settings-manager package: https://gitlab.manjaro.org/packages/extra/manjaro-settings-manager/-/blob/master/PKGBUILD?ref_type=heads#L87. I guess they need to be removed from there in the same way msm_notifier_settings.desktop and msm_kde_notifier_settings.desktop are being removed, to leave just the manjaro-settings-manager.desktop in manjaro-settings-manager-qt6?

Poking at it… I’m a gnome user and not very familiar with KDE, but I think the KCMs themselves are the .so files in /usr/lib/plugins, and they want to be placed only in manjaro-settings-manager-kcm-qt6 as well? I don’t know about /usr/lib/qt6/plugins/ vs /usr/lib/plugins/. We’re installing to PLUGIN_INSTALL_DIR.

The point of them as far as I can see is that they can be shown in the plasma kde settings dialogue and via kcmshell6… if they work as expected. It would be nice for KDE users if we got it working, but equally, I don’t think there’d be any shame in continuing to not build the -kcm package :sweat_smile: . The functionality is still accessible via manjaro-settings-manager.