GNU bug report logs - #39306
[PATCH] gnu: Add xsettingsd.

Previous Next

Package: guix-patches;

Reported by: David Wilson <david <at> daviwil.com>

Date: Mon, 27 Jan 2020 13:05:01 UTC

Severity: normal

Tags: patch

Done: David Wilson <david <at> daviwil.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 39306 in the body.
You can then email your comments to 39306 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#39306; Package guix-patches. (Mon, 27 Jan 2020 13:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Wilson <david <at> daviwil.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 27 Jan 2020 13:05:02 GMT) Full text and rfc822 format available.

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

From: David Wilson <david <at> daviwil.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add xsettingsd.
Date: Mon, 27 Jan 2020 05:04:40 -0800
[Message part 1 (text/plain, inline)]
* gnu/packages/wm.scm (xsettingsd): New variable.
---
 gnu/packages/wm.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 52d7042806..4fb18e9f67 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2019 Brett Gilio <brettg <at> gnu.org>
 ;;; Copyright © 2019 Noodles! <nnoodle <at> chiru.no>
 ;;; Copyright © 2019 Alexandru-Sergiu Marton <brown121407 <at> member.fsf.org>
+;;; Copyright © 2020 David Wilson <david <at> daviwil.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -59,6 +60,7 @@
   #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system scons)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
@@ -94,6 +96,7 @@
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages suckless)
   #:use-module (gnu packages texinfo)
@@ -1670,3 +1673,63 @@ bar entirely based on XCB.  Provides full UTF-8 support, basic
 formatting, RandR and Xinerama support and EWMH compliance without
 wasting your precious memory.")
       (license license:x11))))
+
+(define-public xsettingsd
+  (package
+    (name "xsettingsd")
+    (version "1.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/derat/xsettingsd.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "05m4jlw0mgwp24cvyklncpziq1prr2lg0cq9c055sh4n9d93d07v"))))
+    (build-system scons-build-system)
+    (inputs
+     `(("libx11" ,libx11)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:scons ,scons-python2
+       #:scons-flags
+       (list "CC=gcc"
+             (string-append "PREFIX=" %output))
+       #:tests? #f ;; Tests require Google's gtest framework
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'patch-sconstruct
+           (lambda _
+             ;; scons doesn't pick up environment variables automatically
+             ;; so it needs some help to find path variables.
+             (substitute* "SConstruct"
+               (("env = Environment\\(")
+                "env = Environment(
+                         ENV = {
+                           'PATH': os.environ['PATH'],
+                           'CPATH': os.environ['CPATH'],
+                           'LIBRARY_PATH': os.environ['LIBRARY_PATH'],
+                           'PKG_CONFIG_PATH': os.environ['PKG_CONFIG_PATH']
+                         },"))
+             #t))
+         ;; The install task uses gtest to install the binaries.
+         ;; Since we don't have gtest, install binaries manually.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (install-file "xsettingsd" bin)
+               (install-file "dump_xsettings" bin)
+               #t))))))
+    (home-page "https://github.com/derat/xsettingsd")
+    (synopsis "Minimal Xorg settings daemon")
+    (description "xsettingsd is a lightweight daemon that provides settings to
+Xorg applications via the XSETTINGS specification.  It is used for defining
+font and theme settings when a complete desktop environment (GNOME, KDE) is
+not running.  With a simple .xsettingsd configuration file one can avoid
+configuring visual settings in different UI toolkits separately.")
+    (license license:bsd-3)))
--
2.24.1
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39306; Package guix-patches. (Thu, 30 Jan 2020 12:16:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: David Wilson <david <at> daviwil.com>, 39306 <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Thu, 30 Jan 2020 13:14:59 +0100
[Message part 1 (text/plain, inline)]
David Wilson <david <at> daviwil.com> writes:

> * gnu/packages/wm.scm (xsettingsd): New variable.

I wonder if xdisorg.scm is better suited for this package, as it seems
mostly unrelated to window management.  WDYT?

[...]

> +       #:tests? #f ;; Tests require Google's gtest framework

gtest is provided by the 'googletest' package.  Can you try adding it?

Also, for margin comments, we only use one ';', without capitalizing the
comment.

Other than that LGTM.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39306; Package guix-patches. (Thu, 30 Jan 2020 14:21:02 GMT) Full text and rfc822 format available.

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

From: David Wilson <david <at> daviwil.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 39306 <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Thu, 30 Jan 2020 06:20:08 -0800
[Message part 1 (text/plain, inline)]
Hi Marius!

Marius Bakke <mbakke <at> fastmail.com> writes:

> I wonder if xdisorg.scm is better suited for this package, as it seems
> mostly unrelated to window management.  WDYT?

Agreed, that's a more appropriate place.

> gtest is provided by the 'googletest' package.  Can you try adding it?

Thanks!  I didn't think to check with that name, I've got tests enabled
using that now.

> Also, for margin comments, we only use one ';', without capitalizing the
> comment.

Margin comment no longer needed, but I'll keep this in mind for future
commits.

I've attached an updated patch file with the suggested changes.  The
only thing I'm unsure about is disabling a particular warning-as-error
that showed up in the gtest.h header:

---- SNIP ----
/gnu/store/bxapb1f1l8frjpbjckk3zdxhmcig3xzk-googletest-1.10.0/include/gtest/gtest.h:1527:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~
cc1plus: all warnings being treated as errors
---- SNIP ----

Since this is a warning in gtest's own header file rather than the
package source, would it be OK to disable errors for it?

Thanks!

David

[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-xsettingsd.patch (text/x-patch, inline)]
From b5ca2c0377d677c0e3b9e288a8229d54ccd89125 Mon Sep 17 00:00:00 2001
From: David Wilson <david <at> daviwil.com>
Date: Sun, 26 Jan 2020 05:55:47 -0800
Subject: [PATCH] gnu: Add xsettingsd.

* gnu/packages/xdisorg.scm (xsettingsd): New variable.
---
 gnu/packages/xdisorg.scm | 68 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index ecefab1dbb..501ef53d3e 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -30,6 +30,7 @@
 ;;; Copyright © 2019 Josh Holland <josh <at> inv.alid.pw>
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy <at> bioneland.org>
 ;;; Copyright © 2020 Guillaume Le Vaillant <glv <at> posteo.net>
+;;; Copyright © 2020 David Wilson <david <at> daviwil.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,6 +58,7 @@
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system scons)
   #:use-module (gnu packages)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages admin)
@@ -2005,3 +2007,69 @@ The cutbuffer and clipboard selection are always synchronized.")
 can optionally use some appearance settings from XSettings, tint2 and GTK.")
     (home-page "https://jgmenu.github.io/")
     (license license:gpl2)))
+
+(define-public xsettingsd
+  (package
+    (name "xsettingsd")
+    (version "1.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/derat/xsettingsd.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "05m4jlw0mgwp24cvyklncpziq1prr2lg0cq9c055sh4n9d93d07v"))))
+    (build-system scons-build-system)
+    (inputs
+     `(("libx11" ,libx11)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("googletest" ,googletest)
+       ("googletest-source" ,(package-source googletest))))
+    (arguments
+     `(#:scons ,scons-python2
+       #:scons-flags
+       (list "CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'patch-sconstruct
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "SConstruct"
+               ;; scons doesn't pick up environment variables automatically
+               ;; so it needs help to find path variables
+               (("env = Environment\\(")
+                "env = Environment(
+                         ENV = {
+                           'PATH': os.environ['PATH'],
+                           'CPATH': os.environ['CPATH'],
+                           'LIBRARY_PATH': os.environ['LIBRARY_PATH'],
+                           'PKG_CONFIG_PATH': os.environ['PKG_CONFIG_PATH']
+                         },")
+               ;; Update path to gtest source files used in tests
+               (("/usr/src/gtest") (string-append
+                                    (assoc-ref inputs "googletest-source")
+                                    "/googletest"))
+               ;; Exclude one warning that causes a build error
+               (("-Werror") "-Werror -Wno-error=sign-compare"))
+             #t))
+         ;; The SConstruct script doesn't configure installation so
+         ;; binaries must be copied to the output path directly
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (install-file "xsettingsd" bin)
+               (install-file "dump_xsettings" bin)
+               #t))))))
+    (home-page "https://github.com/derat/xsettingsd")
+    (synopsis "Minimal Xorg settings daemon")
+    (description "xsettingsd is a lightweight daemon that provides settings to
+Xorg applications via the XSETTINGS specification.  It is used for defining
+font and theme settings when a complete desktop environment (GNOME, KDE) is
+not running.  With a simple .xsettingsd configuration file one can avoid
+configuring visual settings in different UI toolkits separately.")
+    (license license:bsd-3)))
-- 
2.24.1


Information forwarded to guix-patches <at> gnu.org:
bug#39306; Package guix-patches. (Thu, 30 Jan 2020 14:47:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: David Wilson <david <at> daviwil.com>
Cc: 39306 <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Thu, 30 Jan 2020 15:46:27 +0100
[Message part 1 (text/plain, inline)]
David Wilson <david <at> daviwil.com> writes:

> I've attached an updated patch file with the suggested changes.  The
> only thing I'm unsure about is disabling a particular warning-as-error
> that showed up in the gtest.h header:
>
> ---- SNIP ----
> /gnu/store/bxapb1f1l8frjpbjckk3zdxhmcig3xzk-googletest-1.10.0/include/gtest/gtest.h:1527:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>    if (lhs == rhs) {
>        ~~~~^~~~~~
> cc1plus: all warnings being treated as errors
> ---- SNIP ----
>
> Since this is a warning in gtest's own header file rather than the
> package source, would it be OK to disable errors for it?

I'm glad you asked.  :-)

It is definitively OK to disable warnings coming from dependencies.  In
fact, that is what we are supposed to do, and used to do until the
switch to GCC 7.

To clarify, when we switched to GCC 7, its search paths were changed
from C{,PLUS}_INCLUDE_PATH to CPATH.  The only[*] difference between
these search paths is that headers found on the former are treated as
"system headers", which disables warnings.

[*] Besides the fact that GCC 6 and later is very picky about the order
of entries in C_INCLUDE_PATH, which is why we had to switch; see
<https://issues.guix.gnu.org/issue/30756> for details.

So, LGTM, though I have a suggestion for the description:

> +    (synopsis "Minimal Xorg settings daemon")

Maybe s/Minimal //, as the description makes it clear that it is a
lightweight alternative to the GNOME and KDE approaches.

> +    (description "xsettingsd is a lightweight daemon that provides settings to
> +Xorg applications via the XSETTINGS specification.  It is used for defining
> +font and theme settings when a complete desktop environment (GNOME, KDE) is
> +not running.  With a simple .xsettingsd configuration file one can avoid
> +configuring visual settings in different UI toolkits separately.")

@command{xsettingsd} and @file{.xsettingsd} will make it look slightly
better/more readable in the various UIs.  :-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39306; Package guix-patches. (Thu, 30 Jan 2020 16:02:01 GMT) Full text and rfc822 format available.

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

From: David Wilson <david <at> daviwil.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 39306 <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Thu, 30 Jan 2020 08:01:21 -0800
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> It is definitively OK to disable warnings coming from dependencies.  In
> fact, that is what we are supposed to do, and used to do until the
> switch to GCC 7.
>
> To clarify, when we switched to GCC 7, its search paths were changed
> from C{,PLUS}_INCLUDE_PATH to CPATH.  The only[*] difference between
> these search paths is that headers found on the former are treated as
> "system headers", which disables warnings.
>
> [*] Besides the fact that GCC 6 and later is very picky about the order
> of entries in C_INCLUDE_PATH, which is why we had to switch; see
> <https://issues.guix.gnu.org/issue/30756> for details.

Thanks for the background, that was helpful!  I've been out of the loop
on GCC changes for a while so it's good to know that this happened.

I've made the suggested changes to the summary and description, attached
the updated patch.

David

[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-xsettingsd.patch (text/x-patch, inline)]
From 7c9daaf8ab86c84d4bb4ad554912746dacbca5cd Mon Sep 17 00:00:00 2001
From: David Wilson <david <at> daviwil.com>
Date: Sun, 26 Jan 2020 05:55:47 -0800
Subject: [PATCH] gnu: Add xsettingsd.

* gnu/packages/xdisorg.scm (xsettingsd): New variable.
---
 gnu/packages/xdisorg.scm | 68 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index ecefab1dbb..10c5201e5e 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -30,6 +30,7 @@
 ;;; Copyright © 2019 Josh Holland <josh <at> inv.alid.pw>
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy <at> bioneland.org>
 ;;; Copyright © 2020 Guillaume Le Vaillant <glv <at> posteo.net>
+;;; Copyright © 2020 David Wilson <david <at> daviwil.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,6 +58,7 @@
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system scons)
   #:use-module (gnu packages)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages admin)
@@ -2005,3 +2007,69 @@ The cutbuffer and clipboard selection are always synchronized.")
 can optionally use some appearance settings from XSettings, tint2 and GTK.")
     (home-page "https://jgmenu.github.io/")
     (license license:gpl2)))
+
+(define-public xsettingsd
+  (package
+    (name "xsettingsd")
+    (version "1.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/derat/xsettingsd.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "05m4jlw0mgwp24cvyklncpziq1prr2lg0cq9c055sh4n9d93d07v"))))
+    (build-system scons-build-system)
+    (inputs
+     `(("libx11" ,libx11)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("googletest" ,googletest)
+       ("googletest-source" ,(package-source googletest))))
+    (arguments
+     `(#:scons ,scons-python2
+       #:scons-flags
+       (list "CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'patch-sconstruct
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "SConstruct"
+               ;; scons doesn't pick up environment variables automatically
+               ;; so it needs help to find path variables
+               (("env = Environment\\(")
+                "env = Environment(
+                         ENV = {
+                           'PATH': os.environ['PATH'],
+                           'CPATH': os.environ['CPATH'],
+                           'LIBRARY_PATH': os.environ['LIBRARY_PATH'],
+                           'PKG_CONFIG_PATH': os.environ['PKG_CONFIG_PATH']
+                         },")
+               ;; Update path to gtest source files used in tests
+               (("/usr/src/gtest") (string-append
+                                    (assoc-ref inputs "googletest-source")
+                                    "/googletest"))
+               ;; Exclude one warning that causes a build error
+               (("-Werror") "-Werror -Wno-error=sign-compare"))
+             #t))
+         ;; The SConstruct script doesn't configure installation so
+         ;; binaries must be copied to the output path directly
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (install-file "xsettingsd" bin)
+               (install-file "dump_xsettings" bin)
+               #t))))))
+    (home-page "https://github.com/derat/xsettingsd")
+    (synopsis "Xorg settings daemon")
+    (description "@command{xsettingsd} is a lightweight daemon that provides settings to
+Xorg applications via the XSETTINGS specification.  It is used for defining
+font and theme settings when a complete desktop environment (GNOME, KDE) is
+not running.  With a simple @file{.xsettingsd} configuration file one can avoid
+configuring visual settings in different UI toolkits separately.")
+    (license license:bsd-3)))
-- 
2.24.1


Information forwarded to guix-patches <at> gnu.org:
bug#39306; Package guix-patches. (Thu, 30 Jan 2020 16:15:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: David Wilson <david <at> daviwil.com>
Cc: 39306 <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Thu, 30 Jan 2020 17:14:00 +0100
[Message part 1 (text/plain, inline)]
David Wilson <david <at> daviwil.com> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> It is definitively OK to disable warnings coming from dependencies.  In
>> fact, that is what we are supposed to do, and used to do until the
>> switch to GCC 7.
>>
>> To clarify, when we switched to GCC 7, its search paths were changed
>> from C{,PLUS}_INCLUDE_PATH to CPATH.  The only[*] difference between
>> these search paths is that headers found on the former are treated as
>> "system headers", which disables warnings.
>>
>> [*] Besides the fact that GCC 6 and later is very picky about the order
>> of entries in C_INCLUDE_PATH, which is why we had to switch; see
>> <https://issues.guix.gnu.org/issue/30756> for details.
>
> Thanks for the background, that was helpful!  I've been out of the loop
> on GCC changes for a while so it's good to know that this happened.
>
> I've made the suggested changes to the summary and description, attached
> the updated patch.

Excellent, LGTM!
[signature.asc (application/pgp-signature, inline)]

Reply sent to David Wilson <david <at> daviwil.com>:
You have taken responsibility. (Fri, 31 Jan 2020 13:58:02 GMT) Full text and rfc822 format available.

Notification sent to David Wilson <david <at> daviwil.com>:
bug acknowledged by developer. (Fri, 31 Jan 2020 13:58:03 GMT) Full text and rfc822 format available.

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

From: David Wilson <david <at> daviwil.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 39306-done <at> debbugs.gnu.org
Subject: Re: [bug#39306] [PATCH] gnu: Add xsettingsd.
Date: Fri, 31 Jan 2020 05:57:25 -0800
Thanks for your help Marius!

Pushed this to master as commit 261d0e8e3837139b9d4314a87c8370c6d7f54124.

David




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 Feb 2020 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 56 days ago.

Previous Next


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