unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: iyzsong@outlook.com
To: 44621@debbugs.gnu.org
Cc: 宋文武 <iyzsong@member.fsf.org>
Subject: [bug#44621] [PATCH] services: Add 'xorg-server-service-type'.
Date: Fri, 13 Nov 2020 22:00:33 +0800	[thread overview]
Message-ID: <OS0P286MB01784888BADFDE7B75CBAA3EA3E60@OS0P286MB0178.JPNP286.PROD.OUTLOOK.COM> (raw)

From: 宋文武 <iyzsong@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}.")))
+
 \f
 ;;;
 ;;; SLiM log-in manager.
-- 
2.29.1





             reply	other threads:[~2020-11-13 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 14:00 iyzsong [this message]
2020-11-14  2:37 ` [bug#44621] [PATCH] services: Add 'xorg-server-service-type' 宋文武
2021-02-11  9:31   ` bug#44621: " 宋文武

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OS0P286MB01784888BADFDE7B75CBAA3EA3E60@OS0P286MB0178.JPNP286.PROD.OUTLOOK.COM \
    --to=iyzsong@outlook.com \
    --cc=44621@debbugs.gnu.org \
    --cc=iyzsong@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).