commit:     b3679440310877c861685630fb986c35e2171653
Author:     Erwin Kaats <mailgentoo <AT> kaats <DOT> ch>
AuthorDate: Sat May 11 18:42:41 2024 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Sat May 11 18:42:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b3679440

gnome-extra/iio-sensor-proxy: support OpenRC
BUG: https://bugs.gentoo.org/930153

Signed-off-by: Erwin Kaats <mailgentoo <AT> kaats.ch>

 .../iio-sensor-proxy/files/iio-sensor-proxy        |  9 ++++++
 .../iio-sensor-proxy/files/no-systemd.patch        | 32 ++++++++++++++++++++++
 .../iio-sensor-proxy/iio-sensor-proxy-3.5.ebuild   | 13 ++++++++-
 3 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/gnome-extra/iio-sensor-proxy/files/iio-sensor-proxy 
b/gnome-extra/iio-sensor-proxy/files/iio-sensor-proxy
new file mode 100755
index 0000000000..b32f9b76f6
--- /dev/null
+++ b/gnome-extra/iio-sensor-proxy/files/iio-sensor-proxy
@@ -0,0 +1,9 @@
+#!/sbin/openrc-run
+
+command=/usr/libexec/iio-sensor-proxy
+command_background=yes
+pidfile=/run/iio-sensor-proxy.pid
+
+depend() {
+   need dbus localmount
+}

diff --git a/gnome-extra/iio-sensor-proxy/files/no-systemd.patch 
b/gnome-extra/iio-sensor-proxy/files/no-systemd.patch
new file mode 100644
index 0000000000..ff533f8b4f
--- /dev/null
+++ b/gnome-extra/iio-sensor-proxy/files/no-systemd.patch
@@ -0,0 +1,32 @@
+--- iio-sensor-proxy-${PV}/meson.build
++++ iio-sensor-proxy-${PV}/meson.build
+@@ -34,11 +34,7 @@
+     udev_dep = dependency('udev')
+     udev_rules_dir = udev_dep.get_pkgconfig_variable('udevdir') + '/rules.d'
+ endif
+-systemd_system_unit_dir = get_option('systemdsystemunitdir')
+-if systemd_system_unit_dir == 'auto'
+-    systemd_dep = dependency('systemd')
+-    systemd_system_unit_dir = 
systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
+-endif
++systemd_system_unit_dir = '/lib/systemd/system'
+ if get_option('gtk-tests')
+     gtk_dep = dependency('gtk+-3.0', required: false)
+ endif
+
+--- iio-sensor-proxy-${PV}/data/meson.build
++++ iio-sensor-proxy-${PV}/data/meson.build
+@@ -8,13 +8,6 @@
+ data_conf.set('geoclue_user', get_option('geoclue-user'))
+ 
+ configure_file(
+-  input: 'iio-sensor-proxy.service.in',
+-  output: 'iio-sensor-proxy.service',
+-  configuration: data_conf,
+-  install_dir: systemd_system_unit_dir,
+-)
+-
+-configure_file(
+   input: 'net.hadess.SensorProxy.conf.in',
+   output: 'net.hadess.SensorProxy.conf',
+   configuration: data_conf,

diff --git a/gnome-extra/iio-sensor-proxy/iio-sensor-proxy-3.5.ebuild 
b/gnome-extra/iio-sensor-proxy/iio-sensor-proxy-3.5.ebuild
index 7285b570a9..8a766c8117 100644
--- a/gnome-extra/iio-sensor-proxy/iio-sensor-proxy-3.5.ebuild
+++ b/gnome-extra/iio-sensor-proxy/iio-sensor-proxy-3.5.ebuild
@@ -12,7 +12,7 @@ 
SRC_URI="https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/archive/${PV}/
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~arm64"
-IUSE="+systemd"
+IUSE="systemd"
 
 RDEPEND="
        dev-libs/glib:*
@@ -32,8 +32,19 @@ DEPEND="
        virtual/pkgconfig
 "
 
+src_prepare() {
+       if use !systemd ; then
+               echo "patching out systemd"
+               # patch out call of systemd directory
+               eapply "${FILESDIR}/no-systemd.patch"
+               # eapply "${FILESDIR}/open_rc_service.patch"
+       fi
+       eapply_user
+}
+
 src_install() {
        meson_src_install
+       doinitd ${FILESDIR}/iio-sensor-proxy
 }
 
 pkg_postinst() {

Reply via email to