GNU bug report logs - #44621
[PATCH] services: Add 'xorg-server-service-type'.

Previous Next

Package: guix-patches;

Reported by: iyzsong <at> outlook.com

Date: Fri, 13 Nov 2020 15:30:02 UTC

Severity: normal

Tags: patch

Done: 宋文武 <iyzsong <at> outlook.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44621 in the body.
You can then email your comments to 44621 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#44621; Package guix-patches. (Fri, 13 Nov 2020 15:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to iyzsong <at> outlook.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 13 Nov 2020 15:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> outlook.com
To: guix-patches <at> gnu.org
Cc: 宋文武 <iyzsong <at> member.fsf.org>
Subject: [PATCH] services: Add 'xorg-server-service-type'.
Date: Fri, 13 Nov 2020 22:00:33 +0800
From: 宋文武 <iyzsong <at> member.fsf.org>

* gnu/services/xorg.scm (xorg-server-service-type): New service type.
(xorg-server-profile-service): New procedure.
---
 gnu/services/xorg.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 4590709187..33c3102514 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -45,6 +45,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages bash)
   #:use-module (gnu system shadow)
+  #:use-module (guix build-system trivial)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix packages)
@@ -70,6 +71,7 @@
             xorg-wrapper
             xorg-start-command
             xinitrc
+            xorg-server-service-type
 
             %default-slim-theme
             %default-slim-theme-name
@@ -483,6 +485,40 @@ a `service-extension', as used by `set-xorg-configuration'."
                       (xorg-configuration xorg-configuration))
                      config)))))))
 
+(define (xorg-server-profile-service config)
+  ;; XXX: profile-service-type only accepts <package> objects.
+  (list
+   (package
+     (name "xorg-wrapper")
+     (version (package-version xorg-server))
+     (source (xorg-wrapper config))
+     (build-system trivial-build-system)
+     (arguments
+      '(#:modules ((guix build utils))
+        #:builder
+        (begin
+          (use-modules (guix build utils))
+          (let* ((source (assoc-ref %build-inputs "source"))
+                 (out (assoc-ref %outputs "out"))
+                 (bin (string-append out "/bin")))
+            (mkdir-p bin)
+            (symlink source (string-append bin "/X"))
+            #t))))
+     (home-page (package-home-page xorg-server))
+     (synopsis (package-synopsis xorg-server))
+     (description (package-description xorg-server))
+     (license (package-license xorg-server)))))
+
+(define xorg-server-service-type
+  (service-type
+   (name 'xorg-server)
+   (extensions
+    (list (service-extension profile-service-type
+                             xorg-server-profile-service)))
+   (default-value (xorg-configuration))
+   (description "Add @command{X} to the system profile, to be used with
+@command{startx}.")))
+
 
 ;;;
 ;;; SLiM log-in manager.
-- 
2.29.1





Information forwarded to guix-patches <at> gnu.org:
bug#44621; Package guix-patches. (Sat, 14 Nov 2020 08:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 44621 <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> outlook.com>
To: 44621 <at> debbugs.gnu.org
Cc: 宋文武 <iyzsong <at> member.fsf.org>
Subject: Re: [bug#44621] [PATCH] services: Add 'xorg-server-service-type'.
Date: Sat, 14 Nov 2020 10:37:35 +0800
[Message part 1 (text/plain, inline)]
Update patch to symlink 'Xorg' for 'sx':

[0001-services-Add-xorg-server-service-type.patch (text/x-patch, inline)]
From 3f15fe4f9e2fbbc48998453708102bb2c9dc8b48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong <at> member.fsf.org>
Date: Fri, 13 Nov 2020 21:57:04 +0800
Subject: [PATCH] services: Add 'xorg-server-service-type'.

* gnu/services/xorg.scm (xorg-server-service-type): New service type.
(xorg-server-profile-service): New procedure.
---
 gnu/services/xorg.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 4590709187..60611dc77d 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -45,6 +45,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages bash)
   #:use-module (gnu system shadow)
+  #:use-module (guix build-system trivial)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix packages)
@@ -70,6 +71,7 @@
             xorg-wrapper
             xorg-start-command
             xinitrc
+            xorg-server-service-type
 
             %default-slim-theme
             %default-slim-theme-name
@@ -483,6 +485,41 @@ a `service-extension', as used by `set-xorg-configuration'."
                       (xorg-configuration xorg-configuration))
                      config)))))))
 
+(define (xorg-server-profile-service config)
+  ;; XXX: profile-service-type only accepts <package> objects.
+  (list
+   (package
+     (name "xorg-wrapper")
+     (version (package-version xorg-server))
+     (source (xorg-wrapper config))
+     (build-system trivial-build-system)
+     (arguments
+      '(#:modules ((guix build utils))
+        #:builder
+        (begin
+          (use-modules (guix build utils))
+          (let* ((source (assoc-ref %build-inputs "source"))
+                 (out (assoc-ref %outputs "out"))
+                 (bin (string-append out "/bin")))
+            (mkdir-p bin)
+            (symlink source (string-append bin "/X"))
+            (symlink source (string-append bin "/Xorg"))
+            #t))))
+     (home-page (package-home-page xorg-server))
+     (synopsis (package-synopsis xorg-server))
+     (description (package-description xorg-server))
+     (license (package-license xorg-server)))))
+
+(define xorg-server-service-type
+  (service-type
+   (name 'xorg-server)
+   (extensions
+    (list (service-extension profile-service-type
+                             xorg-server-profile-service)))
+   (default-value (xorg-configuration))
+   (description "Add @command{X} to the system profile, to be used with
+@command{sx} or @command{xinit}.")))
+
 
 ;;;
 ;;; SLiM log-in manager.
-- 
2.29.1

[Message part 3 (text/plain, inline)]

With this service, we can run 'sx' from the console as a normal user.


If you want to use 'xinit', put this into ~/.xserverrc:
--8<---------------cut here---------------start------------->8---
tty=$(tty)
tty=${tty#/dev/tty}
X vt${tty}
--8<---------------cut here---------------end--------------->8---

Reply sent to 宋文武 <iyzsong <at> outlook.com>:
You have taken responsibility. (Thu, 11 Feb 2021 09:31:01 GMT) Full text and rfc822 format available.

Notification sent to iyzsong <at> outlook.com:
bug acknowledged by developer. (Thu, 11 Feb 2021 09:31:01 GMT) Full text and rfc822 format available.

Message #13 received at 44621-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> outlook.com>
To: 44621-done <at> debbugs.gnu.org
Subject: Re: [bug#44621] [PATCH] services: Add 'xorg-server-service-type'.
Date: Thu, 11 Feb 2021 17:31:46 +0800
Pushed, close now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 11 Mar 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.