Skip to main content
Topic: Re: libsystemd issue (Read 562 times) previous topic - next topic - Topic derived from Re: libsystemd issue
0 Members and 1 Guest are viewing this topic.

Re: libsystemd issue

@onlypj Sorry but the devs have clarified they do not support archlinux repositories.
I am interested in ratbag too for some gaming mice i need to "tame" so when I will (slowly and clumsily :) ) begin maintaining I will make sure to add ratbag among the first things.
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)
Code: [Select]
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.

Re: Re: libsystemd issue

Reply #1
from there it would be easy. grab arch version of 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)

Re: Re: libsystemd issue

Reply #2
from there it would be easy. grab arch version of 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.

Re: Re: libsystemd issue

Reply #3
check the aur PKGBUILD.
It has "prepare()" function. I describe how to use diff/patch instead of sed.

remove the line with "sed"

follow this guide or any other guide related to making a diff file and how to patch it.

write the patch command in "prepare()'
Code: [Select]
patch < meson_option-elogind_patch.patch

the patch file should be something like this
Code: [Select]
--- 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',

Re: Re: libsystemd issue

Reply #4
Thank you, I understand prepare() functions and patch files much better now. It's also a lot cleaner applying the patch this way.