Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 565904

Summary: gnome-extra/iio-sensor-proxy: new ebuild
Product: Gentoo Linux Reporter: poncho <poncho>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: UNCONFIRMED ---    
Severity: normal CC: dragan.kasler, gnome, ikelos, leho, pastas4, poncho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: initial ebuild
iio-sensor-proxy-1.3
iio-sensor-proxy-2.0

Description poncho 2015-11-16 09:28:09 UTC
Created attachment 417086 [details]
initial ebuild

With a GNOME 3.18 (or newer) based system, orientation changes will automatically be applied when rotating the panel, ambient light will be used to change the screen brightness, and Geoclue will be able to read the compass data to show the direction in Maps.

http://www.hadess.net/2015/05/iio-sensor-proxy-10-is-out.html
https://github.com/hadess/iio-sensor-proxy
Comment 1 poncho 2016-02-16 09:15:07 UTC
gnome-base/gnome-settings-daemon needs the patches from:
https://bugzilla.gnome.org/show_bug.cgi?id=756539

otherwise, the log gets spamed with:

gdm: Error executing command as another user: Not authorized [USER=root] [TTY=unknown] [CWD=/var/lib/gdm] [COMMAND=/usr/libexec/gsd-backlight-helper --set-brightness 99]
Error executing command as another user: Not authorized
This incident has been reported.
Comment 2 poncho 2016-11-24 14:11:24 UTC
Created attachment 454240 [details]
iio-sensor-proxy-1.3
Comment 3 poncho 2016-12-18 20:07:46 UTC
Created attachment 456626 [details]
iio-sensor-proxy-2.0

This release adds build fixes, fixes the detection of a number of
devices that should be supported, stops trying to use devices
that shouldn't, and adds support for the "mount-matrix" property,
which can be used to fix the orientation of accelerometers on
devices where the default does not work.

    * Add support for ACCEL_MOUNT_MATRIX udev property
    * Fix startup failure on certain devices
    * Work-around possible kernel bug on certain devices
    * Better supported/unsupported sensors detection
    * Better debug output
Comment 4 Oleh 2017-10-04 08:45:05 UTC
this project has hard dependency on systemd, which is offered ebuild missing.
Comment 5 Roman Zimmermann 2020-06-30 14:42:13 UTC
It seems that the only reason for the systemd check in the build script is because a systemd unit file is shipped. For non-systemd systems we could pass any directory and then delete the file after the build. We’d still need to supply a OpenRC init-file though.
Comment 6 Alexander Weber 2022-01-19 08:10:54 UTC
I got compiled iio-sensor-proxy without systemd using ebuild https://github.com/gentoo-mirror/guru/blob/master/gnome-extra/iio-sensor-proxy/iio-sensor-proxy-3.3.ebuild and the next patch:


$ cat /etc/portage/patches/gnome-extra/iio-sensor-proxy/remove-systemd-build-dep.patch 
--- a/meson.build	2022-01-18 17:20:54.549908932 +0100
+++ b/meson.build	2022-01-18 17:24:23.199844256 +0100
@@ -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


/usr/libexec/iio-sensor-proxy needs an openrc wrapper (TODO), if started as root, the /usr/bin/monitor-sensor is able to read sensors.
Comment 7 Alexander Weber 2022-01-19 08:25:29 UTC
~ cat /etc/init.d/iio-sensor-proxy
#!/sbin/openrc-run

command=/usr/libexec/iio-sensor-proxy
command_background=yes
pidfile=/run/iio-sensor-proxy.pid

depend() {
   need dbus localmount
}
Comment 8 Edgar Uriel Domínguez Espinoza 2022-02-08 18:55:53 UTC
(In reply to Alexander Weber from comment #7)
> ~ cat /etc/init.d/iio-sensor-proxy
> #!/sbin/openrc-run
> 
> command=/usr/libexec/iio-sensor-proxy
> command_background=yes
> pidfile=/run/iio-sensor-proxy.pid
> 
> depend() {
>    need dbus localmount
> }

That doesn't work for me, but funtoo's one does:

#!/sbin/openrc-run

depend() {
	need dbus localmount
}

start () {
	ebegin "Starting iio-sensor-proxy"
	start-stop-daemon --start --exec /usr/libexec/iio-sensor-proxy \
	    --background --pidfile /run/iio-sensor-proxy.pid --make-pidfile
	eend $?
}

stop () {
	ebegin "Stopping iio-sensor-proxy"
	start-stop-daemon --stop --exec /usr/libexec/iio-sensor-proxy \
	    --pidfile /run/iio-sensor-proxy.pid
	eend $?
}

I think that gnome-common is not need it. Here the ebuild I'm using:

https://gitlab.com/genomorro/genomorro-overlay/-/tree/master/x11-app/iio-sensor-proxy