unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server
@ 2020-04-24  1:14 Caleb Ristvedt
  2020-06-02 12:01 ` Caleb Ristvedt
  2020-06-04 12:34 ` bug#40806: done Caleb Ristvedt
  0 siblings, 2 replies; 6+ messages in thread
From: Caleb Ristvedt @ 2020-04-24  1:14 UTC (permalink / raw)
  To: 40806

Suppose that one specifies a custom xorg-server package to use in an
<xorg-configuration> record, like so:

(xorg-configuration
 (server xorg-server-for-debugging))

the correct bin/X will be run, but the wrong modules will be specified
in xserver.conf - the default xorg-server will always be used for
these. This is because in gnu/services/xorg.scm, in
xorg-configuration->file, we simply hard-code xorg-server to refer to
the one from (gnu packages xorg) and ignore the one specified in the
configuration entirely.

We shouldn't do this. It should be enough to just wrap the current
contents with

(let ((xorg-server (xorg-configuration-server config)))
  ...)

to make it work.

Then I can improve my xorg bug report :-)

- reepca

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

* bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server
  2020-04-24  1:14 bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server Caleb Ristvedt
@ 2020-06-02 12:01 ` Caleb Ristvedt
  2020-06-04 12:11   ` Ludovic Courtès
  2020-06-04 12:34 ` bug#40806: done Caleb Ristvedt
  1 sibling, 1 reply; 6+ messages in thread
From: Caleb Ristvedt @ 2020-06-02 12:01 UTC (permalink / raw)
  To: 40806


[-- Attachment #1.1: Type: text/plain, Size: 70 bytes --]

If it helps, here's a patch that makes the trivial change.

- reepca


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-xorg-honor-xorg-configuration-server-in-xorg-configu.patch --]
[-- Type: text/x-patch, Size: 9518 bytes --]

From e1071c830ce511eecd57617a3f188740fd49d703 Mon Sep 17 00:00:00 2001
From: Caleb Ristvedt <caleb.ristvedt@cune.org>
Date: Tue, 2 Jun 2020 06:28:46 -0500
Subject: [PATCH] xorg: honor xorg-configuration-server in
 xorg-configuration->file

Previously the xorg-server package specified in the configuration was ignored
entirely in xorg-configuration->file.  This had the effect that while the X
program of the configured package would be executed, the modules of the
configured package would be ignored in favor of the default xorg-server
package's modules.  This fixes that.

* gnu/services/xorg.scm (xorg-configuration->file): honor
  xorg-configuration-server.
---
 gnu/services/xorg.scm | 161 +++++++++++++++++++++---------------------
 1 file changed, 81 insertions(+), 80 deletions(-)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 2505bde97b..ca39994516 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -180,31 +180,32 @@
 (define (xorg-configuration->file config)
   "Compute an Xorg configuration file corresponding to CONFIG, an
 <xorg-configuration> record."
-  (define all-modules
-    ;; 'xorg-server' provides 'fbdevhw.so' etc.
-    (append (xorg-configuration-modules config)
-            (list xorg-server)))
-
-  (define build
-    #~(begin
-        (use-modules (ice-9 match)
-                     (srfi srfi-1)
-                     (srfi srfi-26))
-
-        (call-with-output-file #$output
-          (lambda (port)
-            (define drivers
-              '#$(xorg-configuration-drivers config))
+  (let ((xorg-server (xorg-configuration-server config)))
+    (define all-modules
+      ;; 'xorg-server' provides 'fbdevhw.so' etc.
+      (append (xorg-configuration-modules config)
+              (list xorg-server)))
+
+    (define build
+      #~(begin
+          (use-modules (ice-9 match)
+                       (srfi srfi-1)
+                       (srfi srfi-26))
+
+          (call-with-output-file #$output
+            (lambda (port)
+              (define drivers
+                '#$(xorg-configuration-drivers config))
 
-            (define (device-section driver)
-              (string-append "
+              (define (device-section driver)
+                (string-append "
 Section \"Device\"
   Identifier \"device-" driver "\"
   Driver \"" driver "\"
 EndSection"))
 
-            (define (screen-section driver resolutions)
-              (string-append "
+              (define (screen-section driver resolutions)
+                (string-append "
 Section \"Screen\"
   Identifier \"screen-" driver "\"
   Device \"device-" driver "\"
@@ -218,8 +219,8 @@ Section \"Screen\"
   EndSubSection
 EndSection"))
 
-            (define (input-class-section layout variant model options)
-              (string-append "
+              (define (input-class-section layout variant model options)
+                (string-append "
 Section \"InputClass\"
   Identifier \"evdev keyboard catchall\"
   MatchIsKeyboard \"on\"
@@ -243,69 +244,69 @@ Section \"InputClass\"
   Driver \"evdev\"
 EndSection\n"))
 
-            (define (expand modules)
-              ;; Append to MODULES the relevant /lib/xorg/modules
-              ;; sub-directories.
-              (append-map (lambda (module)
-                            (filter-map (lambda (directory)
-                                          (let ((full (string-append module
-                                                                     directory)))
-                                            (and (file-exists? full)
-                                                 full)))
-                                        '("/lib/xorg/modules/drivers"
-                                          "/lib/xorg/modules/input"
-                                          "/lib/xorg/modules/multimedia"
-                                          "/lib/xorg/modules/extensions")))
-                          modules))
-
-            (display "Section \"Files\"\n" port)
-            (for-each (lambda (font)
-                        (format port "  FontPath \"~a\"~%" font))
-                      '#$(xorg-configuration-fonts config))
-            (for-each (lambda (module)
-                        (format port
-                                "  ModulePath \"~a\"~%"
-                                module))
-                      (append (expand '#$all-modules)
-
-                              ;; For fbdevhw.so and so on.
-                              (list #$(file-append xorg-server
-                                                   "/lib/xorg/modules"))))
-            (display "EndSection\n" port)
-            (display "
+              (define (expand modules)
+                ;; Append to MODULES the relevant /lib/xorg/modules
+                ;; sub-directories.
+                (append-map (lambda (module)
+                              (filter-map (lambda (directory)
+                                            (let ((full (string-append module
+                                                                       directory)))
+                                              (and (file-exists? full)
+                                                   full)))
+                                          '("/lib/xorg/modules/drivers"
+                                            "/lib/xorg/modules/input"
+                                            "/lib/xorg/modules/multimedia"
+                                            "/lib/xorg/modules/extensions")))
+                            modules))
+
+              (display "Section \"Files\"\n" port)
+              (for-each (lambda (font)
+                          (format port "  FontPath \"~a\"~%" font))
+                        '#$(xorg-configuration-fonts config))
+              (for-each (lambda (module)
+                          (format port
+                                  "  ModulePath \"~a\"~%"
+                                  module))
+                        (append (expand '#$all-modules)
+
+                                ;; For fbdevhw.so and so on.
+                                (list #$(file-append xorg-server
+                                                     "/lib/xorg/modules"))))
+              (display "EndSection\n" port)
+              (display "
 Section \"ServerFlags\"
   Option \"AllowMouseOpenFail\" \"on\"
 EndSection\n" port)
 
-            (display (string-join (map device-section drivers) "\n")
-                     port)
-            (newline port)
-            (display (string-join
-                      (map (cut screen-section <>
-                                '#$(xorg-configuration-resolutions config))
-                           drivers)
-                      "\n")
-                     port)
-            (newline port)
-
-            (let ((layout  #$(and=> (xorg-configuration-keyboard-layout config)
-                                    keyboard-layout-name))
-                  (variant #$(and=> (xorg-configuration-keyboard-layout config)
-                                    keyboard-layout-variant))
-                  (model   #$(and=> (xorg-configuration-keyboard-layout config)
-                                    keyboard-layout-model))
-                  (options '#$(and=> (xorg-configuration-keyboard-layout config)
-                                     keyboard-layout-options)))
-              (when layout
-                (display (input-class-section layout variant model options)
-                         port)
-                (newline port)))
-
-            (for-each (lambda (config)
-                        (display config port))
-                      '#$(xorg-configuration-extra-config config))))))
-
-  (computed-file "xserver.conf" build))
+              (display (string-join (map device-section drivers) "\n")
+                       port)
+              (newline port)
+              (display (string-join
+                        (map (cut screen-section <>
+                                  '#$(xorg-configuration-resolutions config))
+                             drivers)
+                        "\n")
+                       port)
+              (newline port)
+
+              (let ((layout  #$(and=> (xorg-configuration-keyboard-layout config)
+                                      keyboard-layout-name))
+                    (variant #$(and=> (xorg-configuration-keyboard-layout config)
+                                      keyboard-layout-variant))
+                    (model   #$(and=> (xorg-configuration-keyboard-layout config)
+                                      keyboard-layout-model))
+                    (options '#$(and=> (xorg-configuration-keyboard-layout config)
+                                       keyboard-layout-options)))
+                (when layout
+                  (display (input-class-section layout variant model options)
+                           port)
+                  (newline port)))
+
+              (for-each (lambda (config)
+                          (display config port))
+                        '#$(xorg-configuration-extra-config config))))))
+
+    (computed-file "xserver.conf" build)))
 
 (define (xorg-configuration-directory modules)
   "Return a directory that contains the @code{.conf} files for X.org that
-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server
  2020-06-02 12:01 ` Caleb Ristvedt
@ 2020-06-04 12:11   ` Ludovic Courtès
  2020-06-04 12:33     ` Caleb Ristvedt
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-06-04 12:11 UTC (permalink / raw)
  To: Caleb Ristvedt; +Cc: 40806

Hi,

Caleb Ristvedt <caleb.ristvedt@cune.org> skribis:

> From e1071c830ce511eecd57617a3f188740fd49d703 Mon Sep 17 00:00:00 2001
> From: Caleb Ristvedt <caleb.ristvedt@cune.org>
> Date: Tue, 2 Jun 2020 06:28:46 -0500
> Subject: [PATCH] xorg: honor xorg-configuration-server in
>  xorg-configuration->file

Please add “Fixes <https://bugs.gnu.org/40806>.”

> Previously the xorg-server package specified in the configuration was ignored
> entirely in xorg-configuration->file.  This had the effect that while the X
> program of the configured package would be executed, the modules of the
> configured package would be ignored in favor of the default xorg-server
> package's modules.  This fixes that.
>
> * gnu/services/xorg.scm (xorg-configuration->file): honor
>   xorg-configuration-server.

LGTM, thanks!

Ludo’.




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

* bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server
  2020-06-04 12:11   ` Ludovic Courtès
@ 2020-06-04 12:33     ` Caleb Ristvedt
  2020-06-05 16:10       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Caleb Ristvedt @ 2020-06-04 12:33 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 40806

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Caleb Ristvedt <caleb.ristvedt@cune.org> skribis:
>
>> From e1071c830ce511eecd57617a3f188740fd49d703 Mon Sep 17 00:00:00 2001
>> From: Caleb Ristvedt <caleb.ristvedt@cune.org>
>> Date: Tue, 2 Jun 2020 06:28:46 -0500
>> Subject: [PATCH] xorg: honor xorg-configuration-server in
>>  xorg-configuration->file
>
> Please add “Fixes <https://bugs.gnu.org/40806>.”

Done.

>> Previously the xorg-server package specified in the configuration was ignored
>> entirely in xorg-configuration->file.  This had the effect that while the X
>> program of the configured package would be executed, the modules of the
>> configured package would be ignored in favor of the default xorg-server
>> package's modules.  This fixes that.
>>
>> * gnu/services/xorg.scm (xorg-configuration->file): honor
>>   xorg-configuration-server.
>
> LGTM, thanks!

Pushed as 8b158e8b2cd0293eeebe73f5a71f0c513a89d606.

- reepca




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

* bug#40806: done
  2020-04-24  1:14 bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server Caleb Ristvedt
  2020-06-02 12:01 ` Caleb Ristvedt
@ 2020-06-04 12:34 ` Caleb Ristvedt
  1 sibling, 0 replies; 6+ messages in thread
From: Caleb Ristvedt @ 2020-06-04 12:34 UTC (permalink / raw)
  To: 40806-done

done




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

* bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server
  2020-06-04 12:33     ` Caleb Ristvedt
@ 2020-06-05 16:10       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-06-05 16:10 UTC (permalink / raw)
  To: Caleb Ristvedt; +Cc: 40806-done

Caleb Ristvedt <caleb.ristvedt@cune.org> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hi,
>>
>> Caleb Ristvedt <caleb.ristvedt@cune.org> skribis:
>>
>>> From e1071c830ce511eecd57617a3f188740fd49d703 Mon Sep 17 00:00:00 2001
>>> From: Caleb Ristvedt <caleb.ristvedt@cune.org>
>>> Date: Tue, 2 Jun 2020 06:28:46 -0500
>>> Subject: [PATCH] xorg: honor xorg-configuration-server in
>>>  xorg-configuration->file
>>
>> Please add “Fixes <https://bugs.gnu.org/40806>.”
>
> Done.
>
>>> Previously the xorg-server package specified in the configuration was ignored
>>> entirely in xorg-configuration->file.  This had the effect that while the X
>>> program of the configured package would be executed, the modules of the
>>> configured package would be ignored in favor of the default xorg-server
>>> package's modules.  This fixes that.
>>>
>>> * gnu/services/xorg.scm (xorg-configuration->file): honor
>>>   xorg-configuration-server.
>>
>> LGTM, thanks!
>
> Pushed as 8b158e8b2cd0293eeebe73f5a71f0c513a89d606.

Great, closing!




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

end of thread, other threads:[~2020-06-05 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24  1:14 bug#40806: xorg-configuration->file doesn't honor xorg-configuration-server Caleb Ristvedt
2020-06-02 12:01 ` Caleb Ristvedt
2020-06-04 12:11   ` Ludovic Courtès
2020-06-04 12:33     ` Caleb Ristvedt
2020-06-05 16:10       ` Ludovic Courtès
2020-06-04 12:34 ` bug#40806: done Caleb Ristvedt

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).