Need help with pulling a patch into Baloo’s package to fix it on Btrfs

I’m waiting for a new laptop to arrive and plan to install EndeavourOS on it (:partying_face: :enos:)

My plan is to set up Btrfs RAID-1 spanning two M.2 SSDs, but I saw that there is trouble with Baloo with Btrfs currently:

https://bugs.kde.org/show_bug.cgi?id=402154

Luckily there is a merge request to fix it already, and apparently Fedora already uses it:

So I was thinking to apply this myself too. How do I go about that?

I apologise for the newbie approach, but it’s been a while since I’ve packaged anything and while I used Manjaro before, I never packaged or modified an Arch package before. (Have some experience with it on Gentoo and NixOS though, but super rusty.)

I am perfectly willing to do the leg work and turn this thread into a HOWTO for anyone else, until the patch either lands in Arch or it gets merged upstream. But will need someone to give me a push in the right direction.

Th baloo PKGBUILD and files are here:

Add a prepare function to the PKGBUILD as described here:
https://wiki.archlinux.org/title/Creating_packages#prepare()

Inside the prepare function apply the patch. If you need an example, there are many other packages that apply patches. For example, I know the systemd package applies patches.

If you get it working and are willing to maintain it, it would be great to add it to the AUR as baloo-fsid or something similar.

Thanks, that helps a lot already. I’ll do some more reading before I dive in.

If I manage to get it working before it gets fixed elsewhere, I’ll try to push it to AUR, yes. (If someone beats me to it, now that the fix is better known, I won’t be mad – far from it)