gnu: lxrandr: Depend on xrandr.
authorTobias Geerinckx-Rice <me@tobias.gr>
Fri, 26 Jun 2020 20:05:08 +0000 (22:05 +0200)
committerTobias Geerinckx-Rice <me@tobias.gr>
Fri, 26 Jun 2020 20:11:05 +0000 (22:11 +0200)
* gnu/packages/lxde.scm (lxrandr)[arguments]: Substitute xrandr's
absolute file name.

Reported by pinoaffe on #guix.

gnu/packages/lxde.scm

index fbf32bf..cad5282 100644 (file)
@@ -137,7 +137,19 @@ able to change themes, icons, and fonts used by GTK+ applications.")
                (base32
                 "04n3vgh3ix12p8jfs4w0dyfq3anbjy33h7g53wbbqqc0f74xyplb"))))
     (build-system gnu-build-system)
-    (inputs `(("gtk+" ,gtk+-2)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'xrandr-absolutely
+           ;; lxrandr is useless without xrandr and gives an unhelpful error
+           ;; message if it's not in $PATH, so make it a hard dependency.
+           (lambda* (#:key input #:allow-other-keys)
+             (substitute* "src/lxrandr.c"
+               (("(\"|')xrandr\"" _ match)
+                (string-append match (which "xrandr") "\"")))
+             #t)))))
+    (inputs `(("gtk+" ,gtk+-2)
+              ("xrandr" ,xrandr)))
     (native-inputs `(("intltool"   ,intltool)
                      ("pkg-config" ,pkg-config)))
     (synopsis "LXDE monitor configuration tool")