diff mbox series

[bug#39535] services: xorg: Filter modules based on system

Message ID evAew3yyJNr0SqI1AgxiGVIl0U_g3IusnP6yU_dayQTEaXhO1PF4UHKf2jBOt8QX8Kkf8pA1K4u1LnmJXuVGB1xcKORYfufAx-mFwojF6_0=@protonmail.com
State Accepted
Headers show
Series [bug#39535] services: xorg: Filter modules based on system | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

ashish.is--- via Guix-patches" via Feb. 9, 2020, 9:31 p.m. UTC
Fixes <https://bugs.gnu.org/39402>.
Reported by shtwzrd <shtwzrd@protonmail.com>.

* gnu/services/xorg.scm (xorg-configuration):
  Apply a filter over %default-xorg-modules packages, excluding
  those for which the %current-system is not among the package's
  supported-systems.

This patch makes it possible to use xorg-configuration on systems
other than x86_64 and i686, as without it, xf86-video-intel would
be pulled in on the unsupported architecture and fail.
---
 gnu/services/xorg.scm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

Comments

Maja Kądziołka Feb. 15, 2020, 11:04 p.m. UTC | #1
On Sun, Feb 09, 2020 at 09:31:09PM +0000, shtwzrd wrote:
> @@ -356,7 +361,7 @@ in @var{config}, are available.  The result should be used in place of
>      #~(apply execl #$X #$X ;; Second #$X is for argv[0].
>               "-logverbose" "-verbose" "-terminate"
>               #$@(xorg-configuration-server-arguments config)
> -              (cdr (command-line))))
> +             (cdr (command-line))))
>  
>    (program-file "startx" exp))
>  
> @@ -477,7 +482,7 @@ desktop session from the system or user profile will be used."
>    (auto-login? slim-configuration-auto-login?
>                 (default #f))
>    (default-user slim-configuration-default-user
> -                (default ""))
> +    (default ""))
>    (theme slim-configuration-theme
>           (default %default-slim-theme))
>    (theme-name slim-configuration-theme-name
> @@ -870,10 +875,10 @@ the GNOME desktop environment.")
>                     "Enable=" (if (gdm-configuration-debug? config)
>                                   "true"
>                                   "false") "\n"
> -                   "\n"
> -                   "[security]\n"
> -                   "#DisallowTCP=true\n"
> -                   "#AllowRemoteAutoLogin=false\n"))
> +                                 "\n"
> +                                 "[security]\n"
> +                                 "#DisallowTCP=true\n"
> +                                 "#AllowRemoteAutoLogin=false\n"))
>  
>  (define (gdm-pam-service config)
>    "Return a PAM service for @command{gdm}."
Looks like you reformatted the file by accident. Apart from that, LGTM,
so pushed as 779d96c9b0ee38cbaca9f8577e6cc7f907fb29cb after removing the
formatting mishap.

Thanks for the patch!
diff mbox series

Patch

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 9c84f7413f..edb421ada6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -152,7 +152,12 @@ 
   xorg-configuration make-xorg-configuration
   xorg-configuration?
   (modules          xorg-configuration-modules    ;list of packages
-                    (default %default-xorg-modules))
+                    ; filter out modules not supported on current system
+                    (default (filter
+                              (lambda (p)
+                                (member (%current-system)
+                                        (package-supported-systems p)))
+                              %default-xorg-modules)))
   (fonts            xorg-configuration-fonts      ;list of packges
                     (default %default-xorg-fonts))
   (drivers          xorg-configuration-drivers    ;list of strings
@@ -356,7 +361,7 @@  in @var{config}, are available.  The result should be used in place of
     #~(apply execl #$X #$X ;; Second #$X is for argv[0].
              "-logverbose" "-verbose" "-terminate"
              #$@(xorg-configuration-server-arguments config)
-              (cdr (command-line))))
+             (cdr (command-line))))
 
   (program-file "startx" exp))
 
@@ -477,7 +482,7 @@  desktop session from the system or user profile will be used."
   (auto-login? slim-configuration-auto-login?
                (default #f))
   (default-user slim-configuration-default-user
-                (default ""))
+    (default ""))
   (theme slim-configuration-theme
          (default %default-slim-theme))
   (theme-name slim-configuration-theme-name
@@ -870,10 +875,10 @@  the GNOME desktop environment.")
                    "Enable=" (if (gdm-configuration-debug? config)
                                  "true"
                                  "false") "\n"
-                   "\n"
-                   "[security]\n"
-                   "#DisallowTCP=true\n"
-                   "#AllowRemoteAutoLogin=false\n"))
+                                 "\n"
+                                 "[security]\n"
+                                 "#DisallowTCP=true\n"
+                                 "#AllowRemoteAutoLogin=false\n"))
 
 (define (gdm-pam-service config)
   "Return a PAM service for @command{gdm}."