all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* wip-xorg-server-1.18
@ 2016-02-18 21:03 Andy Wingo
  2016-02-19  4:19 ` wip-xorg-server-1.18 宋文武
  2016-02-23 21:17 ` wip-xorg-server-1.18 Mark H Weaver
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Wingo @ 2016-02-18 21:03 UTC (permalink / raw)
  To: guix-devel

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

Hi,

My Broadwell laptop hasn't had working accelerated OpenGL since I
installed it.  It was using the llvmpipe, a software path.  Eventually
when I looked into it, it turned out that was because the
xf86-video-intel package was too old and disabled acceleration for my
chipset.  So I wrote an xorg updater, which uncovered about 62 package
updates.  There are in wip-xorg-server-1.18, or eventually will be once
the send-email git hook finishes running.

There are two notable commits, which I attach here for comment.  The
first adds the updater.  The last changes how the X server starts.
At some point in the X.org 1.17 development cycle, input modules started
shipping .conf snippets that were to go in an xorg.conf.d file.  These
snippets would register certain modules as providing the drivers for
certain classes of input devices, using a kind of pattern matching.
However with our setup, we didn't have one xorg.conf.d directory with
these files in it.  I experienced this problem as what I perceived to be
a video freeze, but in reality it was just that I had no keyboard or
mouse because no module volunteered to bind to my input devices.  So I
changed the X service to generate such a directory, like we do with dbus
and other things.  A proper solution would probably be to make Xorg
modules be "services" which provide extensions to the X server package,
but that's a problem for another day.

Andy


[-- Attachment #2: 0001-gnu-maintenance-Add-X.org-updater.patch --]
[-- Type: text/plain, Size: 3888 bytes --]

From 6ed739a8c7d45d7a6a4cabf493b1cbad80b48002 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@igalia.com>
Date: Thu, 18 Feb 2016 20:50:02 +0100
Subject: [PATCH] gnu-maintenance: Add X.org updater.

* guix/gnu-maintenance.scm (xorg-package?, latest-xorg-release): New
  private functions.
  (%xorg-updater): New public variable.

* guix/scripts/refresh.scm (%updaters): Add %xorg-updater.

* doc/guix.texi (Invoking guix refresh): Mention the new updater.
---
 doc/guix.texi            |  2 ++
 guix/gnu-maintenance.scm | 37 ++++++++++++++++++++++++++++++++++++-
 guix/scripts/refresh.scm |  3 ++-
 3 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index bac7389..ed17a63 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4612,6 +4612,8 @@ list of updaters).  Currently, @var{updater} may be one of:
 the updater for GNU packages;
 @item gnome
 the updater for GNOME packages;
+@item xorg
+the updater for X.org packages;
 @item elpa
 the updater for @uref{http://elpa.gnu.org/, ELPA} packages;
 @item cran
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 96fbfb7..9d720ca 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -33,6 +33,7 @@
   #:use-module (guix records)
   #:use-module (guix upstream)
   #:use-module (guix packages)
+  #:use-module (gnu packages)
   #:export (gnu-package-name
             gnu-package-mundane-name
             gnu-package-copyright-holder
@@ -57,7 +58,8 @@
             gnu-package-name->name+version
 
             %gnu-updater
-            %gnome-updater))
+            %gnome-updater
+            %xorg-updater))
 
 ;;; Commentary:
 ;;;
@@ -508,6 +510,32 @@ elpa.gnu.org, and all the GNOME packages."
                        ;; checksums.
                        #:file->signature (const #f))))
 
+(define (xorg-package? package)
+  "Return true if PACKAGE is an X.org package, developed by X.org."
+  (define xorg-uri?
+    (match-lambda
+      ((? string? uri)
+       (string-prefix? "mirror://xorg/" uri))
+      (_
+       #f)))
+
+  (match (package-source package)
+    ((? origin? origin)
+     (match (origin-uri origin)
+       ((? xorg-uri?) #t)
+       (_              #f)))
+    (_ #f)))
+
+(define (latest-xorg-release package)
+  "Return the latest release of PACKAGE, the name of an X.org package."
+  (let ((uri (string->uri (origin-uri (package-source (specification->package package))))))
+    (false-if-ftp-error
+     (latest-ftp-release
+      package
+      #:server "ftp.freedesktop.org"
+      #:directory
+      (string-append "/pub/xorg/" (dirname (uri-path uri)))))))
+
 (define %gnu-updater
   (upstream-updater
    (name 'gnu)
@@ -522,4 +550,11 @@ elpa.gnu.org, and all the GNOME packages."
    (pred gnome-package?)
    (latest latest-gnome-release)))
 
+(define %xorg-updater
+  (upstream-updater
+   (name 'xorg)
+   (description "Updater for X.org packages")
+   (pred xorg-package?)
+   (latest latest-xorg-release)))
+
 ;;; gnu-maintenance.scm ends here
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index f9e3f31..964fdcc 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -31,7 +31,7 @@
   #:use-module (guix scripts graph)
   #:use-module (guix monads)
   #:use-module ((guix gnu-maintenance)
-                #:select (%gnu-updater %gnome-updater))
+                #:select (%gnu-updater %gnome-updater %xorg-updater))
   #:use-module (guix import elpa)
   #:use-module (guix import cran)
   #:use-module (guix gnupg)
@@ -193,6 +193,7 @@ unavailable optional dependencies such as Guile-JSON."
   ;; List of "updaters" used by default.  They are consulted in this order.
   (list-updaters %gnu-updater
                  %gnome-updater
+                 %xorg-updater
                  %elpa-updater
                  %cran-updater
                  %bioconductor-updater
-- 
2.6.3


[-- Attachment #3: 0001-gnu-services-Start-X-with-configdir.patch --]
[-- Type: text/plain, Size: 3583 bytes --]

From b58c3fe4bf932768e9df20d9c2c74745ba5286e9 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@igalia.com>
Date: Thu, 18 Feb 2016 21:34:37 +0100
Subject: [PATCH] gnu: services: Start X with -configdir.

* gnu/services/xorg.scm (%default-xorg-modules): New public variable.
(xorg-configuration-directory): New function.
(xorg-start-command): Add #:modules keyword argument, defaulting to
%default-xorg-modules.  Build an xorg.conf.d directory from those
modules, and pass it to X via the -configdir parameter.
---
 gnu/services/xorg.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index a93dbfe..980b5a6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -40,6 +40,7 @@
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
   #:export (xorg-configuration-file
+            %default-xorg-modules
             xorg-start-command
             %default-slim-theme
             %default-slim-theme-name
@@ -137,9 +138,52 @@ EndSection
   "\n"
   extra-config))
 
+(define %default-xorg-modules
+  (list xf86-video-vesa
+        xf86-video-fbdev
+        xf86-video-modesetting
+        xf86-video-cirrus
+        xf86-video-intel
+        xf86-video-mach64
+        xf86-video-nouveau
+        xf86-video-nv
+        xf86-video-sis
+        xf86-input-libinput
+        xf86-input-evdev
+        xf86-input-keyboard
+        xf86-input-mouse
+        xf86-input-synaptics))
+
+(define (xorg-configuration-directory modules)
+  "Return a directory that contains the @code{.conf} files for X.org that
+includes the @code{share/X11/xorg.conf.d} directories of each package listed
+in @var{modules}."
+  (computed-file "xorg.conf.d"
+                 #~(begin
+                     (use-modules (guix build utils)
+                                  (srfi srfi-1))
+
+                     (define files
+                       (append-map (lambda (module)
+                                     (find-files (string-append
+                                                  module
+                                                  "/share/X11/xorg.conf.d")
+                                                 "\\.conf$"))
+                                   (list #$@modules)))
+
+                     (mkdir #$output)
+                     (for-each (lambda (file)
+                                 (symlink file
+                                          (string-append #$output "/"
+                                                         (basename file))))
+                               files)
+                     #t)
+                 #:modules '((guix build utils))))
+
 (define* (xorg-start-command #:key
                              (guile (canonical-package guile-2.0))
                              (configuration-file (xorg-configuration-file))
+                             (modules %default-xorg-modules)
                              (xorg-server xorg-server))
   "Return a derivation that builds a @var{guile} script to start the X server
 from @var{xorg-server}.  @var{configuration-file} is the server configuration
@@ -158,6 +202,7 @@ Usually the X server is started by a login manager."
                "-logverbose" "-verbose"
                "-xkbdir" (string-append #$xkeyboard-config "/share/X11/xkb")
                "-config" #$configuration-file
+               "-configdir" #$(xorg-configuration-directory modules)
                "-nolisten" "tcp" "-terminate"
 
                ;; Note: SLiM and other display managers add the
-- 
2.6.3


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

end of thread, other threads:[~2016-02-24 19:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 21:03 wip-xorg-server-1.18 Andy Wingo
2016-02-19  4:19 ` wip-xorg-server-1.18 宋文武
2016-02-23 21:17 ` wip-xorg-server-1.18 Mark H Weaver
2016-02-24  9:00   ` wip-xorg-server-1.18 Andy Wingo
2016-02-24 17:26     ` wip-xorg-server-1.18 Mark H Weaver
2016-02-24 17:36       ` wip-xorg-server-1.18 Andy Wingo
2016-02-24 19:01         ` wip-xorg-server-1.18 Mark H Weaver

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.