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
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.
Created attachment 454240 [details] iio-sensor-proxy-1.3
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
this project has hard dependency on systemd, which is offered ebuild missing.
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.
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.
~ 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 }
(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