Page MenuHomePhabricator

e 22+ meson: Program "/usr/sbin/sleep.sh" not found or not executable
Closed, ResolvedPublic

Description

Switching an ebuild from autotools to meson I ran into build issues with E under meson. It seems to be looking for a file that does not exist on Gentoo. This does not seem to be a fatal or blocking issue for autotools.

Program sleep.sh found: NO
Program /etc/acpi/sleep.sh found: NO
Program /sbin/sleep.sh found: NO
Program /usr/sbin/sleep.sh found: NO

Meson encountered an error in file data/etc/meson.build, line 24, column 4:
Program "/usr/sbin/sleep.sh" not found or not executable

I do have /bin/sleep and /usr/bin/sleep, but it is a binary not a script. I do have acpi and pm-utils. Not sure what provides sleep.sh, if something should, if I need it. Seems to only matter to meson. Maybe should not be blocking, fatal error?

wltjr created this task.Oct 13 2017, 12:30 PM

Looks like this should be a conditional on install-sysactions. E does not use that file directly. It is only referenced in data/etc/sysactions.conf. Thus the meson.build in data/etc/meson.build having the sleep bit. Which should likely be optional on the global sleep variable from the master/root meson.build

wltjr added a comment.Oct 13 2017, 1:18 PM

This should fix it

diff --git a/data/etc/meson.build b/data/etc/meson.build
index b5a43a5cf..14baf7253 100644
--- a/data/etc/meson.build
+++ b/data/etc/meson.build
@@ -21,7 +21,7 @@ else
     SUSPEND   = '/usr/bin/systemctl suspend'
     HIBERNATE = '/usr/bin/systemctl hibernate'
   else
-    sleep = find_program('sleep.sh', '/etc/acpi/sleep.sh', '/sbin/sleep.sh', '/usr/sbin/sleep.sh')
+    sleep = find_program('sleep.sh', '/etc/acpi/sleep.sh', '/sbin/sleep.sh', '/usr/sbin/sleep.sh', required : false)
     if sleep.found() == true
       SUSPEND = sleep.path()
       if sleep.path() == '/etc/acpi/sleep.sh'
@@ -34,7 +34,7 @@ else
       endif
     endif

-    hibernate_sh = find_program('hibernate.sh', '/etc/acpi/hibernate.sh', '/sbin/hibernate.sh', '/usr/sbin/hibernate.sh')
+    hibernate_sh = find_program('hibernate.sh', '/etc/acpi/hibernate.sh', '/sbin/hibernate.sh', '/usr/sbin/hibernate.sh', required : false)
     if hibernate_sh.found() == true
       HIBERNATE = hibernate_sh.path()
       if hibernate_sh.path() == '/etc/acpi/hibernate.sh'
wltjr added a comment.Oct 13 2017, 1:27 PM

As a patch

or Differential Added the wrong way :P

zmike added a subscriber: raster.Oct 18 2017, 6:07 AM

@raster what do you think about this?

this patch makes sense. these shell scripts are optional, not needed. it's one of various helper tools searched for to generate a sysactions.conf file that is appropriate for your system (without packagers having to hand edit one for integration).