all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 31342@debbugs.gnu.org
Subject: [bug#31342] [PATCH 2/2] gnu: services: Add Enlightenment desktop service.
Date: Mon, 7 May 2018 22:03:27 +0300	[thread overview]
Message-ID: <20180507190327.GA2707@macbook41> (raw)
In-Reply-To: <87bmdr5s2g.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 3480 bytes --]

On Mon, May 07, 2018 at 06:49:43PM +0200, Ludovic Courtès wrote:
> Efraim Flashner <efraim@flashner.co.il> skribis:
> 
> > * gnu/services/desktop.scm (<enlightenment-desktop-configuration>,
> > enlightenment-desktop-service-type): New variables.
> > (enlightenment-desktop-service): New public variable.
> > * doc/guix.texi (Desktop Services): Document the service.
> 
> In guix.texi, could you document ‘enlightenment-desktop-service-type’
> and ‘enlightenment-desktop-configuration’?
> 
> [...]
> 
> > +(define-record-type* <enlightenment-desktop-configuration>
> > +  enlightenment-desktop-configuration
> > +  make-enlightenment-desktop-configuration
> > +  enlightenment-desktop-configuration
> > +  (enlightenment enlightenment-package (default enlightenment)))
> 
> Actually, unless you expect more configuration elements to be added to
> this record eventually, you might be better off without a record and
> simply using the package as the value for that service.
> 
> WDYT?
> 
> > +(define (enlightenment-setuid-programs enlightenment-desktop-configuration)
> > +  (match-record enlightenment-desktop-configuration
> > +                <enlightenment-desktop-configuration>
> > +                (enlightenment)
> > +    (list (file-append enlightenment
> > +                       "/lib/enlightenment/utils/enlightenment_sys")
> > +          (file-append enlightenment
> > +                       "/lib/enlightenment/utils/enlightenment_backlight")
> > +          ;; TODO: Move this binary to a screen-locker service.
> > +          (file-append enlightenment
> > +                       "/lib/enlightenment/utils/enlightenment_ckpasswd")
> 
> Perhaps enlightenment_ckpasswd needs a PAM entry as well, like
> ‘screen-locker-service-type’ does?
> 

I'm not sure, enlightenment's screen locker code was refactored in
0.22.2 so that it would behave identically on Linux and BSD, and I'm not
sure that the BSDs use PAM, and it seems to with as-is.

> > +          (file-append enlightenment
> > +                       (string-append
> > +                         "/lib/enlightenment/modules/cpufreq/linux-gnu-"
> > +                         (string-drop-right (%current-system) 6) ; drop '-linux'
> 
> Rather:
> 
>   (match (string-tokenize (%current-system) (char-set-complement (char-set #\-)))
>     ((arch "linux") (string-append "linux-gnu-" arch))
>     ((arch "gnu")   (string-append "gnu-" arch)))
> 
> > +(define* (enlightenment-desktop-service
> > +           #:key (config (enlightenment-desktop-configuration)))
> > +  "Return a service that adds the @code{enlightenment} package to the system
> > +profile, and extends dbus with the ability for @code{efl} to generate
> > +thumbnails and makes setuid the programs which enlightenment expects to have
> > +their setuid bit set."
> > +  (service enlightenment-desktop-service-type config))
> 
> Not needed!  :-)
> 
> Thank you,
> Ludo’.

I looked at the xfce service especially, and it actually has the same
fields and declarations as enlightenment. I'd like to leave the option
in place to add '(enlightenment-desktop-service)' to an OS-config since
it is then identical to the other desktop services we have.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-services-Add-Enlightenment-desktop-service.patch --]
[-- Type: text/plain, Size: 6989 bytes --]

From 197db9e742508958a93a0ce606bd8a770f103745 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Sat, 10 Mar 2018 22:24:00 +0200
Subject: [PATCH 1/2] gnu: services: Add Enlightenment desktop service.

* gnu/services/desktop.scm (<enlightenment-desktop-configuration>,
enlightenment-desktop-service-type): New variables.
(enlightenment-desktop-service): New public variable.
* doc/guix.texi (Desktop Services): Document the service.
---
 doc/guix.texi            | 15 ++++++----
 gnu/services/desktop.scm | 64 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index dc9894173..fca2c8e13 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -12584,11 +12584,11 @@ field of an @code{operating-system} declaration (@pxref{operating-system
 Reference, @code{services}}).
 
 Additionally, the @code{gnome-desktop-service},
-@code{xfce-desktop-service} and @code{mate-desktop-service}
-procedures can add GNOME, XFCE and/or MATE to a system.
-To ``add GNOME'' means that system-level services like the
-backlight adjustment helpers and the power management utilities are
-added to the system, extending @code{polkit} and @code{dbus}
+@code{xfce-desktop-service}, @code{mate-desktop-service} and
+@code{enlightenment-desktop-service} procedures can add GNOME, XFCE, MATE
+and/or Enlightenment to a system.  To ``add GNOME'' means that system-level
+services like the backlight adjustment helpers and the power management
+utilities are added to the system, extending @code{polkit} and @code{dbus}
 appropriately, allowing GNOME to operate with elevated privileges on a
 limited number of special-purpose system interfaces.  Additionally,
 adding a service made by @code{gnome-desktop-service} adds the GNOME
@@ -12601,7 +12601,10 @@ To ``add MATE'' means that @code{polkit} and @code{dbus} are extended
 appropriately, allowing MATE to operate with elevated privileges on a
 limited number of special-purpose system interfaces.  Additionally,
 adding a service made by @code{mate-desktop-service} adds the MATE
-metapackage to the system profile.
+metapackage to the system profile.  ``Adding ENLIGHTENMENT'' means that
+@code{dbus} is extended appropriately, and several of Enlightenment's binaries
+are set as setuid, allowing Enlightenment's screen locker and other
+functionality to work as expetected.
 
 The desktop environments in Guix use the Xorg display server by
 default.  If you'd like to use the newer display server protocol
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 517d5d3ef..74073fab9 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@
   #:use-module (gnu services networking)
   #:use-module ((gnu system file-systems)
                 #:select (%elogind-file-systems))
+  #:use-module (gnu system)
   #:use-module (gnu system shadow)
   #:use-module (gnu system pam)
   #:use-module (gnu packages glib)
@@ -44,9 +46,11 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages mate)
+  #:use-module (gnu packages enlightenment)
   #:use-module (guix records)
   #:use-module (guix packages)
   #:use-module (guix store)
+  #:use-module (guix utils)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
@@ -96,6 +100,11 @@
 
             x11-socket-directory-service
 
+            enlightenment-desktop-configuration
+            enlightenment-desktop-configuration?
+            enlightenment-desktop-service
+            enlightenment-desktop-service-type
+
             %desktop-services))
 
 ;;; Commentary:
@@ -899,6 +908,61 @@ with the administrator's password."
                         (let ((directory "/tmp/.X11-unix"))
                           (mkdir-p directory)
                           (chmod directory #o777))))))
+\f
+;;;
+;;; Enlightenment desktop service.
+;;;
+
+(define-record-type* <enlightenment-desktop-configuration>
+  enlightenment-desktop-configuration
+  make-enlightenment-desktop-configuration
+  enlightenment-desktop-configuration
+  (enlightenment enlightenment-package (default enlightenment)))
+
+(define (enlightenment-setuid-programs enlightenment-desktop-configuration)
+  (match-record enlightenment-desktop-configuration
+                <enlightenment-desktop-configuration>
+                (enlightenment)
+    (list (file-append enlightenment
+                       "/lib/enlightenment/utils/enlightenment_sys")
+          (file-append enlightenment
+                       "/lib/enlightenment/utils/enlightenment_backlight")
+          ;; TODO: Move this binary to a screen-locker service.
+          (file-append enlightenment
+                       "/lib/enlightenment/utils/enlightenment_ckpasswd")
+          (file-append enlightenment
+                       (string-append
+                         "/lib/enlightenment/modules/cpufreq/"
+                         (match (string-tokenize (%current-system)
+                                                 (char-set-complement (char-set #\-)))
+                                ((arch "linux") (string-append "linux-gnu-" arch))
+                                ((arch "gnu")   (string-append "gnu-" arch)))
+                         "-"
+                         (version-major+minor (package-version enlightenment))
+                         "/freqset")))))
+
+(define enlightenment-desktop-service-type
+  (service-type
+   (name 'enlightenment-desktop)
+   (extensions
+    (list (service-extension dbus-root-service-type
+                             (compose list
+                                      (package-direct-input-selector
+                                       "efl")
+                                      enlightenment-package))
+          (service-extension setuid-program-service-type
+                             enlightenment-setuid-programs)
+          (service-extension profile-service-type
+                             (compose list
+                                      enlightenment-package))))))
+
+(define* (enlightenment-desktop-service
+           #:key (config (enlightenment-desktop-configuration)))
+  "Return a service that adds the @code{enlightenment} package to the system
+profile, and extends dbus with the ability for @code{efl} to generate
+thumbnails and makes setuid the programs which enlightenment needs to function
+as expected."
+  (service enlightenment-desktop-service-type config))
 
 \f
 ;;;
-- 
2.17.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-05-07 19:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 16:44 [bug#31342] [PATCH 0/2] Enlightenment Desktop Service Efraim Flashner
2018-05-02 16:47 ` [bug#31342] [PATCH 1/2] gnu: enlightenment: Fix setuid program locations Efraim Flashner
2018-05-02 16:47   ` [bug#31342] [PATCH 2/2] gnu: services: Add Enlightenment desktop service Efraim Flashner
2018-05-07 16:49     ` Ludovic Courtès
2018-05-07 19:03       ` Efraim Flashner [this message]
2018-05-08 13:24         ` Ludovic Courtès
2018-05-13 15:36           ` Efraim Flashner
2018-05-07 16:42   ` [bug#31342] [PATCH 1/2] gnu: enlightenment: Fix setuid program locations Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=20180507190327.GA2707@macbook41 \
    --to=efraim@flashner.co.il \
    --cc=31342@debbugs.gnu.org \
    --cc=ludo@gnu.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 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.