I'm making a new topic as it's not really about the other OPs topic anymore. Not supporting arch repos makes total sense and I apologize, I forgot it was from the AUR.
I found an old github post about compiling libratbag with elogind instead of systemd (for openrc+gentoo) as dbus seems to be the only runtime dependency.
https://github.com/libratbag/libratbag/issues/696
https://github.com/libratbag/libratbag/commit/9b409822c309152644d8de7664b2f152a7cee895
I was able to compile it as well by changing two values in mesa_options.txt (output from sdiff using the original and my edited version)
option('systemd', (
type : 'boolean', (
value : true, | value : false,
description : 'Build systemd unit files') (
(
option('logind-provider', (
type : 'combo', (
choices: [ 'elogind', 'systemd'], (
value : 'systemd', | value : 'elogind',
description : 'Which logind provider to use') (
This put all the necessary files in the build dir but that's as far as I can go, I'm not sure how to package it and test it as a pacman pkg install.
from there it would be easy. grab arch version of PKGBUILD (https://gitlab.archlinux.org/archlinux/packaging/packages/libratbag/-/blob/main/PKGBUILD)
remove systemd stuff, add elogind dependency, add your patch file for "mesa_options.txt" , as an extra step you can make a int service script in a separate package.
to add this patch you can need to write it in the "prepare()" function. in this you can use diff/patch , sed or any othere method to change file as you please. ( you can even replace the file with your own)
Ok great, with a ton of fiddling and figuring out PKGBUILDs I got it to install and run. I had a lot of problems where it would download a new source and not build from my changes, using makepkg -e worked after manually applying the changes again in the src directory. Piper can read from ratbagd and changes within piper are applied as expected. Ratbagctl command works and returns values as it did before.
I'm not sure why it's pulling new sources each time. I cloned the repo to my own gitea instance, made all the changes and commited them, changed the PKGBUILD url to my own gitea repo and it STILL tries to build from the old meson_options version. There has to be a setting somewhere I'm missing.
check the aur PKGBUILD (https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=libratbag-git).
It has "prepare()" function. I describe how to use diff/patch instead of sed.
remove the line with "sed"
follow this guide (https://opensource.com/article/18/8/diffs-patches) or any other guide related to making a diff file and how to patch it.
write the patch command in "prepare()'
patch < meson_option-elogind_patch.patch
the patch file should be something like this
--- meson_options.txt 2023-07-12 01:18:36.957791925 +0000
+++ meson_options.txt 2023-07-12 01:21:01.128908620 +0000
@@ -30,13 +30,13 @@
option('systemd',
type : 'boolean',
- value : true,
+ value : false,
description : 'Build systemd unit files')
option('logind-provider',
type : 'combo',
choices: [ 'elogind', 'systemd'],
- value : 'systemd',
+ value : 'elogind',
description : 'Which logind provider to use')
option('coverity',
Thank you, I understand prepare() functions and patch files much better now. It's also a lot cleaner applying the patch this way.