wallpaper-engine-kde-plugin icon indicating copy to clipboard operation
wallpaper-engine-kde-plugin copied to clipboard

Migrate to KDE Plasma 6

Open fxzjshm opened this issue 6 months ago • 32 comments

Initial attempts to port to KDE Plasma 6 + Qt 6, but changes in QML files currently break Plasma 5.

Uses CMake flag -D QT_MAJOR_VERSION=6 to build for Plasma 6, like

cmake ~/workspace/wallpaper-engine-kde-plugin -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=OFF

TODO:

  • ~~Plugin not showing up in settings, but can be loaded if Plasma 6 loads config of Plasma 5.~~ Migrated.
  • Mouse position is ~~broken~~ unusable with "Folder view" layout because unknown layer covering on desktop; works with "Desktop" layout & in standalone viewer.
  • ~~Some hacks are used, marked with "TODO" in code.~~

Related: #339

I'm new to Qt and KDE so can only fix simplest things like API changes; more experienced developer may needed.

fxzjshm avatar Dec 10 '23 16:12 fxzjshm

C++ part should be compatible with Qt 5 and 6 now, but didn't find how to make QML code compatible with both. So this PR may serve as a separate branch with KDE Plasma 6 support, and anyone interested in this can build and test it.

fxzjshm avatar Dec 29 '23 05:12 fxzjshm

It fails to install via install_pkg and works with very few backgrounds, mine of which seems to be broken even though its just an image with basic shaders

Kaydax avatar Jan 21 '24 07:01 Kaydax

@Kaydax The scene you mentioned seems to work on my side. Please provide more detail, e.g. error log & behavior of the program.

fxzjshm avatar Jan 21 '24 08:01 fxzjshm

@Kaydax The scene you mentioned seems to work on my side. Please provide more detail, e.g. error log & behavior of the program.

No error log, just shows a blank white screen as the background when the scene is loaded. I also have issues with selecting the steam folder to even select themes in the first place so I think something is just very wrong on my end or something is not compiling right.

Here is my system info: image

Kaydax avatar Jan 21 '24 08:01 Kaydax

Ok I wonder if it has something to do with QT paths trying to use QT 5 instead of 6, im going to retest this now once I set qt6 as my main qt

Kaydax avatar Jan 21 '24 08:01 Kaydax

Here is one error im getting when running make install_pkg:

kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
Package type "Plasma/Wallpaper" not found
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
kf.package: Cannot set a path in a package without structure "/home/kaydax/Projects/Linux/wallpaper-engine-kde-plugin/plugin"
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
Error: Plugin com.github.casout.wallpaperEngineKde is not installed.
make[3]: *** [CMakeFiles/install_pkg.dir/build.make:70: CMakeFiles/install_pkg] Error 2
make[2]: *** [CMakeFiles/Makefile2:667: CMakeFiles/install_pkg.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:674: CMakeFiles/install_pkg.dir/rule] Error 2
make: *** [Makefile:221: install_pkg] Error 2

Kaydax avatar Jan 21 '24 08:01 Kaydax

Ok so found one issue. My scene works only if its downloaded from the workshop, but if its using the raw source files of the wallpaper engine project, it refuses to work. This has never been an issue up until now

Kaydax avatar Jan 21 '24 08:01 Kaydax

Here is one error im getting when running make install_pkg:

kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
Package type "Plasma/Wallpaper" not found
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
kf.package: Cannot set a path in a package without structure "/home/kaydax/Projects/Linux/wallpaper-engine-kde-plugin/plugin"
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
Error: Plugin com.github.casout.wallpaperEngineKde is not installed.
make[3]: *** [CMakeFiles/install_pkg.dir/build.make:70: CMakeFiles/install_pkg] Error 2
make[2]: *** [CMakeFiles/Makefile2:667: CMakeFiles/install_pkg.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:674: CMakeFiles/install_pkg.dir/rule] Error 2
make: *** [Makefile:221: install_pkg] Error 2

Same as you, here is Archlinux updated.

kamikaze211 avatar Feb 04 '24 02:02 kamikaze211

@Kaydax @kamikaze211 I've edited the comment above and added my configure command, could you try that? I've seen this log from install_pkg when forget to add -DQT_MAJOR_VERSION=6 then CMake try to find KF5 (but it does not recognize the format). I didn't made QT_MAJOR_VERSION=6 default because I wanted to make it compatible with both Qt 5 and 6, but sadly failed.

fxzjshm avatar Feb 04 '24 02:02 fxzjshm

@Kaydax @kamikaze211 I've edited the comment above and added my configure command, could you try that? I've seen this log from install_pkg when forget to add -DQT_MAJOR_VERSION=6 then CMake try to find KF5 (but it does not recognize the format). I didn't made QT_MAJOR_VERSION=6 default because I wanted to make it compatible with both Qt 5 and 6, but sadly failed.

Sorry, maybe it is my problem. I'm not a developer, and also have no programming skill.

Here is what I did in my terminal:

cd git
git clone https://github.com/fxzjshm/wallpaper-engine-kde-plugin
cd wallpaper-engine-kde-plugin/
git submodule update --init
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=ON
make -j$nproc
make install_pkg

And I got the error message. I think maybe I made a mistake in the line : git clone But sorry, I really don't know what should I do.

kamikaze211 avatar Feb 04 '24 04:02 kamikaze211

Oh, my fault, forget to set default branch of forked repository to this. Have changed to qt6 branch now. For current situation, please checkout the qt6 branch, i.e.

git fetch && git checkout qt6

inside wallpaper-engine-kde-plugin/

fxzjshm avatar Feb 04 '24 04:02 fxzjshm

Oh, my fault, forget to set default branch of forked repository to this. Have changed to qt6 branch now. For current situation, please checkout the qt6 branch, i.e.

git fetch && git checkout qt6

inside wallpaper-engine-kde-plugin/

I tried it again. Here is what I did in my terminal:

cd ~/git/
git clone https://github.com/fxzjshm/wallpaper-engine-kde-plugin
cd wallpaper-engine-kde-plugin/
git fetch && git checkout qt6
git submodule update --init
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=ON
make -j$nproc
make install_pkg

And I still got this error:

kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
Package type "Plasma/Wallpaper" not found
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
kf.package: Cannot set a path in a package without structure "/home/ice/git/wallpaper-engine-kde-plugin/plugin"
kf.package: Invalid metadata for package structure "Plasma/Wallpaper"
错误:插件 com.github.casout.wallpaperEngineKde not installed。
make[3]: *** [CMakeFiles/install_pkg.dir/build.make:70:CMakeFiles/install_pkg] error 2
make[2]: *** [CMakeFiles/Makefile2:667:CMakeFiles/install_pkg.dir/all] error 2
make[1]: *** [CMakeFiles/Makefile2:674:CMakeFiles/install_pkg.dir/rule] error 2
make: *** [Makefile:221:install_pkg] erroe 2

Is there any mistake did I make?

kamikaze211 avatar Feb 04 '24 04:02 kamikaze211

Weird. Could you please post system information and CMake configure log? Especially lines like

-- Found KF6Package: /usr/lib/cmake/KF6Package/KF6PackageConfig.cmake (found version "5.249.0") 
-- Found KF6: success (found suitable version "5.249.0", minimum required is "5.68.0") found components: Package

KF6 version should be 5.245.0 or later. I suspect it still uses Plasma 5 somehow.

I've made a fresh install of Arch Linux in VM, enabled kde-unstable repository, installed plasma-meta, plasma-framework5, and unfortunately cannot reproduce your problem...

fxzjshm avatar Feb 04 '24 08:02 fxzjshm

Weird. Could you please post system information and CMake configure log? Especially lines like

-- Found KF6Package: /usr/lib/cmake/KF6Package/KF6PackageConfig.cmake (found version "5.249.0") 
-- Found KF6: success (found suitable version "5.249.0", minimum required is "5.68.0") found components: Package

KF6 version should be 5.245.0 or later. I suspect it still uses Plasma 5 somehow.

I've made a fresh install of Arch Linux in VM, enabled kde-unstable repository, installed plasma-meta, plasma-framework5, and unfortunately cannot reproduce your problem...

Very sorry to waste a lot of your time. I don't know how to post system info. I think maybe it is because that I installed plasma5 before I upgrade to plasma6. Here is the packages about kf6:

pacman -Qs kf6 | grep kf6
local/attica 5.249.0-1 (kf6)
local/baloo 5.249.0-1 (kf6)
local/bluez-qt 5.249.0-1 (kf6)
local/breeze-icons 5.249.0-1 (kf6)
local/extra-cmake-modules 5.249.0-1 (kf6)
local/frameworkintegration 5.249.0-1 (kf6)
local/karchive 5.249.0-1 (kf6)
local/kauth 5.249.0-1 (kf6)
local/kbookmarks 5.249.0-1 (kf6)
local/kcmutils 5.249.0-1 (kf6)
local/kcodecs 5.249.0-1 (kf6)
local/kcolorscheme 5.249.0-1 (kf6)
local/kcompletion 5.249.0-1 (kf6)
local/kconfig 5.249.0-1 (kf6)
local/kconfigwidgets 5.249.0-1 (kf6)
local/kcoreaddons 5.249.0-1 (kf6)
local/kcrash 5.249.0-1 (kf6)
local/kdav 1:5.249.0-1 (kf6)
local/kdbusaddons 5.249.0-1 (kf6)
local/kdeclarative 5.249.0-1 (kf6)
local/kded 5.249.0-1 (kf6)
local/kdesu 5.249.0-1 (kf6)
local/kdnssd 5.249.0-1 (kf6)
local/kdoctools 5.249.0-1 (kf6)
local/kfilemetadata 5.249.0-1 (kf6)
local/kglobalaccel 5.249.0-1 (kf6)
local/kguiaddons 5.249.0-1 (kf6)
local/kholidays 1:5.249.0-1 (kf6)
local/ki18n 5.249.0-1 (kf6)
local/kiconthemes 5.249.0-1 (kf6)
local/kidletime 5.249.0-1 (kf6)
local/kio 5.249.0-1 (kf6)
local/kirigami 5.249.0-1 (kf6)
local/kitemmodels 5.249.0-1 (kf6)
local/kitemviews 5.249.0-1 (kf6)
local/kjobwidgets 5.249.0-1 (kf6)
local/knewstuff 5.249.0-1 (kf6)
local/knotifications 5.249.0-1 (kf6)
local/knotifyconfig 5.249.0-1 (kf6)
local/kpackage 5.249.0-1 (kf6)
local/kparts 5.249.0-1 (kf6)
local/kpeople 5.249.0-1 (kf6)
local/kplotting 5.249.0-1 (kf6)
local/kpty 5.249.0-1 (kf6)
local/kquickcharts 5.249.0-1 (kf6)
local/krunner 5.249.0-1 (kf6)
local/kservice 5.249.0-1 (kf6)
local/kstatusnotifieritem 5.249.0-1 (kf6)
local/ksvg 5.249.0-1 (kf6)
local/ktexteditor 5.249.0-1 (kf6)
local/ktexttemplate 5.249.0-1 (kf6)
local/ktextwidgets 5.249.0-1 (kf6)
local/kunitconversion 5.249.0-1 (kf6)
local/kwallet 5.249.0-1 (kf6)
local/kwidgetsaddons 5.249.0-1 (kf6)
local/kwindowsystem 5.249.0-1 (kf6)
local/kxmlgui 5.249.0-1 (kf6)
local/modemmanager-qt 5.249.0-1 (kf6)
local/networkmanager-qt 5.249.0-1 (kf6)
local/prison 5.249.0-1 (kf6)
local/purpose 5.249.0-2 (kf6)
local/qqc2-desktop-style 5.249.0-1 (kf6)
local/solid 5.249.0-1 (kf6)
local/sonnet 5.249.0-1 (kf6)
local/syndication 5.249.0-1 (kf6)
local/syntax-highlighting 5.249.0-1 (kf6)
local/threadweaver 5.249.0-1 (kf6)

Here is some packages about kf6 that is not on version 5.249:

pacman -Qs kf6 | grep -i kf6 | grep -v "249"
local/plasma5support 5.93.0-1 (plasma)
    Support components for porting from KF5/Qt5 to KF6/Qt6

Also I tried to find the packages about kf5:

paru -Qs kf5 | grep kf5
local/attica5 5.114.0-1 (kf5)
local/kactivities5 5.114.0-1 (kf5)
local/karchive5 5.114.0-1 (kf5)
local/kauth5 5.114.0-1 (kf5)
local/kbookmarks5 5.114.0-1 (kf5)
local/kcmutils5 5.114.0-1 (kf5)
local/kcodecs5 5.114.0-1 (kf5)
local/kcompletion5 5.114.0-1 (kf5)
local/kconfig5 5.114.0-1 (kf5)
local/kconfigwidgets5 5.114.0-1 (kf5)
local/kcoreaddons5 5.114.0-1 (kf5)
local/kcrash5 5.114.0-1 (kf5)
local/kdbusaddons5 5.114.0-1 (kf5)
local/kdeclarative5 5.114.0-1 (kf5)
local/kdelibs4support 5.114.0-1 (kf5-aids)
local/kdnssd5 5.114.0-1 (kf5)
local/kemoticons 5.114.0-1 (kf5)
local/kfilemetadata5 5.114.0-2 (kf5)
local/kglobalaccel5 5.114.0-2 (kf5)
local/kguiaddons5 5.114.0-1 (kf5)
local/khtml 5.114.0-1 (kf5-aids)
local/ki18n5 5.114.0-1 (kf5)
local/kiconthemes5 5.114.0-1 (kf5)
local/kio5 5.114.0-2 (kf5)
local/kirigami2 5.114.0-1 (kf5)
local/kitemmodels5 5.114.0-1 (kf5)
local/kitemviews5 5.114.0-1 (kf5)
local/kjobwidgets5 5.114.0-1 (kf5)
local/kjs 5.114.0-1 (kf5-aids)
local/knewstuff5 5.114.0-1 (kf5)
local/knotifications5 5.114.0-1 (kf5)
local/knotifyconfig5 5.114.0-1 (kf5)
local/kpackage5 5.114.0-1 (kf5)
local/kparts5 5.114.0-1 (kf5)
local/kplotting5 5.114.0-1 (kf5)
local/kpty5 5.114.0-1 (kf5)
local/kservice5 5.114.0-1 (kf5)
local/ktexteditor5 5.114.0-1 (kf5)
local/ktextwidgets5 5.114.0-1 (kf5)
local/kunitconversion5 5.114.0-1 (kf5)
local/kwallet5 5.114.0-1 (kf5)
local/kwayland5 5.114.0-1 (kf5)
local/kwidgetsaddons5 5.114.0-1 (kf5)
local/kwindowsystem5 5.114.0-1 (kf5)
local/kxmlgui5 5.114.0-1 (kf5)
local/plasma-framework5 5.114.0-2 (kf5)
local/purpose5 5.114.0-2 (kf5)
local/solid5 5.114.0-1 (kf5)
local/sonnet5 5.114.0-1 (kf5)
local/syndication5 5.114.0-1 (kf5)
local/syntax-highlighting5 5.114.0-1 (kf5)
local/threadweaver5 5.114.0-1 (kf5)

So should I uninstall kf5 packages?

kamikaze211 avatar Feb 04 '24 08:02 kamikaze211

Weird. Could you please post system information and CMake configure log? Especially lines like

-- Found KF6Package: /usr/lib/cmake/KF6Package/KF6PackageConfig.cmake (found version "5.249.0") 
-- Found KF6: success (found suitable version "5.249.0", minimum required is "5.68.0") found components: Package

KF6 version should be 5.245.0 or later. I suspect it still uses Plasma 5 somehow.

I've made a fresh install of Arch Linux in VM, enabled kde-unstable repository, installed plasma-meta, plasma-framework5, and unfortunately cannot reproduce your problem...

I checked the printout message when I execute the command : cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=ON

❯ cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=ON
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- 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
-- Installing in the same prefix as Qt, adopting their path scheme.
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Found KF6Package: /usr/lib/cmake/KF6Package/KF6PackageConfig.cmake (found version "5.249.0") 
-- Found KF6: success (found suitable version "5.249.0", minimum required is "5.68.0") found components: Package 
-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.6.0", minimum required is "0.5.0") 
-- Found WrapVulkanHeaders: /usr/include  
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- QT_MAJOR_VERSION = 6
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.0") 
-- Checking for module 'mpv'
--   Found mpv, version 2.2.0
CMake Deprecation Warning at src/backend_scene/third_party/glslang/CMakeLists.txt:36 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at src/backend_scene/third_party/glslang/CMakeLists.txt:247 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  src/backend_scene/third_party/glslang/CMakeLists.txt:311 (find_host_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.11.7", minimum required is "3") 
-- Google Mock was not found - tests based on that will not build
-- spirv-tools not linked - illegal SPIRV may be generated for HLSL
-- Found Threads: TRUE  
-- Checking for module 'liblz4'
--   Found liblz4, version 1.9.4
-- Found Vulkan: /lib/libvulkan.so (found version "1.3.276") found components: glslc glslangValidator 
-- Configuring done (1.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ice/git/wallpaper-engine-kde-plugin/build

It contains the 2 lines:

-- Found KF6Package: /usr/lib/cmake/KF6Package/KF6PackageConfig.cmake (found version "5.249.0") 
-- Found KF6: success (found suitable version "5.249.0", minimum required is "5.68.0") found components: Package

But also has some warning message:

CMake Warning (dev) at src/backend_scene/third_party/glslang/CMakeLists.txt:247 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  src/backend_scene/third_party/glslang/CMakeLists.txt:311 (find_host_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

kamikaze211 avatar Feb 04 '24 09:02 kamikaze211

@kamikaze211 Reproduced by uninstalling Plasma 6, install Plasma 5, then upgrade to Plasma 6. Have done some digging but still no idea why...

Noticed that plasmapkg2 is now a wrapper of kpackagetool5 ^1, consider

kpackagetool6 -i plugin/ || kpackagetool6 -u plugin/

for installing and upgrading; or if still not working, maybe just -DUSE_PLASMAPKG=OFF.

fxzjshm avatar Feb 04 '24 12:02 fxzjshm

@fxzjshm Thank you very much, I tried to rebuild with your suggestion:

❯ pwd
/home/ice/git/wallpaper-engine-kde-plugin/build
❯ kpackagetool6 -i ../plugin/
installation succeed /home/ice/.local/share/kpackage/generic/com.github.casout.wallpaperEngineKde/
❯ sudo make install
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/libWallpaperEngineKde.so
-- Installing: /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/qmldir
❯  systemctl --user restart plasma-plasmashell.service

But after I restart plasma service, I still cannot find the wallpaper-engine-kde-plugin in desktop/wallpaper settings. Maybe I need to find a way to completely uninstall plasma 5 (and all the packages related to plasma 5). Anyway, thank you for helping me so much.

kamikaze211 avatar Feb 04 '24 12:02 kamikaze211

After some researching, I tried to remove something, and rebuild everything, and now it works.

#remove everything that had been existed.
rm -rf ~/.local/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde
rm -rf ~/.local/share/kpackage/generic/com.github.casout.wallpaperEngineKde/
sudo rm -rf /usr/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
sudo rm -f /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/libWallpaperEngineKde.so
sudo rm -rf /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/qmldir

#build from source
cd ~ && mkdir git && cd ~/git
git clone https://github.com/fxzjshm/wallpaper-engine-kde-plugin
cd wallpaper-engine-kde-plugin/
git fetch && git checkout qt6
git submodule update --init
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=OFF
make -j$nproc
kpackagetool6 -i ../plugin/
sudo make install
systemctl --user restart plasma-plasmashell.service

After all of this, I can use this plugin on Plasma 6 RC2 now.

Also, if you need scene wallpaper support, just run this:

cd ~/git/wallpaper-engine-kde-plugin
cd src/backend_scene/standalone_view
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_QML=ON -DQT_MAJOR_VERSION=6
make -j$nproc

#check if it works
./sceneviewer --help

kamikaze211 avatar Feb 11 '24 14:02 kamikaze211

After some researching, I tried to remove something, and rebuild everything, and now it works.

#remove everything that had been existed.
rm -r ~/.local/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde
rm -r ~/.local/share/kpackage/generic/com.github.casout.wallpaperEngineKde/
rm -r /usr/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
sudo rm /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/libWallpaperEngineKde.so
sudo rm -r /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/qmldir

#build from source
cd ~ && mkdir git && cd ~/git
git clone https://github.com/fxzjshm/wallpaper-engine-kde-plugin
cd wallpaper-engine-kde-plugin/
git fetch && git checkout qt6
git submodule update --init
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=OFF
make -j$nproc
kpackagetool6 -i ../plugin/
sudo make install
systemctl --user restart plasma-plasmashell.service

After all of this, I can use this plugin on Plasma 6 RC2 now.

Also, if you need scene wallpaper support, just run this:

cd ~/git/wallpaper-engine-kde-plugin
cd src/backend_scene/standalone_view
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_QML=ON -DQT_MAJOR_VERSION=6
make -j$nproc

#check if it works
./sceneviewer --help

wow, this worked for me too, even after I thought I tried this before, I must have missed something when deleting, thank you for sharing your steps to solve it

Jelgnum avatar Feb 11 '24 21:02 Jelgnum

Here's an amateur bash script using the commands you provided. I prefer to keep my git projects in a ~/.gtclone folder.

#!/bin/bash
#remove everything that had been existed.
rm -r ~/.local/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde
rm -r ~/.local/share/kpackage/generic/com.github.casout.wallpaperEngineKde/
sudo rm -r /usr/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
sudo rm /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/libWallpaperEngineKde.so
sudo rm -r /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/qmldir

#build from source
mkdir -p ~/.gtclone
cd ~/.gtclone
git clone https://github.com/fxzjshm/wallpaper-engine-kde-plugin ; cd wallpaper-engine-kde-plugin/
git fetch && git checkout qt6 && git submodule update --init
mkdir -p build ; cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DUSE_PLASMAPKG=ON && make -j$nproc && kpackagetool6 -i ../plugin/ && sudo make install && systemctl --user restart plasma-plasmashell.service

I'm getting a build error for mpv, I'm running openSUSE Tumbleweed with the unstable kde repos enabled. This is the relevant cmake error. I do have mpv-devel installed.

Your branch is up to date with 'origin/qt6'.
-- QT_MAJOR_VERSION = 6
CMake Deprecation Warning at src/backend_scene/third_party/glslang/CMakeLists.txt:36 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at src/backend_scene/third_party/glslang/CMakeLists.txt:247 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  src/backend_scene/third_party/glslang/CMakeLists.txt:311 (find_host_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Google Mock was not found - tests based on that will not build
-- spirv-tools not linked - illegal SPIRV may be generated for HLSL
-- Configuring done (0.3s)
-- Generating done (0.1s)
-- Build files have been written to: /home/domglusk/.gtclone/wallpaper-engine-kde-plugin/build
[  0%] Built target mpvbackend_autogen_timestamp_deps
[  2%] Built target OSDependent
[  3%] Built target HLSL
[  5%] Built target spirv-reflect
[  7%] Built target GenericCodeGen
[  9%] Built target glad
[ 10%] Built target OGLCompiler
[ 14%] Built target wpUtils
[ 14%] Built target mpvbackend_autogen
[ 17%] Built target wpTimer
[ 18%] Built target wpAudio
[ 22%] Built target wpRGraph
[ 23%] Built target wpLooper
[ 48%] Built target MachineIndependent
[ 51%] Built target wpParticle
[ 54%] Built target mpvbackend
[ 55%] Built target glslang
[ 62%] Built target SPIRV
[ 67%] Built target wpScene
[ 75%] Built target wpVulkan
[ 80%] Built target wpVulkanRender
[ 92%] Built target wescene-renderer
[ 92%] Built target wescene-renderer-qml_autogen_timestamp_deps
[ 93%] Built target wescene-renderer-qml_autogen
[ 96%] Built target wescene-renderer-qml
[ 96%] Built target WallpaperEngineKde_autogen_timestamp_deps
[ 96%] Built target WallpaperEngineKde_autogen
[ 97%] Linking CXX shared library libWallpaperEngineKde.so
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: backend_mpv/libmpvbackend.a(MpvBackend.cpp.o): warning: relocation against `_ZN7QString6_emptyE@@Qt_6' in read-only section `.text'
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: backend_mpv/libmpvbackend.a(MpvBackend.cpp.o): relocation R_X86_64_PC32 against symbol `__libc_single_threaded@@GLIBC_2.32' cannot be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/WallpaperEngineKde.dir/build.make:183: src/libWallpaperEngineKde.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:713: src/CMakeFiles/WallpaperEngineKde.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

domglusk avatar Feb 12 '24 00:02 domglusk

@domglusk

I'm getting a build error for mpv, I'm running openSUSE Tumbleweed with the unstable kde repos enabled. This is the relevant cmake error. I do have mpv-devel installed.

Reproduced on a fresh install of openSUSE Tumbleweed, but with a different error log:

[ 97%] Linking CXX shared library libWallpaperEngineKde.so
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: backend_mpv/libmpvbackend.a(mocs_compilation.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZN3mpv9MpvObject16staticMetaObjectE' can not be used when making a shared object
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

and not reproduced if compile with Clang ~~, so likely not a bug on our side.~~

fxzjshm avatar Feb 13 '24 00:02 fxzjshm

and not reproduced if compile with Clang, so likely not a bug on our side. How do I compile it with clang instead?

domglusk avatar Feb 13 '24 01:02 domglusk

How do I compile it with clang instead?

Add flags -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ when running CMake.

Alternatively, as the error log indicates, enabling position-independent code on all targets (-DCMAKE_POSITION_INDEPENDENT_CODE=ON) also works. Will update CMake code.

fxzjshm avatar Feb 13 '24 01:02 fxzjshm

I found a problem that: scene wallpapers can't scroll on Y axis. I'm sure this is OK on plasma 5. Example: https://steamcommunity.com/sharedfiles/filedetails/?id=3078111134

Sorry I didn't see the TODO list.

Finally, I had successfully made a desktop file to help me to open scene.pkg file

first you need to compile the sceneviewer

do as this : https://github.com/catsout/wallpaper-engine-kde-plugin/pull/344#issuecomment-1937767165

create a desktop file

touch ~/.local/share/applications/open_with_sceneviewer.desktop

edit the desktop file

kate ~/.local/share/applications/open_with_sceneviewer.desktop

copy & patse the contents below into it and save

[Desktop Entry]
Name=open_with_sceneviewer
Actions=open_with_sceneviewer
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
X-KDE-Priority=TopLevel
Exec=~/git/wallpaper-engine-kde-plugin/src/backend_scene/standalone_view/build/sceneviewer-qml -f 165 -R 3440x1440 ~/mnt/Recovery/SteamLibrary/steamapps/common/wallpaper_engine/assets/ %F

notice that:

this is just en example you should first compile sceneviewer you need to edit the path as your owns and any other parameters (such as -f -R)

restart dolphin, and select scene.pkg file with right click, then choose open with ...

search & select the open_with_sceneviewer option, then you will get a window show the scene wallpaper

optional:

you can use the plugin to conveniently open the folders where the scene.pkg file is you can open several scene.pkg files, and drop the scene wallpaper windows into a group you can use kwin window rules to make the scene wallpaper window be full-screen as default you can use a virtual desktop, and make all these windows only shown in specify desktop

kamikaze211 avatar Feb 13 '24 08:02 kamikaze211

How do I compile it with clang instead?

Add flags -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ when running CMake.

Alternatively, as the error log indicates, enabling position-independent code on all targets (-DCMAKE_POSITION_INDEPENDENT_CODE=ON) also works. Will update CMake code.

Your updating code makes it compile correctky and install, but it's not showing up as a wallpaper plugin option in the wallpaper settings.

domglusk avatar Feb 14 '24 02:02 domglusk

but it's not showing up as a wallpaper plugin option in the wallpaper settings.

That's strange, it shows up in my virtual machine. Try both -DUSE_PLASMAPKG=OFF and -DUSE_PLASMAPKG=ON with kpackagetool6 -i ../plugin/? I used -DUSE_PLASMAPKG=OFF in this virtual machine.

fxzjshm avatar Feb 14 '24 08:02 fxzjshm

How do I compile it with clang instead?

Add flags -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ when running CMake. Alternatively, as the error log indicates, enabling position-independent code on all targets (-DCMAKE_POSITION_INDEPENDENT_CODE=ON) also works. Will update CMake code.

Your updating code makes it compile correctky and install, but it's not showing up as a wallpaper plugin option in the wallpaper settings.

If you had tried to install before, then some files may be existed, make sure you had deleted them first.

rm -rf ~/.local/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde
rm -rf ~/.local/share/kpackage/generic/com.github.casout.wallpaperEngineKde/
sudo rm -rf /usr/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
sudo rm -f /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/libWallpaperEngineKde.so
sudo rm -rf /usr/lib/qt6/qml/com/github/catsout/wallpaperEngineKde/qmldir

Then use USE_PLASMAPKG=OFF for system-wide installation

From https://github.com/catsout/wallpaper-engine-kde-plugin/pull/344#issuecomment-1937767165

kamikaze211 avatar Feb 14 '24 11:02 kamikaze211

Has anyone else experience on QT6.7 (arch beta) the select library folder just does nothing?

Logical-sh avatar Feb 18 '24 03:02 Logical-sh

@Logical-sh I tested in VM and works fine. "Select library folder" is now a FolderDialog of QtQuick.Dialogs of package qt6-declarative, do you have qt6-declarative installed? And please provide log as said in DEBUG.md

fxzjshm avatar Feb 18 '24 04:02 fxzjshm

debug.log Here is a log from trying to browse. The dialog appears just fine, I select it, and the dialog actually is changing to this image

Logical-sh avatar Feb 18 '24 04:02 Logical-sh