~ruther/guix-local

9e7e40b8bd1410dfcad6cbface22b1c31e665401 — Rutherther 4 months ago 0801604
services: xorg: Return only supported packages in %default-xorg-modules.

The xorg modules are used inside of services that's thunked. So we can
make them depend on the %current-system.

* gnu/services/xorg.scm
(default-xorg-modules): New variable.
(%default-xorg-modules): Return result of (default-xorg-modules).

Change-Id: I10f722e52d598ce3e83ef3f200b3bd953bc08e17
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2 files changed, 40 insertions(+), 24 deletions(-)

M etc/manifests/cross-compile.scm
M gnu/services/xorg.scm
M etc/manifests/cross-compile.scm => etc/manifests/cross-compile.scm +9 -5
@@ 71,18 71,21 @@ TARGET."
         "connman" "network-manager" "wpa-supplicant" "isc-dhcp" "cups"
         "linux-libre" "grub-hybrid")))

(define %system-gui-packages
(define (%system-gui-packages target)
  ;; Key packages proposed by the Guix System installer.
  (append (map specification->package
               '(;; build system `python' does not support cross builds
                 ;"gnome" "xfce" "mate" "openbox"
                                        ;"gnome" "xfce" "mate" "openbox"
                 "awesome"
                 "i3-wm" "i3status" "dmenu" "st"
                 "ratpoison" "xterm"
                 ;; build system `emacs' does not support cross builds
                 ;"emacs-exwm" "emacs-desktop-environment"
                                        ;"emacs-exwm" "emacs-desktop-environment"
                 "emacs"))
          %default-xorg-modules))
          ;; NOTE: %default-xorg-modules depends on system.
          (parameterize
              ((%current-target-system target))
            %default-xorg-modules)))

(define %packages-to-cross-build
  ;; Packages that must be cross-buildable from x86_64-linux.


@@ 151,7 154,8 @@ TARGET."
                                 ;; With a graphical environment:
                                 (if (or (target-x86-32? target)
                                         (target-aarch64? target))
                                     %system-gui-packages
                                     ;; %system-gui-packages depends on the system.
                                     (%system-gui-packages target)
                                     '()))))
                  (fold delete (map platform-system->target (systems))
                        '(;; Disable cross-compilation to self:

M gnu/services/xorg.scm => gnu/services/xorg.scm +31 -19
@@ 64,6 64,7 @@
  #:use-module ((guix modules) #:select (source-module-closure))
  #:use-module (guix packages)
  #:use-module (guix derivations)
  #:use-module (guix platform)
  #:use-module (guix records)
  #:use-module (guix deprecation)
  #:use-module (guix utils)


@@ 148,25 149,36 @@
;;;
;;; Code:

(define %default-xorg-modules
  ;; Default list of modules loaded by the server.  When multiple drivers
  ;; match, the first one in the list is loaded.
  (list xf86-video-vesa
        xf86-video-fbdev
        xf86-video-amdgpu
        xf86-video-ati
        xf86-video-cirrus
        xf86-video-intel
        xf86-video-mach64
        xf86-video-nouveau
        xf86-video-nv
        xf86-video-sis

        ;; Libinput is the new thing and is recommended over evdev/synaptics:
        ;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
        xf86-input-libinput
        xf86-input-evdev
        xf86-input-mouse))
(define* (default-xorg-modules
           #:optional
           (system (or (and=>
                        (%current-target-system)
                        platform-target->system)
                       (%current-system))))
  "Default list of modules loaded by the server.  When multiple drivers match,
the first one in the list is loaded."
  ;; Return only supported packages, because some aren't supported
  ;; on all architectures.
  (filter (cut supported-package? <> system)
          (list xf86-video-vesa
                xf86-video-fbdev
                xf86-video-amdgpu
                xf86-video-ati
                xf86-video-cirrus
                xf86-video-intel
                xf86-video-mach64
                xf86-video-nouveau
                xf86-video-nv
                xf86-video-sis

                ;; Libinput is the new thing and is recommended over evdev/synaptics:
                ;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
                xf86-input-libinput
                xf86-input-evdev
                xf86-input-mouse)))

(define-syntax %default-xorg-modules
  (identifier-syntax (default-xorg-modules)))

(define %default-xorg-fonts
  ;; Default list of fonts available to the X server.