unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix arandr.
@ 2016-02-27 11:03 Ricardo Wurmus
  2016-02-27 13:13 ` Mark H Weaver
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-02-27 11:03 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

Hi Guix,

arandr doesn’t work as it needs “xrandr” at runtime.  I tried to patch
the sources to replace the path to the “xrandr” binary with a full store
item path, but this wasn’t quite as pretty as I hoped as the arandr
sources don’t define the path once but directly assemble command line
strings in several places.  Propagating “xrandr” is the cleaner solution
in my opinion.

~~ Ricardo


[-- Attachment #2: 0001-gnu-arandr-Propagate-xrandr.patch --]
[-- Type: text/x-patch, Size: 1299 bytes --]

From 63e7cbea271cbfe0ab083b63d8755d3a83f93e5a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Sat, 27 Feb 2016 12:00:20 +0100
Subject: [PATCH] gnu: arandr: Propagate "xrandr".

* gnu/packages/xdisorg.scm (arandr)[propagated-inputs]: Add "xrandr".
---
 gnu/packages/xdisorg.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 46fccfe..bd17d4b 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015 xd1le <elisp.vim@gmail.com>
 ;;; Copyright © 2015 Florian Paul Schmidt <mista.tapas@gmx.net>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -69,6 +70,8 @@
     (arguments `(#:python ,python-2     ;incompatible with python 3
                  #:tests? #f))          ;no tests
     (inputs `(("pygtk" ,python2-pygtk)))
+    ;; "xrandr" is executed from various places in the code.
+    (propagated-inputs `(("xrandr" ,xrandr)))
     (native-inputs `(("gettext"           ,gnu-gettext)
                      ("python-docutils"   ,python2-docutils)
                      ("python-setuptools" ,python2-setuptools)))
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix arandr.
  2016-02-27 11:03 [PATCH] Fix arandr Ricardo Wurmus
@ 2016-02-27 13:13 ` Mark H Weaver
  2016-02-27 13:50   ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2016-02-27 13:13 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> writes:

> arandr doesn’t work as it needs “xrandr” at runtime.  I tried to patch
> the sources to replace the path to the “xrandr” binary with a full store
> item path, but this wasn’t quite as pretty as I hoped as the arandr
> sources don’t define the path once but directly assemble command line
> strings in several places.  Propagating “xrandr” is the cleaner solution
> in my opinion.

How about making a wrapper for arandr that sets PATH to find xrandr?

      Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix arandr.
  2016-02-27 13:13 ` Mark H Weaver
@ 2016-02-27 13:50   ` Ricardo Wurmus
  2016-02-27 14:42     ` Mark H Weaver
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-02-27 13:50 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]


Mark H Weaver <mhw@netris.org> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> arandr doesn’t work as it needs “xrandr” at runtime.  I tried to patch
>> the sources to replace the path to the “xrandr” binary with a full store
>> item path, but this wasn’t quite as pretty as I hoped as the arandr
>> sources don’t define the path once but directly assemble command line
>> strings in several places.  Propagating “xrandr” is the cleaner solution
>> in my opinion.
>
> How about making a wrapper for arandr that sets PATH to find xrandr?

Patch attached:


[-- Attachment #2: 0001-gnu-arandr-Add-xrandr-to-inputs.patch --]
[-- Type: text/x-patch, Size: 2109 bytes --]

From 28f0dc229bdba3e53bd101e5acf5e93e4ff7907e Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Sat, 27 Feb 2016 12:00:20 +0100
Subject: [PATCH] gnu: arandr: Add "xrandr" to inputs.

* gnu/packages/xdisorg.scm (arandr)[inputs]: Add "xrandr".
[arguments]: Add build phase "make-xrandr-available" to ensure "xrandr"
executable is found at runtime.
---
 gnu/packages/xdisorg.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index f01e17a..1cc5ef5 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015 xd1le <elisp.vim@gmail.com>
 ;;; Copyright © 2015 Florian Paul Schmidt <mista.tapas@gmx.net>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,9 +67,20 @@
                (base32
                 "0d574mbmhaqmh7kivaryj2hpghz6xkvic9ah43s1hf385y7c33kd"))))
     (build-system python-build-system)
-    (arguments `(#:python ,python-2     ;incompatible with python 3
-                 #:tests? #f))          ;no tests
-    (inputs `(("pygtk" ,python2-pygtk)))
+    (arguments
+     `(#:python ,python-2     ;incompatible with python 3
+       #:tests? #f ;no tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'make-xrandr-available
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/bin/arandr")
+               `("PATH" ":" prefix (,(string-append (assoc-ref inputs "xrandr")
+                                                    "/bin"))))
+             #t)))))
+    (inputs `(("pygtk" ,python2-pygtk)
+              ("xrandr" ,xrandr)))
     (native-inputs `(("gettext"           ,gnu-gettext)
                      ("python-docutils"   ,python2-docutils)
                      ("python-setuptools" ,python2-setuptools)))
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix arandr.
  2016-02-27 13:50   ` Ricardo Wurmus
@ 2016-02-27 14:42     ` Mark H Weaver
  2016-02-27 15:28       ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2016-02-27 14:42 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> writes:

> Mark H Weaver <mhw@netris.org> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> writes:
>>
>>> arandr doesn’t work as it needs “xrandr” at runtime.  I tried to patch
>>> the sources to replace the path to the “xrandr” binary with a full store
>>> item path, but this wasn’t quite as pretty as I hoped as the arandr
>>> sources don’t define the path once but directly assemble command line
>>> strings in several places.  Propagating “xrandr” is the cleaner solution
>>> in my opinion.
>>
>> How about making a wrapper for arandr that sets PATH to find xrandr?
>
> Patch attached:
>
> From 28f0dc229bdba3e53bd101e5acf5e93e4ff7907e Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Sat, 27 Feb 2016 12:00:20 +0100
> Subject: [PATCH] gnu: arandr: Add "xrandr" to inputs.
>
> * gnu/packages/xdisorg.scm (arandr)[inputs]: Add "xrandr".
> [arguments]: Add build phase "make-xrandr-available" to ensure "xrandr"
> executable is found at runtime.

Looks good to me.  Please push.

    Thanks!
      Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix arandr.
  2016-02-27 14:42     ` Mark H Weaver
@ 2016-02-27 15:28       ` Ricardo Wurmus
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2016-02-27 15:28 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel


Mark H Weaver <mhw@netris.org> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Mark H Weaver <mhw@netris.org> writes:
>>
>>> Ricardo Wurmus <rekado@elephly.net> writes:
>>>
>>>> arandr doesn’t work as it needs “xrandr” at runtime.  I tried to patch
>>>> the sources to replace the path to the “xrandr” binary with a full store
>>>> item path, but this wasn’t quite as pretty as I hoped as the arandr
>>>> sources don’t define the path once but directly assemble command line
>>>> strings in several places.  Propagating “xrandr” is the cleaner solution
>>>> in my opinion.
>>>
>>> How about making a wrapper for arandr that sets PATH to find xrandr?
>>
>> Patch attached:
>>
>> From 28f0dc229bdba3e53bd101e5acf5e93e4ff7907e Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Sat, 27 Feb 2016 12:00:20 +0100
>> Subject: [PATCH] gnu: arandr: Add "xrandr" to inputs.
>>
>> * gnu/packages/xdisorg.scm (arandr)[inputs]: Add "xrandr".
>> [arguments]: Add build phase "make-xrandr-available" to ensure "xrandr"
>> executable is found at runtime.
>
> Looks good to me.  Please push.

Pushed as b951e26.

~~ Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-27 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 11:03 [PATCH] Fix arandr Ricardo Wurmus
2016-02-27 13:13 ` Mark H Weaver
2016-02-27 13:50   ` Ricardo Wurmus
2016-02-27 14:42     ` Mark H Weaver
2016-02-27 15:28       ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).