From patchwork Fri Sep 23 05:00:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42857 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 73B6A27BBEA; Fri, 23 Sep 2022 06:03:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 42AB227BBE9 for ; Fri, 23 Sep 2022 06:03:09 +0100 (BST) Received: from localhost ([::1]:38458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqC-0003W3-CN for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obap8-0003Uf-S7 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap8-00023h-Jk for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap8-00054O-F0 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 01/15] gnu: tigervnc-server: Use new style inputs, gexps. References: <20220923045855.29728-1-maxim.cournoyer@gmail.com> In-Reply-To: <20220923045855.29728-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390926319279 (code B ref 58014); Fri, 23 Sep 2022 05:02:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:03 +0000 Received: from localhost ([127.0.0.1]:38998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoB-00050s-1T for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:03 -0400 Received: from mail-qv1-f41.google.com ([209.85.219.41]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obao9-000506-Ap for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:02 -0400 Received: by mail-qv1-f41.google.com with SMTP id z9so8321686qvn.9 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=zzUlnA7Y46Eisz/HaRw0DchIBCDeXLtulhccEFvKbRU=; b=ZAGAbx1IMBc/5Y+LR1u2s48MMEqNqBl/pIpTJJIlcc2USkc2FdOdXYanp62Pip/66T X/kuzYba8vxYJc8/nsUmgCHZo12eL51y3E9SSliHuRyRYiamI++zUHrhXL6TPqFlP2si 4AipzAUFXzdt2cmwDViEoVMxexCIoq6Xv0skyxmcBOU3uNJan6h4thjO3FLiAP3gpq/Q 0hiqgZRtJysVr5njC+yqr1BiUpSMhjilc0wjMS9VuXfcCnxzC721KHGD+CqEMwnj9Qix //Y5V1BAGV2fA2MZIR8tLr86uBLa5hvoSPWT4bI7yIYXEkGxlYNkuTf0Kel/+SW4+phV Uvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=zzUlnA7Y46Eisz/HaRw0DchIBCDeXLtulhccEFvKbRU=; b=vrj118URgbGKZvtW9xVQmp4iFEa3/6Q8C6OCjYc8itWOXzidVgo6a9vkHyRlaxJkN5 ecS+Lwz8UMqSYfbQYya0zEqjvQmB+uaNOX08ycC85NCcd1w8RJf240dD6caJdvkdijMP iShz1vdEF/y1XhHKBJjdDkZGE/FIhdXrFH9CAmN0MGrM1t5mndc1+kkU3wnqs/5P4HIl 35gqz1exn0OdkRa9WUTsy6ioDOM7pvH50Uv1VeMxIRu59Vshr7gosFtVINPqtWddjqgR +ZRFYi+tBkHVjsAQLFWy2p0ZK1oH3l1xDp54g8hZL/yN6HEKWbFQ5Q2MHQAGGjbfgy/V 5mSA== X-Gm-Message-State: ACrzQf2utqN7Runp53MdCQaJJLm3gxkPc2KYdBd6FhLzlrEhxUW2hzT9 wDVsL0JA8JBiHWWvc8zxp8g6PBZgos4= X-Google-Smtp-Source: AMsMyM7y52glPAuAuPiuxEaEndabiy8RUF7lhAofxVr5Xq3JMbwFAkDXeeqhdyPIS4nAUeL0exjoJg== X-Received: by 2002:a05:6214:194b:b0:4ac:814e:938c with SMTP id q11-20020a056214194b00b004ac814e938cmr5391083qvk.67.1663909254410; Thu, 22 Sep 2022 22:00:54 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:00:54 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:28 -0400 Message-Id: <20220923050042.29893-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vnc.scm (%tigervnc-client-source): New variable. (tigervnc-server): Move input fields after arguments. [native-inputs]: Use new style and 'modify-inputs'. Do not add tigervnc-client regular inputs. [configure-flags]: Use gexps, cons* instead of append. [phases]: Use gexps. {check}: Replace smiley with an explanatory comment. {copy-tvnc-xserver}: Adjust default Makefile variables, which simplifies needed bindings in other phases. {build-tigervnc, build, install-tigervnc-aux, install}: Remove let*-bound variables. {build-tigervnc, build}: Honor PARALLEL-BUILD?. --- gnu/packages/vnc.scm | 162 ++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 86 deletions(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 84c84aec76..18244b3334 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -25,6 +25,7 @@ (define-module (gnu packages vnc) #:use-module (guix build-system cmake) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) @@ -207,6 +208,8 @@ (define-public tigervnc-client application which is needed to connect to VNC servers.") (license license:gpl2)))) +(define %tigervnc-client-source (package-source tigervnc-client)) + ;; A VNC server is, in fact, an X server so it seems like a good idea ;; to build on the work already done for xorg-server package. This is ;; not entirely compatible with the recommendation in BUILDING.txt @@ -221,47 +224,27 @@ (define-public tigervnc-server (inherit xorg-server) (name "tigervnc-server") (version (package-version tigervnc-client)) - (native-inputs - `(("tigervnc-src" ,(package-source tigervnc-client)) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("libtool" ,libtool) - ("gettext-minimal" ,gettext-minimal) - ("font-util" ,font-util) - ("cmake" ,cmake) - ("perl" ,perl) - ,@(package-native-inputs tigervnc-client) - ,@(package-inputs tigervnc-client) - ,@(package-native-inputs xorg-server))) - (inputs - (modify-inputs (package-inputs xorg-server) - (prepend perl coreutils xauth))) - (propagated-inputs - (modify-inputs (package-propagated-inputs xorg-server) - (prepend xauth))) (arguments (substitute-keyword-arguments (package-arguments xorg-server) ((#:configure-flags flags) - `(append '("--with-pic" ; Taken from BUILDING.txt - "--without-dtrace" - "--disable-static" - "--disable-dri2" - "--disable-xinerama" - "--disable-xvfb" - "--disable-xnest" - "--disable-xorg" - "--disable-dmx" - "--disable-xwin" - "--disable-xephyr" - "--disable-kdrive" - ;; "--disable-config-dbus" ; This was a warning. - "--disable-config-hal" - "--disable-config-udev" - "--disable-dri2" - ;; "--enable-install-libxf86config" ; This, too, was a warning. - "--enable-glx") - (delete "--enable-xephyr" ,flags))) + #~(cons* "--with-pic" ; Taken from BUILDING.txt + "--without-dtrace" + "--disable-static" + "--disable-dri2" + "--disable-xinerama" + "--disable-xvfb" + "--disable-xnest" + "--disable-xorg" + "--disable-dmx" + "--disable-xwin" + "--disable-xephyr" + "--disable-kdrive" + "--disable-config-hal" + "--disable-config-udev" + "--disable-dri2" + "--enable-glx" + (delete "--enable-xephyr" #$flags))) ((#:modules modules) `(append '((ice-9 ftw) (ice-9 match) @@ -269,55 +252,62 @@ (define-public tigervnc-server (guix build gnu-build-system)) modules)) ((#:phases phases) - `(modify-phases ,phases - (delete 'check) ;) - (add-after 'unpack 'copy-tvnc-xserver - (lambda _ - (let* - ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-xserver (string-append tvnc-src "/unix/xserver"))) - (copy-recursively tvnc-xserver ".")))) - (add-after 'copy-tvnc-xserver 'patch-xserver - (lambda _ - (invoke "patch" "-p1" "-i" - (string-append (assoc-ref %build-inputs "tigervnc-src") - "/unix/xserver21.1.1.patch")) - (invoke "autoreconf" "-fiv"))) - (add-before 'build 'build-tigervnc - (lambda _ - (let* ((out (assoc-ref %outputs "out")) - (tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build"))) - (mkdir-p tvnc-build) - (with-directory-excursion tvnc-build - (invoke "cmake" "-G" "Unix Makefiles" - (string-append "-DCMAKE_INSTALL_PREFIX=" out) - tvnc-src) - (invoke "make" "-j" (number->string (parallel-job-count))))))) - (replace 'build - (lambda _ - (let* ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (invoke "make" srcarg buildarg "-j" - (number->string (parallel-job-count)))))) - (add-before 'install 'install-tigervnc-aux - (lambda _ - (let* ((out (assoc-ref %outputs 'out)) - (tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (with-directory-excursion (string-append tvnc-build "/unix") - (invoke "make" srcarg buildarg "install"))))) - (replace 'install - (lambda* _ - (let* ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (invoke "make" "install" srcarg buildarg)))))))) + #~(modify-phases #$phases + (delete 'check) ;no test suite + (add-after 'unpack 'copy-tvnc-xserver + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (search-input-directory inputs "unix/xserver") + ".") + ;; Adjust Makefile variables default values to simplify usage. + (substitute* "hw/vnc/Makefile.am" + (("(TIGERVNC_SRCDIR=).*" _ head) + (string-append head #$%tigervnc-client-source "\n")) + (("(TIGERVNC_BUILDDIR=).*" _ head) + (string-append head (getcwd) "/tigervnc-build\n"))))) + (add-after 'copy-tvnc-xserver 'patch-xserver + (lambda* (#:key inputs #:allow-other-keys) + (invoke "patch" "-p1" "-i" + (search-input-file inputs "unix/xserver21.1.1.patch")) + (invoke "autoreconf" "-fiv"))) + (add-before 'build 'build-tigervnc + (lambda* (#:key parallel-build? #:allow-other-keys) + (mkdir-p "tigervnc-build") + (with-directory-excursion "tigervnc-build" + (invoke "cmake" "-G" "Unix Makefiles" + (string-append "-DCMAKE_INSTALL_PREFIX=" #$output) + #$%tigervnc-client-source) + (invoke "make" "-j" (number->string (if parallel-build? + (parallel-job-count) + 1)))))) + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (invoke "make" "-j" (number->string (if parallel-build? + (parallel-job-count) + 1))))) + (add-before 'install 'install-tigervnc-aux + (lambda _ + (invoke "make" "-C" "tigervnc-build/unix" "install"))) + (replace 'install + (lambda _ + (invoke "make" "install"))))))) + (native-inputs + (modify-inputs (append (package-native-inputs xorg-server) + (package-native-inputs tigervnc-client)) + (append %tigervnc-client-source + autoconf + automake + libtool + gettext-minimal + font-util + cmake + perl))) + (inputs + (modify-inputs (append (package-inputs xorg-server) + (package-inputs tigervnc-client)) + (prepend perl coreutils xauth))) + (propagated-inputs + (modify-inputs (package-propagated-inputs xorg-server) + (prepend xauth))) (description "TigerVNC is a client/server implementation of VNC (Virtual Network Computing). It provides enough performance to run even 3D and video applications. It also provides extensions for advanced authentication methods From patchwork Fri Sep 23 05:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42859 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2B9E527BBEA; Fri, 23 Sep 2022 06:03:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8F6CF27BBE9 for ; Fri, 23 Sep 2022 06:03:11 +0100 (BST) Received: from localhost ([::1]:40208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqE-0003YX-ME for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obap9-0003Um-Ou for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap9-00024f-0d for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap8-00054W-Rf for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 02/15] gnu: tigervnc-server: Move source production into origin snippet. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390927019300 (code B ref 58014); Fri, 23 Sep 2022 05:02:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:10 +0000 Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoH-00051D-P5 for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:10 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:45593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoF-00050g-Hl for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:08 -0400 Received: by mail-qk1-f177.google.com with SMTP id q11so7591269qkc.12 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7d3RN4pclyNx3ZU8um0Oa9v2Ov9R3zjQr8dtsPISf50=; b=dgYLnxUYzK8wvLEygseOQRiURPBezikkQmabsSxd7crbdKqxuLO5EJE4CyeTUoGFHK iXD8hY5akd2Y+OosF6Ou7G58H/yW41uNlE8EePpQ4rbwXaGi7QmbJWt2ErfDg0FXPrQH h+5J8fJYgEHJfbYaZCo9PFvCkijzz6TWmavZdS8xlE2qU5oQGZw+53Iqb5k9ThRsk4vn rKW0hhuplu7idSL11h/QjVDAjNALg5q5fw/FVRAnuoqqa6W65frXh08W8PUT8rWHP58G a66MKFwx5/baQ8bNPWfR9kATwJYs1gEsnZg5+uQTi0xB5SEOlNDNtz1VTL0j+eL4mbW0 iHXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7d3RN4pclyNx3ZU8um0Oa9v2Ov9R3zjQr8dtsPISf50=; b=u4FmrXfT4lSwbTZ1sLPQxqFz7h7IenJheT286fZICmts7kry6OPtdeE2A5zc8e58IC y7CwDWYiZIdYgoT/DzVLncRCdlbNt9wkvwgvUmLB00s5AlbwmoFIbdgu8KpwqZ/CBSN4 h9joMN5B0zclxAXSSAll6LI1apPvFhHP17A4S27Or+MbZcejUupFxvJ4ZIk+wNZn9ZRL 99N4VI9LVtxOON+PSV04NI9T3KXkroPcdo0hsuAyVE6Sf90+pfDWMwldByWjRFWyDrTk pkqoz9jykVjnBprlmEwsv1nMu+e54Z3io6M1xjulPybVlfUbz/OCPiLaUnHbsbcBy97U qCeA== X-Gm-Message-State: ACrzQf2QILTE3jCCw7PB6kIZ4Wcx3ALDe4ICp4uQlbp9SxZTxSxbQnNK E3sN6lU4GAj268nBb4RJk/5kZvvTJtE= X-Google-Smtp-Source: AMsMyM7L7n75kahbUuQMP/wY+sH2QWOWA+FpjbQoDAAdlbG8d8D7UQx69fgNCt7x3uqg8PFfdkUWCA== X-Received: by 2002:a05:620a:1651:b0:6cf:468f:aec7 with SMTP id c17-20020a05620a165100b006cf468faec7mr4344781qko.368.1663909261680; Thu, 22 Sep 2022 22:01:01 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:01 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:29 -0400 Message-Id: <20220923050042.29893-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This will make it possible to patch command references in source files, and also makes it more transparent as to what sources get used. * gnu/packages/vnc.scm (tigervnc-server): Re-flow comment. [source]: Inherit from xorg-server. Add a snippet. Use a patch to apply the xserver patch. Fix file name. [phases]{copy-tvnc-xserver, patch-xserver}: Delete phases. {build-tigervnc, install-tigervnc-aux}: Adjust accordingly. --- gnu/packages/vnc.scm | 70 ++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 18244b3334..e06dbcceb9 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -210,20 +210,49 @@ (define-public tigervnc-client (define %tigervnc-client-source (package-source tigervnc-client)) -;; A VNC server is, in fact, an X server so it seems like a good idea -;; to build on the work already done for xorg-server package. This is -;; not entirely compatible with the recommendation in BUILDING.txt -;; where the client is built first, then the source code of the X -;; server is copied into a subdir of the build directory, patched with -;; VNC additions and then build and installed as Xvnc. The procedure -;; was turned around, where TigerVNC code is downloaded and built -;; inside the Guix X server build dir. Also, the VNC patching process -;; for the X server is automated in a straightforward manner. +;; A VNC server is, in fact, an X server so it seems like a good idea to build +;; on the work already done for xorg-server package. This is not entirely +;; compatible with the recommendation in BUILDING.txt where the client is +;; built first, then the source code of the X server is copied into a subdir +;; of the build directory, patched with VNC additions and then build and +;; installed as Xvnc. The procedure was turned around, where TigerVNC code is +;; downloaded and built inside the Guix X server build dir. Also, the VNC +;; patching process for the X server is automated in a straightforward manner. (define-public tigervnc-server (package (inherit xorg-server) (name "tigervnc-server") (version (package-version tigervnc-client)) + (source + (origin + (inherit (package-source xorg-server)) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Copy the VNC extension into the xorg-server sources. + (copy-recursively #$(file-append %tigervnc-client-source + "/unix/xserver") + ".") + ;; Include a full copy of tigervnc-client sources, so that the + ;; complete sources involved are available and can be edited during + ;; the build. + (copy-recursively #$%tigervnc-client-source "tigervnc-client") + ;; Adjust the VNC extension build system files so that it refers + ;; to it. + (substitute* "hw/vnc/Makefile.am" + (("(TIGERVNC_SRCDIR=).*" _ head) + (string-append head "$(CURDIR)/../../tigervnc-client\n")) + (("(TIGERVNC_BUILDDIR=).*" _ head) + (string-append head + "$(CURDIR)/../../tigervnc-client/build\n"))) + ;; Ensure the Autotools build system gets re-bootstrapped. + (delete-file "configure"))) + ;; Patch the xorg-server build system so that it builds the VNC + ;; extension. + (patches (cons (file-append %tigervnc-client-source + "/unix/xserver21.1.1.patch") + (origin-patches (package-source xorg-server)))) + (file-name (string-append name "-" version ".tar.xz")))) (arguments (substitute-keyword-arguments (package-arguments xorg-server) @@ -254,28 +283,13 @@ (define-public tigervnc-server ((#:phases phases) #~(modify-phases #$phases (delete 'check) ;no test suite - (add-after 'unpack 'copy-tvnc-xserver - (lambda* (#:key inputs #:allow-other-keys) - (copy-recursively (search-input-directory inputs "unix/xserver") - ".") - ;; Adjust Makefile variables default values to simplify usage. - (substitute* "hw/vnc/Makefile.am" - (("(TIGERVNC_SRCDIR=).*" _ head) - (string-append head #$%tigervnc-client-source "\n")) - (("(TIGERVNC_BUILDDIR=).*" _ head) - (string-append head (getcwd) "/tigervnc-build\n"))))) - (add-after 'copy-tvnc-xserver 'patch-xserver - (lambda* (#:key inputs #:allow-other-keys) - (invoke "patch" "-p1" "-i" - (search-input-file inputs "unix/xserver21.1.1.patch")) - (invoke "autoreconf" "-fiv"))) (add-before 'build 'build-tigervnc (lambda* (#:key parallel-build? #:allow-other-keys) - (mkdir-p "tigervnc-build") - (with-directory-excursion "tigervnc-build" + (mkdir-p "tigervnc-client/build") + (with-directory-excursion "tigervnc-client/build" (invoke "cmake" "-G" "Unix Makefiles" (string-append "-DCMAKE_INSTALL_PREFIX=" #$output) - #$%tigervnc-client-source) + "..") (invoke "make" "-j" (number->string (if parallel-build? (parallel-job-count) 1)))))) @@ -286,7 +300,7 @@ (define-public tigervnc-server 1))))) (add-before 'install 'install-tigervnc-aux (lambda _ - (invoke "make" "-C" "tigervnc-build/unix" "install"))) + (invoke "make" "-C" "tigervnc-client/build/unix" "install"))) (replace 'install (lambda _ (invoke "make" "install"))))))) From patchwork Fri Sep 23 05:00:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42858 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9443F27BBE9; Fri, 23 Sep 2022 06:03:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B909B27BBEB for ; Fri, 23 Sep 2022 06:03:09 +0100 (BST) Received: from localhost ([::1]:38460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqC-0003W4-P1 for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obap9-0003Up-LX for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap9-00024v-Cu for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap9-00054d-7Y for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 03/15] gnu: tigervnc-server: Adjust PAM config. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390927419324 (code B ref 58014); Fri, 23 Sep 2022 05:02:03 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:14 +0000 Received: from localhost ([127.0.0.1]:39005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoM-00051a-Ap for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:14 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:37700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoI-000512-Ff for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:11 -0400 Received: by mail-qk1-f171.google.com with SMTP id s9so7621580qkg.4 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=rrMN1Vat9ijfF4QCd9DoBAHpRDC9Pvq6dLlFWwZfYas=; b=aFT8EWcHD7Y2Eyw/kSeez3NM/SiZkooBYk6XuSsnH9/0tjyfpaJBqC/3ycWE366mDG g1/leuNzSc0HKA8jE2+7znFi8vHoFoS23lNIXHngBfbMTHrlfb8mLozufZ7CnG+hL+Lz GxTyye4a4P9SvzOlvr4yn6U/xj534uIvkDTBX/qczi4ePrhU8dJVWj0Y7Z02QZt2ArSI MlNRBM8ARl6iXC3LdMMDzjS9nkmtpthLP0jGOkmk0+NAN/C7QfUFLFgVdR7EIWJZoGNE NqPvyNXsdcNJ2kUuOj/0z7vA+LvBVAMjFIDbraw6bRwvoexY/SFrVz93XkY+114z45cG zUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=rrMN1Vat9ijfF4QCd9DoBAHpRDC9Pvq6dLlFWwZfYas=; b=0jlegc428twNpcsGJOQtpp2304+NQY22xdKOHSiKip3JPpelo1jIZK/frOfZR4F9LV OJaocUK+dXZQmemvZubG0QTahmgkX7lEbWzv7+J6Lkpnk79Wqv4XEmklGCJb5H4koMxw jZGGljIsPcTDdr1lm+gh8CfMmO7pcBIEhbIs6AGZjNf/QwWmmYNwvE2WhigVkkOOmgYr qH+iunsI5IYRiNAF+FhuhDs6fr9OEoQFnSdCq7SSXoWRTGdpN8JD3ehFJC1Av+g+uFWS eggxIEBRBEiII8jjnulYpY3igUDtd+nsZEioUR0wdeIWkMFUl1OxyQFycosUiiH3gjK+ p0OQ== X-Gm-Message-State: ACrzQf0F/oFybp9Cz5rskbayWLk8YKPrjl4mzTzprfGv+JiFvlud+aWj A3lpYqxC/3Ej6NtRpsHGo9QelHI7Ezw= X-Google-Smtp-Source: AMsMyM5VPTmFaVp74ulF+ghsVAJG+sGxa4BIpn0edGzJ5HEnmTplVs6ij0HCPWnvehN/ARqxo27oAw== X-Received: by 2002:a37:bc84:0:b0:6ce:18a8:7e63 with SMTP id m126-20020a37bc84000000b006ce18a87e63mr4494848qkf.206.1663909264936; Thu, 22 Sep 2022 22:01:04 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:04 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:30 -0400 Message-Id: <20220923050042.29893-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vnc.scm (tigervnc-server) [phases]{adjust-pam-config}: New phase. --- gnu/packages/vnc.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index e06dbcceb9..4795ccc72a 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -283,6 +283,11 @@ (define-public tigervnc-server ((#:phases phases) #~(modify-phases #$phases (delete 'check) ;no test suite + (add-after 'unpack 'adjust-pam-config + (lambda _ + (substitute* "tigervnc-client/unix/vncserver/tigervnc.pam" + (("pam_systemd.so") + "pam_elogind.so")))) (add-before 'build 'build-tigervnc (lambda* (#:key parallel-build? #:allow-other-keys) (mkdir-p "tigervnc-client/build") From patchwork Fri Sep 23 05:00:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42860 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8C42E27BBEE; Fri, 23 Sep 2022 06:04:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 310E827BBEA for ; Fri, 23 Sep 2022 06:04:41 +0100 (BST) Received: from localhost ([::1]:45950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obarg-0004DN-7E for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:04:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapA-0003V3-3B for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap9-00025E-PX for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap9-00054k-Ke for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 04/15] gnu: tigervnc-server: Disable tests via #:tests?. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390927519330 (code B ref 58014); Fri, 23 Sep 2022 05:02:03 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:15 +0000 Received: from localhost ([127.0.0.1]:39007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoM-00051d-KL for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:14 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:41904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoL-000516-1q for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:13 -0400 Received: by mail-qk1-f180.google.com with SMTP id k12so7595937qkj.8 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=SQWUBH22HatYIVu1KvaAMAAMNza2QMTWgyGuOJuCu9c=; b=nDZcwRn6MAUgt9u6NBZGFlLVKoJcHq5THRNRov9bOKQnUIDJ4k6kavVRexYZOf4IUy 1rqnZmQJe/jTzJ1iDOkAEnhCAQxX6I0tVwS16Tj7p0EcQ7UL+ZWqkZTGMpyjMfgMJEnA nf4OmWNAIlN4BMPhIdIITqc+rHsQV+HvVyHC5R8+AKCKQnaa8qjttnMIoilVQNWX3KXx Pr3Sfw4e9S+LSbBAE9IpSIzDK8Z8RlKMdZ0EklMaP0Iv/xgYK+A6uck/ZvRbBTdA0gCr 5+ZRcxM8jQUlDxxTPGlH1yPMwkXlhLgxfLlf8nXaVMsbkhPaBVgb+OZJVk9dVDhERL8Q 1taA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=SQWUBH22HatYIVu1KvaAMAAMNza2QMTWgyGuOJuCu9c=; b=ejDMOQqUK+v3tq71r7Q1oKg8d6Yaxmqf3t5NLG96G/EwmayrM4PE4Z92vZZRadUaVV 6gZrg5bkCTqMozeOmjBstnXeaJFzT1rL0eqYqZQbnGNjkspdHnw7RDCLj8pSsY1v98ty Er7J8BuZTGLWAnn0hm0KXl5ZjvUxpCTJBO96BZPnQ3c6twFHve/WdqbnHBvrEpe3F5rF Hbb8UQq8gO91tt9vrRSlkuhadse+Gl3jqELML1tMQzLr/domlLesENwFMuSfC5i6XmnX 0a7vflW83MWGfdj0tw7CSYq4fO+DeTQ8aNOdBrxd4BRjVTTfCSS0etgu7MD8aSP7rtaO YtZw== X-Gm-Message-State: ACrzQf3Wy8RHkmTEtf/HNf8OamCP/vG68K2HJd8LoQZvkTDwtglXwH+C /lBZBMn576U3pSdBNIK33o+oYx1QALc= X-Google-Smtp-Source: AMsMyM5FK6ggqAOpJ8bVwiBdu67JvBC+VtAF0nNXAk++4uxceZCaemaYTzehTE5REJfoDgiXSnJeJA== X-Received: by 2002:ae9:ec07:0:b0:6cf:4190:246 with SMTP id h7-20020ae9ec07000000b006cf41900246mr4263741qkg.760.1663909267433; Thu, 22 Sep 2022 22:01:07 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:07 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:31 -0400 Message-Id: <20220923050042.29893-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vnc.scm (tigervnc-server) [tests?]: Set to #f. [phases]: Restore check phase. --- gnu/packages/vnc.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 4795ccc72a..3731f63846 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -256,6 +256,8 @@ (define-public tigervnc-server (arguments (substitute-keyword-arguments (package-arguments xorg-server) + ((#:tests? #f #f) + #f) ((#:configure-flags flags) #~(cons* "--with-pic" ; Taken from BUILDING.txt "--without-dtrace" @@ -282,7 +284,6 @@ (define-public tigervnc-server modules)) ((#:phases phases) #~(modify-phases #$phases - (delete 'check) ;no test suite (add-after 'unpack 'adjust-pam-config (lambda _ (substitute* "tigervnc-client/unix/vncserver/tigervnc.pam" From patchwork Fri Sep 23 05:00:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42861 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 574E727BBEA; Fri, 23 Sep 2022 06:04:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4942727BBEB for ; Fri, 23 Sep 2022 06:04:41 +0100 (BST) Received: from localhost ([::1]:45954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obarg-0004E7-Cd for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:04:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapA-0003V7-Cj for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapA-00025j-4f for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapA-00054s-07 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 05/15] gnu: tigervnc-server: Patch and wrap vncserver script. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390928119356 (code B ref 58014); Fri, 23 Sep 2022 05:02:03 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:21 +0000 Received: from localhost ([127.0.0.1]:39011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoT-000526-0o for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:21 -0400 Received: from mail-qv1-f43.google.com ([209.85.219.43]:40467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoO-00051L-6J for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:16 -0400 Received: by mail-qv1-f43.google.com with SMTP id m9so8342003qvv.7 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=RGBlvct8Jsz7Wmbi67KCUBu0t4ZTYYCVMdDoXMnWAS4=; b=qOE18y7rqZ8+Fo0lZN1/UWgjMFZIMlrisNEtzj5F9Zsil+GNVn57qku2XNW0XEYijk lZbWtpbXMTqrr+Kz0Bhvu9iwpPD8Y5pnfIiTNaSr2Xar6rFDz6ZgNs8VhGb8UuY0hPoz Sa0pQ2wdczHlkiu7XnKiTw8oAKMHZO6/H1lclaAcG//65wjdTIjTGjSRQ35c/lv73wZX xmFwLICNFoLtfg8XG7o9c30kUnHGD8tyOykuiQFTGJ3Jg8DQmc7T+2CKV/AzIbKVfqdm 9j7BibKSGjV2T6YAEMHeCCTueccEMIpgRjZeQAlfebJOSKLNA4nfGYG9wzWh0dWK/eh4 oJAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=RGBlvct8Jsz7Wmbi67KCUBu0t4ZTYYCVMdDoXMnWAS4=; b=JNNx0VZNMFkqANsq5xFd0VcWbH+Y26Dv0sedexf+BTlNdHlC8zomCZguiEIotqa9lA kwEr6JRLnKjUeEfnQhhmZxExAECDGNfy6IgUpgHYf0dGDG3YnJOm7aJ/GDfg1YtzPB39 1xRi2ZkF5aMBGugK6uI2QppSrdpMsM7ctVDCjsqF4EFcJ8b4Yflb6nYvPBLkZESMNhW2 b409f977prxVAahTuuKI4hFyN2IEXdX0HuD03p/bEEZ9JAJoYa9cJQylsvgnsjPYZtyw rMgvg85gkmJ3VzGHhBew7clbuXtAdIxa+hmudAFS7YwZhTBGaRgTkOYlbHxwN/H2g7vm Uc3g== X-Gm-Message-State: ACrzQf2g+MaQnKReBPVoXV/toi3ZkP65OIn9mIyXtHGlS0BIc+SUw3NI B5OBeqC+3E2y0s66EjFpHFmavMUMQBU= X-Google-Smtp-Source: AMsMyM6GFPZe52MJ9yoPDAvZ2OvG2MX2uipwC3ULKMQSmliD/hqZ9TK7ZibbNVH5R0aJBOlmkojaBQ== X-Received: by 2002:a05:6214:d0b:b0:4ad:8161:3d0a with SMTP id 11-20020a0562140d0b00b004ad81613d0amr4703691qvh.95.1663909269590; Thu, 22 Sep 2022 22:01:09 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:09 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:32 -0400 Message-Id: <20220923050042.29893-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vnc.scm (tigervnc-server): [phases]{patch-paths, wrap-vncserver}: New phases. [inputs]: Add font-alias, guile-3.0, util-linux and xinit. --- gnu/packages/vnc.scm | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 3731f63846..8bbccfb498 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -289,6 +289,31 @@ (define-public tigervnc-server (substitute* "tigervnc-client/unix/vncserver/tigervnc.pam" (("pam_systemd.so") "pam_elogind.so")))) + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "tigervnc-client/unix/vncserver/vncserver.in" + (("`mcookie`") + (format #f "`~a`" (search-input-file inputs "bin/mcookie"))) + ;; Adjust the places where the vncserver script looks for + ;; X11 fonts. + (("'/usr/share/X11/fonts'" all) + (format #f "'~a', '~a', ~a" + "/run/current-system/profile/share/fonts/X11" + (string-append #$(this-package-input "font-alias") + "share/fonts/X11") + all)) + ;; Adjust the location used to locate of the .desktop files. + (("/usr/share/xsessions") + "/run/current-system/profile/share/xsessions") + ;; Do not require a system-provided Xsession shell script, + ;; as Guix System has none. This causes the foreach loop to + ;; iterate an empty list (disabled). + (("\"/etc/X11/xinit/Xsession\", \"/etc/X11/Xsession\"") + "()") + (("if \\(not defined \\$Xsession)") + "if (0)") + (("@cmd, \\$Xsession,") + "@cmd,")))) (add-before 'build 'build-tigervnc (lambda* (#:key parallel-build? #:allow-other-keys) (mkdir-p "tigervnc-client/build") @@ -309,7 +334,16 @@ (define-public tigervnc-server (invoke "make" "-C" "tigervnc-client/build/unix" "install"))) (replace 'install (lambda _ - (invoke "make" "install"))))))) + (invoke "make" "install"))) + (add-after 'install 'wrap-vncserver + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-script (search-input-file outputs "libexec/vncserver") + (list "PATH" 'prefix + (map (lambda (p) + (dirname (search-input-file inputs p))) + '("bin/uname" + "bin/xauth" + "bin/xinit")))))))))) (native-inputs (modify-inputs (append (package-native-inputs xorg-server) (package-native-inputs tigervnc-client)) @@ -324,7 +358,13 @@ (define-public tigervnc-server (inputs (modify-inputs (append (package-inputs xorg-server) (package-inputs tigervnc-client)) - (prepend perl coreutils xauth))) + (prepend coreutils + font-alias + guile-3.0 + perl + util-linux + xauth + xinit))) (propagated-inputs (modify-inputs (package-propagated-inputs xorg-server) (prepend xauth))) From patchwork Fri Sep 23 05:00:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42865 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CFDF727BBEA; Fri, 23 Sep 2022 06:05:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8F10727BBE9 for ; Fri, 23 Sep 2022 06:05:11 +0100 (BST) Received: from localhost ([::1]:41314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obas9-0004wc-9D for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:05:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapA-0003VE-Ri for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapA-000263-JW for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapA-000550-Dm for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 06/15] gnu: gdm: Patch an extra reference to the Xsession script. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390928219363 (code B ref 58014); Fri, 23 Sep 2022 05:02:04 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:22 +0000 Received: from localhost ([127.0.0.1]:39014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoT-000529-FL for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:21 -0400 Received: from mail-qv1-f48.google.com ([209.85.219.48]:45859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoQ-00051T-DH for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:18 -0400 Received: by mail-qv1-f48.google.com with SMTP id mi14so8252595qvb.12 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=CaQmioIJ6LZ4K3Z8hf0hBfPSuZTrlpwCnno+ez1/itM=; b=lU8XQz9rIQHpEkDAQ66pDODWR+NUSTC3foSRabjJLCDY/SIf3ApuX88dcgmLt2n4XJ gbaqgrrRwDGYVecJK2OSZJe8nQopcTVeEIIAiHCzZ/7sxTITAAFY2UvkBWDJG+xhJq/R MM1nXSMesLf2NYlKwq02HdcedQLxbYngu9tdiLHiIVl2RvchuIUIohJ60k9wzEbX+eJV YFg3Vp06cvaw6hh6+D3TpaAdr8DOA+aGklECyJ4y/+kcTAOxFFv24yyv94D/kDmhETTd vcoEDDmEUisOIBvWImZ5GHbzFro7MBG8b9ofaLfqtVFQKyyNNBm9bZLj6mx0YxtbbfLh TK7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=CaQmioIJ6LZ4K3Z8hf0hBfPSuZTrlpwCnno+ez1/itM=; b=jA/wX/8ozDL0R80/frJwqmMQInPyCByyvpaNLzJ+VPRN2+XNG42I75dKNhTE+ddlYJ owcS8WkIorj8g86FK111Y7cJh70PktjWCPgDePOSPnv9I8LPFF63OsMCyEMyrk7ILylA ClPKIfminEhavaK+mKJ9jmvdaeeKmTcxVLVC6q+1Z0TYZ/7lS6CZkGR8o0apbIGNNEPw VPrYTtlFHs67XFr+fAgMsi8wlEpXqkYH0xy9kQFNxU5Ycbocmo7gt/SW/ZL4sgqLH+zQ vR3shCK1A2nrRWU2C1SiZ9ZLKk6evYbombcZHefv2/rLvRaBYPXb1D/TNoc7KL1IsPHY pFkw== X-Gm-Message-State: ACrzQf3qYPPUSZ0pIQr9NDD2wXA8e7YSQmtjaKVVba82GRbdoVPTLsG/ c5RDJI/X6n+Y2qiWENT2kjf8OIMXtGM= X-Google-Smtp-Source: AMsMyM4zaZSx5JbPVzMo8iWCxbZ41Nb+AAifh6AHIYZejUp+rNTyW+uWEpqqzONNCy056nHKDMhGGA== X-Received: by 2002:a05:6214:c44:b0:4ac:ad73:4c6a with SMTP id r4-20020a0562140c4400b004acad734c6amr5249876qvj.14.1663909272861; Thu, 22 Sep 2022 22:01:12 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:12 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:33 -0400 Message-Id: <20220923050042.29893-6-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Without this change, attempting to start a remote session over VNC would fail with: Sep 19 19:54:04 localhost gdm-session-worker: Gdm: GdmSessionWorker: child '/gnu/store/yy9wq647l37658vgi291a287ll9iw6dc-gdm-42.0/etc/gdm/Xsession' could not be started: No such file or directory * gnu/packages/gnome.scm (gdm)[phases]{patch-paths} : Patch a reference in so the Xsession script is correctly found via the GDM_X_SESSION environment variable. --- gnu/packages/gnome.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 0adb065eb5..facc8515f5 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -8830,7 +8830,10 @@ (define-public gdm "gdm_session_set_environment_variable " "(self, \"" name "\"," "g_getenv (\"" name "\"));\n")) - propagate))))) + propagate))) + ;; This is used by remote sessions, such as when using VNC. + (("\\(GDMCONFDIR \"/Xsession \\\\\"%s\\\\\"\", command)") + "(\"%s \\\"%s\\\"\", g_getenv (\"GDM_X_SESSION\"), command)"))) ;; Find the configuration file using an environment variable. (substitute* '("common/gdm-settings.c") (("GDM_CUSTOM_CONF") From patchwork Fri Sep 23 05:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42867 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 07EB827BBEB; Fri, 23 Sep 2022 06:05:47 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1923827BBEA for ; Fri, 23 Sep 2022 06:05:46 +0100 (BST) Received: from localhost ([::1]:49666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obasj-0005Qg-8l for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapB-0003VF-8D for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapA-00026K-W6 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapA-00055D-S1 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 07/15] services: gdm: Add a configuration field to enable XDMCP. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390928819381 (code B ref 58014); Fri, 23 Sep 2022 05:02:04 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:28 +0000 Received: from localhost ([127.0.0.1]:39016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoa-00052X-0d for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:28 -0400 Received: from mail-qt1-f171.google.com ([209.85.160.171]:35411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoT-00051q-9s for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:22 -0400 Received: by mail-qt1-f171.google.com with SMTP id g23so7773768qtu.2 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=mKtkUXsQ6/2gCIm55+oimAhOW2aN4vzuvy38TjlMnTU=; b=h8uHKOVDgmV94LDOq0ayMqo9o+ajdlEvCY1EM2PLVnYzdZCK6R8TyTPudOclZOfVVl mQfVpnFLBXuQ16kvmRqFmpr4ki5wet4WIkU6QRTSDUWb2aUo5el2wEd4xARYblBWb8zd b8hByeZ9lbvxIiMoy3Ii9SMwtNWFyfMbUih5TDYZnrYYkU6HGsu1gz4Khyhe7LoR6/f2 RER0vgWlLqhmCp+r6EgsWHwxiE/CdZnovMOiU1ROJ1IbFhiXyOmg4l0in85HhT5bnyXg Vd8dYGkmLlqz0eB64yJOjwJUoTVrcviUxsUF8Vw7ljrUuW827T3zLZHQ+cFTuS7IgNDE 3XAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=mKtkUXsQ6/2gCIm55+oimAhOW2aN4vzuvy38TjlMnTU=; b=tv/+KVZYDfGMYccAxXEclYnZwla+ZWHK2Zfzs52JKeogWdaWl+NRyDPt3Kc1glW/yh 41weKmORWbsT8L05A4UGZ5UnR4MSsuox6Ol9sLRBhqaD8ouW2m/X3JbkEEwR40uzTvoG EHTiPfcdMkqAlxIj0DLqmMm1c9UdFuLrsHzMBEwhsCYsu/mmbNAeZZwqFkxWGpjYS62s Av6xQH46U5IpCRI5+VqdnjuDWaNem3wbHBFV01rUv12nEE8dAR7srK4A3FmkXsFAhN+r btmF32PaPYR+apCuZVbQrHdEdqfcxxAX4qmJt/spNslyKm6U+J3tNn7syZcxKx1id0nq RnPw== X-Gm-Message-State: ACrzQf2gIhPrNGDGh8paaHXoCdddBZaEYbpiS1Gbx/5nCPRbDKWuq+Dw OEzZmazn7I9H/uu80/IOLuIGhH77m3s= X-Google-Smtp-Source: AMsMyM524xUY91+n6cD/Y41XCgfrGfQBfnGAipn6c5niOyKBwi6nqANllpBoC4swv57yeMQTWegmBQ== X-Received: by 2002:ac8:5cd5:0:b0:35b:bbd1:20ea with SMTP id s21-20020ac85cd5000000b0035bbbd120eamr5708796qta.549.1663909275616; Thu, 22 Sep 2022 22:01:15 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:15 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:34 -0400 Message-Id: <20220923050042.29893-7-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/xorg.scm ()[xdmcp?]: New field. * gnu/services/xorg.scm (gdm-configuration-file): Use it. Use (ice-9 format) to serialize boolean. (gdm-polkit-rules): New variable. (gdm-service-type): Use it to extend polkit. * doc/guix.texi (X Window): Document it. --- doc/guix.texi | 6 +++++ gnu/services/xorg.scm | 56 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index eb12efa85e..be1f2e0063 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21062,6 +21062,12 @@ Configuration of the Xorg graphical server. @item @code{x-session} (default: @code{(xinitrc)}) Script to run before starting a X session. +@item @code{xdmcp?} (default: @code{#f}) +When true, enable the X Display Manager Control Protocol (XDMCP). This +should only be enabled in trusted environments, as the protocol is not +secure. When enabled, GDM listens for XDMCP queries on the UDP port +177. + @item @code{dbus-daemon} (default: @code{dbus-daemon-wrapper}) File name of the @code{dbus-daemon} executable. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 3ff290c197..eb77822741 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -63,6 +63,7 @@ (define-module (gnu services xorg) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) + #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (xorg-configuration xorg-configuration? @@ -885,6 +886,8 @@ (define-record-type* (default (xorg-configuration))) (x-session gdm-configuration-x-session (default (xinitrc))) + (xdmcp? gdm-configuration-xdmcp? + (default #f)) (wayland? gdm-configuration-wayland? (default #f)) (wayland-session gdm-configuration-wayland-session (default gdm-wayland-session-wrapper))) @@ -913,18 +916,20 @@ (define (gdm-configuration-file config) ;; See also ;; . "InitialSetupEnable=false\n" - "WaylandEnable=" (if (gdm-configuration-wayland? config) - "true" - "false") "\n" + (format #f "WaylandEnable=~:[false~;true~]~%" + (gdm-configuration-wayland? config)) "\n" "[debug]\n" - "Enable=" (if (gdm-configuration-debug? config) - "true" - "false") "\n" + (format #f "Enable=~:[false~;true~]~%" + (gdm-configuration-debug? config)) "\n" "[security]\n" "#DisallowTCP=true\n" - "#AllowRemoteAutoLogin=false\n")) + "#AllowRemoteAutoLogin=false\n" + "\n" + "[xdmcp]\n" + (format #f "Enable=~:[false~;true~]~%" + (gdm-configuration-xdmcp? config)))) (define (gdm-pam-service config) "Return a PAM service for @command{gdm}." @@ -995,6 +1000,41 @@ (define (gdm-shepherd-service config) (stop #~(make-kill-destructor)) (respawn? #t)))) +(define gdm-polkit-rules + (lambda (config) + (if (gdm-configuration-xdmcp? config) + ;; Allow remote (XDMCP) users to use colord; otherwise an + ;; authentication dialog would appear on the GDM screen (see the + ;; upstream bug: + ;; https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/273). + (list (computed-file + "02-allow-colord.rules" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (let* ((rules.d + (string-append #$output + "/share/polkit-1" + "/rules.d")) + (allow-colord.rules (string-append + rules.d + "/02-allow-colord.rules"))) + (mkdir-p rules.d) + (call-with-output-file allow-colord.rules + (lambda (port) + ;; This workaround enables any local or remote in + ;; the "users" group to use colord (see: + ;; https://c-nergy.be/blog/?p=12073). + (format port "\ +polkit.addRule(function(action, subject) { + if (action.id.match(\"org.freedesktop.color-manager\")) { + polkit.log(\"POLKIT DEBUG returning YES for action: \" + action); + return polkit.Result.YES; + } +});~%")))))))) + '()))) + (define gdm-service-type (handle-xorg-configuration gdm-configuration (service-type (name 'gdm) @@ -1005,6 +1045,8 @@ (define gdm-service-type (const %gdm-accounts)) (service-extension pam-root-service-type gdm-pam-service) + (service-extension polkit-service-type + gdm-polkit-rules) (service-extension profile-service-type gdm-configuration-gnome-shell-assets) (service-extension dbus-root-service-type From patchwork Fri Sep 23 05:00:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42856 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1CAC227BBEE; Fri, 23 Sep 2022 06:03:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 631F027BBEA for ; Fri, 23 Sep 2022 06:03:09 +0100 (BST) Received: from localhost ([::1]:40206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqC-0003XW-H0 for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapB-0003VG-MX for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39961) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapB-00026X-EB for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapB-00055K-9N for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 08/15] marionette: Make marionette-screen-text private. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390929819405 (code B ref 58014); Fri, 23 Sep 2022 05:02:05 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:38 +0000 Received: from localhost ([127.0.0.1]:39019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoj-00052v-GS for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:37 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:35573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoh-00052h-Fc for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:35 -0400 Received: by mail-qv1-f45.google.com with SMTP id w4so8373046qvp.2 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=9prbEq2F5yTDd06Ah6jMzI+2nqnFue97ZLq7lKjnP7g=; b=ILR+KSCkDxg3uZftpV6oyFkUEUy0oY+0Vd+c0lpKFn8YhcyXNHljenIHoAnN6jN/mU qUiQNYPU3WkRVmJMjYItm03rSdywyBM9N8C9EF7zYE/KaQ2K2A2/xAYzj7CcRJyfBoN5 m285yUSwf9puEIy+enlGwAI5BtCx71eB2IFH4qGVlqaN333CiU7OElSgyb+rN95CCMNB rV0eLytj1XseFv2EQSfehUp8cJfCCry3OIuqO5jI59ennvwZf4mBdbNxG83a25eFrb/l t1TlK0t6swaI8S3wDypLf3Llnt91potLC+yM07OH4kasX2DZ0BAr3N0PnXVGqmfEBYtP XUlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=9prbEq2F5yTDd06Ah6jMzI+2nqnFue97ZLq7lKjnP7g=; b=IPVWpDW6bvIfMXCnSej6EXDVvJ4msH8+UWqIgkhq5BWbWNYnJByOcQyBog5R9TyFmu JTHlj9me4sAEFZOX1i31ep14GYiG4Qi5OiKLh4Jn/mAYnHZYDwQpVqyzc+yuUzRjfrjS 2VeXg71BPkcu7pmGeutFiTypUWDqilek2CnDLSyKZ3wRxyx2h8kIGcB5I4khtMYAYnLp eQyTPZTvoN7yZkkwcF/7SYfum2KaJtSHnG7h6re2uCEEWsA/0uhKFsnoLsTvYxctG5bU WppOerymuSlsD9ZTI+6Kr41VXFFNTb4x5BoHgmf7SOhtlEwFOLj06zNRwOgcnnjxcDK/ /TVg== X-Gm-Message-State: ACrzQf0VgTSnL0FngIvcUFkam8PSivagb3O41KdZfa0ouRgictupUpMY vVmAKxrWQzZfmAdTnswZLf8Bt23tDHk= X-Google-Smtp-Source: AMsMyM4yni3ET2BNKT4qVmsUMFgwboPsTusqCWMcB+s5zgmPOTdFQ8vXzGm0i92aq7s5OecwTbha0A== X-Received: by 2002:a05:6214:c48:b0:4ac:b18d:c101 with SMTP id r8-20020a0562140c4800b004acb18dc101mr5472630qvj.107.1663909289882; Thu, 22 Sep 2022 22:01:29 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:29 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:35 -0400 Message-Id: <20220923050042.29893-8-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches It has only one user, which is better suited for wait-for-screen-text anyway. * gnu/tests/base.scm (run-basic-test): Refactor to use wait-for-screen-text instead of marionette-screen-text. --- gnu/build/marionette.scm | 1 - gnu/tests/base.scm | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 5ebf783892..aba6fb8146 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -33,7 +33,6 @@ (define-module (gnu build marionette) wait-for-tcp-port wait-for-unix-socket marionette-control - marionette-screen-text wait-for-screen-text %qwerty-us-keystrokes marionette-type diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 636b127fb8..64cd6a911a 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -509,18 +510,18 @@ (define (entry->list entry) (file-exists? capture)))) (test-assert "screen text" - (let ((text (marionette-screen-text marionette - #:ocr - #$(file-append ocrad - "/bin/ocrad")))) - ;; Check whether the welcome message and shell prompt are - ;; displayed. Note: OCR confuses "y" and "V" for instance, so - ;; we cannot reliably match the whole text. - (and (string-contains text "This is the GNU") - (string-contains text - (string-append - "root@" - #$(operating-system-host-name os)))))) + (wait-for-screen-text + marionette + (lambda (text) + ;; Check whether the welcome message and shell prompt are + ;; displayed. Note: OCR confuses "y" and "V" for instance, so + ;; we cannot reliably match the whole text. + (and (string-contains text "This is the GNU") + (string-contains text + (string-append + "root@" + #$(operating-system-host-name os))))) + #:ocr #$(file-append ocrad "/bin/ocrad"))) (test-end)))) From patchwork Fri Sep 23 05:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42866 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1302427BBEA; Fri, 23 Sep 2022 06:05:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 26F5227BBE9 for ; Fri, 23 Sep 2022 06:05:13 +0100 (BST) Received: from localhost ([::1]:41316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obasC-0004xc-8o for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:05:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapC-0003Vm-3J for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapB-00027N-R4 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapB-00055R-Mh for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 09/15] marionette: Preserve screen dumps on failures. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390930119422 (code B ref 58014); Fri, 23 Sep 2022 05:02:05 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:41 +0000 Received: from localhost ([127.0.0.1]:39022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaom-00053A-Tj for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:41 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:35795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaok-00052k-95 for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:39 -0400 Received: by mail-qk1-f176.google.com with SMTP id u28so7622048qku.2 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=yxTJ0RHjxT2PAZ/e46LJmnN5mf7/op5i0642uJjm5ho=; b=Vq/GKIuVWIR4ABBiwllXxcyUT5AsjHdE6cxXu1opN0DP38FpUj2GP330PzgyDxMRrd Yd9GPwKfYJOtaNMFF6NX7r6h3B/ZFfDIbcZBZLGWOS736mXBxnaOXrE0av8NYciwkaYT 7VlgmjTCg3sNfeL1+seZmXJyEwQ5x04bhKf0mxre8GqTt2xGBKCS1tkna++xYWLpAjM4 IHr7tNoBJXmKhRfDNEYp9qIzEBjG75sv94LiNMH1U6/otqRWVBZh5UlkbuoT5mpGr5Mf PuwsjAyptPHbXmD5xJcW9ME+L4RhbNtQBkSpubivmyqIF9f0amwcmEQ+O64iKqNVbW/8 zyvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=yxTJ0RHjxT2PAZ/e46LJmnN5mf7/op5i0642uJjm5ho=; b=U1CZbOhFlnqmPjgyNVbDMW5jsjKrhODAoFKLxoQVrfsB6mZp+tkS03eW7MG81QKQO3 fmBFktlZJ2PtlpAJLQ1YBLKVWxgSdDka3iLLHUS930wm9j7JgxKIg0bBgF8t9CsVPBt+ fRuCN9196IETNPQROI6mSHyHoLuLgzIF3W/RSAq3jYE/c+ZFU67/nMrSDixj7/ttqNJC Bqpb3B7VbldMd5UyrwLt8j0kahGcWerf4tE2CqoxO4NlVaH5EPoAlH/31l6JiQWX8xaB S2BvCP8JQhZ5EmnwUmlumMFX76NRo6BA8Zgw7HyngOdg7BVt+DR06JfXKgJ7f0zzQd/q Lpkg== X-Gm-Message-State: ACrzQf0BMyU3IKXfP1oNVCtYiq0RM28kIiSUsrfZC0xEsn7FDRJtq2en 1PX6kzCtIxSVWQo8TpmQaEcB3NNLk18= X-Google-Smtp-Source: AMsMyM6iLz85No34uDd0aXO243P2nWTVUIWrPKafNVcHqWuKKA6COaNtPO5tkm/ClDIE2bdWKGm4lA== X-Received: by 2002:a05:620a:4155:b0:6ce:3e4f:9b1c with SMTP id k21-20020a05620a415500b006ce3e4f9b1cmr4453443qko.744.1663909292237; Thu, 22 Sep 2022 22:01:32 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:31 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:36 -0400 Message-Id: <20220923050042.29893-9-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This is to make it easier to debug test failures involving 'wait-for-screen-text': the screendump image used for the OCR is now preserved for inspection when 'wait-for-screen-text' fails. * gnu/build/marionette.scm (marionette-screen-text): Return the screendump image file as the second value. Adjust doc. (wait-for-screen-text): Add the preserved screendump image file name to the error message. Adjust doc. --- gnu/build/marionette.scm | 42 +++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index aba6fb8146..5f8a74717a 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -22,6 +22,7 @@ (define-module (gnu build marionette) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) + #:use-module (srfi srfi-71) #:use-module (rnrs io ports) #:use-module (ice-9 match) #:use-module (ice-9 popen) @@ -311,18 +312,20 @@ (define* (invoke-tesseract-ocr image #:key (tesseract "tesseract")) (define* (marionette-screen-text marionette #:key (ocr "ocrad")) "Take a screenshot of MARIONETTE, perform optical character -recognition (OCR), and return the text read from the screen as a string. Do -this by invoking OCR, which should be the file name of GNU Ocrad's -@command{ocrad} or Tesseract OCR's @command{tesseract} command." +recognition (OCR), and return the text read from the screen as a string, along +the screen dump image used. Do this by invoking OCR, which should be the file +name of GNU Ocrad's@command{ocrad} or Tesseract OCR's @command{tesseract} +command. The screen dump image returned as the second value should be deleted +if it is not needed." (define image (string-append (tmpnam) ".ppm")) ;; Use the QEMU Monitor to save an image of the screen to the host. (marionette-control (string-append "screendump " image) marionette) ;; Process it via the OCR. (cond ((string-contains ocr "ocrad") - (invoke-ocrad-ocr image #:ocrad ocr)) + (values (invoke-ocrad-ocr image #:ocrad ocr) image)) ((string-contains ocr "tesseract") - (invoke-tesseract-ocr image #:tesseract ocr)) + (values (invoke-tesseract-ocr image #:tesseract ocr) image)) (else (error "unsupported ocr command")))) (define* (wait-for-screen-text marionette predicate @@ -330,21 +333,34 @@ (define* (wait-for-screen-text marionette predicate (ocr "ocrad") (timeout 30)) "Wait for TIMEOUT seconds or until the screen text on MARIONETTE matches -PREDICATE, whichever comes first. Raise an error when TIMEOUT is exceeded." +PREDICATE, whichever comes first. Raise an error when TIMEOUT is exceeded. +The error contains the recognized text along the preserved file name of the +screen dump, which is relative to the current working directory." (define start (car (gettimeofday))) (define end (+ start timeout)) - (let loop ((last-text #f)) + (let loop ((last-text #f) + (last-screendump #f)) (if (> (car (gettimeofday)) end) - (error "'wait-for-screen-text' timeout" 'ocr-text: last-text) - (let ((text (marionette-screen-text marionette #:ocr ocr))) - (or (predicate text) - (begin - (sleep 1) - (loop text))))))) + (let ((screendump-backup (string-drop last-screendump 5))) + ;; Move the file from /tmp/fileXXXXXX.pmm to the current working + ;; directory, so that it is preserved in the test derivation output. + (copy-file last-screendump screendump-backup) + (delete-file last-screendump) + (error "'wait-for-screen-text' timeout" + 'ocr-text: last-text + 'screendump: screendump-backup)) + (let* ((text screendump (marionette-screen-text marionette #:ocr ocr)) + (result (predicate text))) + (cond (result + (delete-file screendump) + result) + (else + (sleep 1) + (loop text screendump))))))) (define %qwerty-us-keystrokes ;; Maps "special" characters to their keystrokes. From patchwork Fri Sep 23 05:00:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42864 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 35E8327BBEA; Fri, 23 Sep 2022 06:05:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 07E7127BBE9 for ; Fri, 23 Sep 2022 06:05:10 +0100 (BST) Received: from localhost ([::1]:41318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obas9-0004y1-78 for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapD-0003W5-4p for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapC-00028H-Sj for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapC-00055i-Nu for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 10/15] marionette: Define keystrokes for typing colons and exclamation marks. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390931319458 (code B ref 58014); Fri, 23 Sep 2022 05:02:06 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:53 +0000 Received: from localhost ([127.0.0.1]:39028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoy-00053m-Mw for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:52 -0400 Received: from mail-qt1-f177.google.com ([209.85.160.177]:43963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaou-00053K-N7 for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:49 -0400 Received: by mail-qt1-f177.google.com with SMTP id a20so7739804qtw.10 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=MXwTb34Zyubi2XkK1YTc7ozqMrIhPJ5UPc6c4y6kf0Q=; b=QaerlZfu4Qua2XUYOCb4CBm1Unz2SuPNYIbhcLaJaOpFHcpQ8N5fynhfq9ilcWzkQA 26ij18LuFYxtGrP5R6mW00d1OdTczygvEGw6uxVSbIB9b0YTvKCE7TsKiTf3e4MG0IR/ st3e1up9gUjL+0myze91m1VqPTM2EcytBLI+0QIVX4MPi+2vrF21YSjPgnxdGOW18lqo Rvk6YdxKeq3H3ZYCwx/wu2sZC0HCpFceEm8h2PYX+XE/D+OHXzAmZsUjpiwV7f032N3Q 8ghSxsC8Lfwc17P2fjwCJ+HQ8tCK3a+Ps01zhoWnh+mO/x3jewWUdMKIqbvF2cIuIi8P xkGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=MXwTb34Zyubi2XkK1YTc7ozqMrIhPJ5UPc6c4y6kf0Q=; b=eZlRNhKX5uy0J2jz0QsR5okWNC7WInpqXucoya/NFniHE6I79L6Dj6XSWmXrljYKP4 HS4H7L8J/h970SQNU8J6s//PlLMOFlEpEApVHdyFARmz6G7SZm7G1nbCxM0kckElnS6t 4KSQszY50mF5xxCpMpe/FQQxX+y6bTqvIILaBUnnRPlw9FRoIJsbLItN5m3K13tmcsTE s7+KesdNE7EzYApPktaxw40JWAgo5WvL2oJmyknAR4QNhGTsE/iuQkKQyrrV/9C6e89G G6+QPYvbizulqRBR3izRwYCSQu6ASopbsep+KGjcbMSRuXRvW9ZMvzxAI44HOB3OKVTh 6SjA== X-Gm-Message-State: ACrzQf2vMH8PDe0tmCFuUwZESbJq2R5GZSHiUvOAFy6jtAfsyYV3Bvk4 DeEzXcCZRGq7juzs+AI2js9CjQNZpe4= X-Google-Smtp-Source: AMsMyM5tH1Tj1+gclepNSqr5/3xr3g4UtlpWZNJL+pcjfsfTz5kQMSBNdKjjjrWWbES/3Asg17GuMw== X-Received: by 2002:ac8:5712:0:b0:35c:d6ad:6707 with SMTP id 18-20020ac85712000000b0035cd6ad6707mr5930243qtw.16.1663909302791; Thu, 22 Sep 2022 22:01:42 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:42 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:37 -0400 Message-Id: <20220923050042.29893-10-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/build/marionette.scm (%qwerty-us-keystrokes): Register keystrokes for the ':' and '!' characters. --- gnu/build/marionette.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 5f8a74717a..6f373f87b6 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -382,8 +382,10 @@ (define %qwerty-us-keystrokes (#\> . "shift-dot") (#\. . "dot") (#\, . "comma") + (#\: . "shift-semicolon") (#\; . "semicolon") (#\' . "apostrophe") + (#\! . "shift-1") (#\" . "shift-apostrophe") (#\` . "grave_accent") (#\bs . "backspace") From patchwork Fri Sep 23 05:00:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42862 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8B53127BBEA; Fri, 23 Sep 2022 06:04:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 551EE27BBE9 for ; Fri, 23 Sep 2022 06:04:43 +0100 (BST) Received: from localhost ([::1]:45952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obari-0004E0-Fb for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:04:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapC-0003W2-J3 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapC-00027v-Bd for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapC-00055a-6U for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 11/15] marionette: Add a callback arguments to wait-for-screen-text. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390930819441 (code B ref 58014); Fri, 23 Sep 2022 05:02:06 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:48 +0000 Received: from localhost ([127.0.0.1]:39025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaou-00053V-Cu for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:48 -0400 Received: from mail-qv1-f48.google.com ([209.85.219.48]:45859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaos-00051T-L7 for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:46 -0400 Received: by mail-qv1-f48.google.com with SMTP id mi14so8253264qvb.12 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Au9ibFtg5LHvs398x3Sz0OKX1319Qsp45Mew591e/zY=; b=Q3UTHMAtyKZvJ1zK/LxJVdKS0UXQwCkNYbZNBHZ67z2xEunMfqUi7YnFxi8wEpXNWN ktndJcmj+qAT5NgPatWoi0pwxH7s9qf0y6xostoyLYidl98MVoWCCRMvttlUp20gLys1 Szrd4w71PTXNBjKtgSmPJBSVnHTKuXQAsdf13aEdTZs3b4U4ISayqXxN2zN5C1eDIFJs 5Z2WNs04dI2L0TvKHL4wadZPcuxM8Y1tqc1neKIYwZGw6xCy1gA7IedzywpOp2gIqQ5Y c6YbhmqeCb9/bb+VcdFrcEbTz26O2K07JgrRBhtlGLnE8PIBJ4R0YhIOdHDJZrjoPKcF h4bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Au9ibFtg5LHvs398x3Sz0OKX1319Qsp45Mew591e/zY=; b=Pcg+20wMR62czOImlTEA3C+rYVw6t7tiZ5s45D/oBt40xccanCsNLnjdjGrVca4nzV Z0Qx0Je303VlhZV87IuGt5ZYQvWU21ZnVIDvRzULWehkOW5MYKpy0R+44Lom2dz6smG1 /KT86VyjQhdyZyRW/Obxw39/yCbd2FVh5SEp3X8WReOQfBiE+LtlNqWW64IBPA0clXmq X0gTRTVPC6ELETE4Ovpo6DP0E4btWSC+jiRatWVuvI6c5G67uxfOfVS+FvnC5IF39eNw REBLKGhaPYtsjiSTygqB+gLZGQTp38XfmuA0nWuWaFjtR2Ck8Oqsm3/kokanqCuAZrRa V3MQ== X-Gm-Message-State: ACrzQf2Y7yb2l9i8Ga+joqxCI2Wvy2hQFP7TBBRItQPOa8xtOkQc6f6J WTouphG7bVeajWqpvwfsuwAGDpeP2WI= X-Google-Smtp-Source: AMsMyM7krg5N2kUZTWXn3lu/iWEx7E7mUPJ6/ofTO1AjcfV+inovwWBfHGSpXInm6VuJBw9XbbL8vw== X-Received: by 2002:a05:6214:c2a:b0:4ac:c5b7:e5cc with SMTP id a10-20020a0562140c2a00b004acc5b7e5ccmr5544530qvd.55.1663909306198; Thu, 22 Sep 2022 22:01:46 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:45 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:38 -0400 Message-Id: <20220923050042.29893-11-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/build/marionette.scm (wait-for-screen-text): New 'pre-action' and 'post-action' arguments. Update doc. Call the procedures before and after the OCR occurs, respectively. --- gnu/build/marionette.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 6f373f87b6..f4b219e842 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -331,11 +331,15 @@ (define image (string-append (tmpnam) ".ppm")) (define* (wait-for-screen-text marionette predicate #:key (ocr "ocrad") - (timeout 30)) + (timeout 30) + pre-action + post-action) "Wait for TIMEOUT seconds or until the screen text on MARIONETTE matches PREDICATE, whichever comes first. Raise an error when TIMEOUT is exceeded. The error contains the recognized text along the preserved file name of the -screen dump, which is relative to the current working directory." +screen dump, which is relative to the current working directory. If +PRE-ACTION is provided, it should be a thunk to call before each OCR attempt. +Likewise for POST-ACTION, except it runs at the end of a successful OCR." (define start (car (gettimeofday))) @@ -353,7 +357,9 @@ (define end (error "'wait-for-screen-text' timeout" 'ocr-text: last-text 'screendump: screendump-backup)) - (let* ((text screendump (marionette-screen-text marionette #:ocr ocr)) + (let* ((_ (and (procedure? pre-action) (pre-action))) + (text screendump (marionette-screen-text marionette #:ocr ocr)) + (_ (and (procedure? post-action) (post-action))) (result (predicate text))) (cond (result (delete-file screendump) From patchwork Fri Sep 23 05:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42869 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5B50A27BBE9; Fri, 23 Sep 2022 06:06:53 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ABBA927BBEB for ; Fri, 23 Sep 2022 06:06:48 +0100 (BST) Received: from localhost ([::1]:37640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obatj-0005rA-Qb for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:06:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapD-0003W6-RV for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapD-00028q-JY for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapD-00055w-E8 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 12/15] gnu: dconf: Set sysconfdir to /etc. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390931719476 (code B ref 58014); Fri, 23 Sep 2022 05:02:07 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:57 +0000 Received: from localhost ([127.0.0.1]:39031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obap2-000544-Vv for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:57 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:45665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obap0-00053i-IA for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:55 -0400 Received: by mail-qt1-f178.google.com with SMTP id r20so7739035qtn.12 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=IQZko2oOGrA/f8sPxCUQ3/noROWlUX5hkYy3q9mAWjw=; b=gVQKJMPHUFjXs+Idx/obq0CQp90wccYQuJUfC4gDvmsyC1KNykNr7rg9Dq5Fj0Jb2Y 9HztuEjxFtKM5W7Y/0d1rOuQhwiJoisAG306uX07XtcFkHJTE7fegbwD6lG6NVJroGZk Kenjf1rPmqb9RFFIIRrE0/mnnVuTuakh2/6p84grdfgEf9wQKASUhBPZ0prw5xEuwKE0 IA/Br0vMQ49nCbE3/Jgjb7bt1a1OeDs9iQzq5ET5ZLPWrIxIlewUksaXDtyAaJoyWsG2 8Z5L+IiAh3d9pS71atMw8MkC3WKkJ4/+P/A0j8ZFkNqiakn7opKIlcPoeJbNIlXZMqqi ehpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=IQZko2oOGrA/f8sPxCUQ3/noROWlUX5hkYy3q9mAWjw=; b=EFQwBRBSR5H65oVstct4lDANv/L/Z0jjKzZ69v/JOvkg8ydG1SE76xJrj+cIOKAFwL /pE2+DdEO8cWuv9ad0/obnUeyQIubrYMq4n4/LNK2obhdILOYX8A6OxzwGw+jthHBhjf NV7dBO74FhSR4jbYKtDhnQ/ub6KHiHuqE7kw5zx1u6F3BY68lcieF+v11MIXVHircMcs Cb6QA3z8iurEJyjQQCmE70dxRVPs5ULY0CAwYjEvdYzIn+OtOMUEQECivbxITU0Lq7dF iFB86BOhEZpxacDs4ECvDbKoPqteXjCnjyYXE4OaIQLCZpF5vGx8p7A8kqaoZV+I28tb GAag== X-Gm-Message-State: ACrzQf1PQBAQm23kYdOP8TvN/HUBIz+15CTXOQGZeBuFfyc9+z1SZNPi V/64jkReOMajhMjXjpq1Bs7GkccTr0A= X-Google-Smtp-Source: AMsMyM43uQhY4Mdop4PcXrSkPD5/jrFufatx6DbCUo2Iu1bplI4s96ibZQzPCgW0el1vVbcX0P/m2A== X-Received: by 2002:a05:622a:110b:b0:35c:d403:6d95 with SMTP id e11-20020a05622a110b00b0035cd4036d95mr5980034qty.495.1663909308983; Thu, 22 Sep 2022 22:01:48 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:48 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:39 -0400 Message-Id: <20220923050042.29893-12-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/gnome.scm (dconf) [arguments]: Use gexps. [configure-flags]: Add --sysconfdir=/etc. [native-inputs]: Remove labels. --- gnu/packages/gnome.scm | 54 +++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index facc8515f5..24d869f496 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -4719,33 +4719,39 @@ (define-public dconf (base32 "0cs5nayg080y8pb9b7qccm1ni8wkicdmqp1jsgc22110r6j24zyg")))) (build-system meson-build-system) + (arguments + (list + #:glib-or-gtk? #t + ;; Configure sysconfdir to /etc so that gconf profiles can be written + ;; there and loaded without having to set GCONF_PROFILE, which cannot be + ;; safely set globally (as a gconf profile is a per-user thing). + #:configure-flags #~(list "--sysconfdir=/etc" + "-Dgtk_doc=true") + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'increase-test-timeout + (lambda _ + ;; On big-memory systems, the engine test may take + ;; much longer than the default of 30 seconds. + (substitute* "tests/meson.build" + (("test\\(unit_test\\[0\\], exe" all) + (string-append all ", timeout: 300")))))))) + (native-inputs + (list bash-completion + libxslt ;for xsltproc + libxml2 ;for XML_CATALOG_FILES + docbook-xml-4.2 + docbook-xsl + `(,glib "bin") + gtk-doc/stable + pkg-config + python + vala)) + (inputs + (list gtk+ + dbus)) (propagated-inputs ;; In Requires of dconf.pc. (list glib)) - (inputs - (list gtk+ dbus)) - (native-inputs - `(("bash-completion" ,bash-completion) - ("libxslt" ,libxslt) ;for xsltproc - ("libxml2" ,libxml2) ;for XML_CATALOG_FILES - ("docbook-xml" ,docbook-xml-4.2) - ("docbook-xsl" ,docbook-xsl) - ("glib:bin" ,glib "bin") - ("gtk-doc" ,gtk-doc/stable) - ("pkg-config" ,pkg-config) - ("python" ,python) - ("vala" ,vala))) - (arguments - `(#:glib-or-gtk? #t - #:configure-flags '("-Dgtk_doc=true") - #:phases (modify-phases %standard-phases - (add-after 'unpack 'increase-test-timeout - (lambda _ - ;; On big-memory systems, the engine test may take - ;; much longer than the default of 30 seconds. - (substitute* "tests/meson.build" - (("test\\(unit_test\\[0\\], exe" all) - (string-append all ", timeout: 300")))))))) (home-page "https://developer.gnome.org/dconf/") (synopsis "Low-level GNOME configuration system") (description "Dconf is a low-level configuration system. Its main purpose From patchwork Fri Sep 23 05:00:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42868 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2F6CC27BBEA; Fri, 23 Sep 2022 06:05:47 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2C09827BBE9 for ; Fri, 23 Sep 2022 06:05:46 +0100 (BST) Received: from localhost ([::1]:49670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obasj-0005R8-BE for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obapE-0003WA-El for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obapE-000292-6d for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obapD-000568-Uf for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 13/15] services: Add dconf-service-type. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390932719585 (code B ref 58014); Fri, 23 Sep 2022 05:02:07 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:02:07 +0000 Received: from localhost ([127.0.0.1]:39044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obapC-00055g-Ch for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:07 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:43787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obap7-000542-3H for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:04 -0400 Received: by mail-qk1-f172.google.com with SMTP id o7so7595290qkj.10 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=U1HkKxRdYtzaXlosQJop0EQ8TbtfcuxI0l5QCODE6Ps=; b=a7ZfjfYwIPVVEonuIm45c9oN403tziBQgrjROFMMgO2WhDU5tgVYKcLkAKnnt2yQWP zx9TH/CB5sF7/B2DQG0dQQvLoOc0GFdy4GLgVadXbn0zCJYQdy6teU4cjO0iEAv0LbQ5 jlC6+ifsIQS9CCN1GBeGgU3fhYNhpbHRwpLIjp6JO/XF3Yp7HKdtwfFvDh9JOxOsGusz oXRUTKi0I8B/eDz45f8z061jKnl2ph4dUgHo3QqbFTWJiLpCMv2KyORWq177UpFmKoDq cGEfrZFF9epBjAoES9p7jtEVz233kWFBXlKV9rfA4Ezm5k2AqUWaO0lbuXgEMkya85dH t4GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=U1HkKxRdYtzaXlosQJop0EQ8TbtfcuxI0l5QCODE6Ps=; b=CJWEnqx+QkUJecAer1LKt/NvmL/QDl/wgFQGeMZac/gpMsG63ASRA4TxLqcGO2LMtt J85kyDa6zzLEKU7UcOM/Pia6+npJ58248E8Ym9gVR8Tt6Ya0hiBcqylIMZHF/0fvniOR H0S1+8M+luliXvMhLqvMvCsnqsvQsk7XZyNlFWnT106Cwcm3drz7ZiELCOq5ylRI4Zqj /tidgjE2yJakIyljWWpU4mMguFpUo6qRCx15wCKFTSqR+VJQtuBLtTQAG0llMx9PCVL8 HuCgFiopfGBTYWSHeKOas4rVOrYHdluvcJBcJr5aOh799/Sel3r3W1slLTHs1anOcvrT sehw== X-Gm-Message-State: ACrzQf1oIl1KbJJWliwZ1LVmgvBbJfLIjb6TGLtpFP+qqemVq9K2LLbM 1lrPcl8Vc/C9klWrH4rVq9IhZyjCEHA= X-Google-Smtp-Source: AMsMyM4mS3TC346fbRtkwXiUFwecEo36btwyT6MhPsrJIimAMQtSqB4QUgnU2SmZLwuxI3I2WsR+/w== X-Received: by 2002:a05:620a:240f:b0:6ce:9ac3:5f92 with SMTP id d15-20020a05620a240f00b006ce9ac35f92mr4599781qkn.707.1663909315478; Thu, 22 Sep 2022 22:01:55 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:55 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:40 -0400 Message-Id: <20220923050042.29893-13-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This allows the dconf profile directive "system-db:" to look up profiles by name from under /etc/dconf/db/. * gnu/services/xorg.scm (dconf-keyfile, dconf-profile): New procedures. (dconf-profiles?): New predicate. (dconf-configuration): New procedure. (dconf-profile->profile-file): Likewise. (dconf-profile->db-keyfile): Likewise. (dconf-profile->db-keyfile-dir): Likewise. (dconf-profile->db): Likewise. (dconf-profile->files): Likewise. (dconf-service-type): New service type. --- gnu/services/xorg.scm | 109 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index eb77822741..9205c6f9f4 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2021 Oleg Pykhalov ;;; Copyright © 2021 Josselin Poiret ;;; Copyright © 2022 Chris Marusich +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ (define-module (gnu services xorg) #:autoload (gnu services sddm) (sddm-service-type) #:use-module (gnu artwork) #:use-module (gnu services) + #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (gnu system pam) #:use-module (gnu system setuid) @@ -114,6 +116,13 @@ (define-module (gnu services xorg) localed-configuration? localed-service-type + dconf-keyfile + dconf-profile + dconf-profile-name + dconf-profile-content + dconf-profile-keyfile + dconf-service-type + gdm-configuration gdm-service-type @@ -803,6 +812,106 @@ (define localed-service-type the GNOME desktop environment.") (default-value (localed-configuration))))) + +;;; +;;; Dconf. +;;; + +(define-maybe text-config) + +(define-configuration/no-serialization dconf-keyfile + (name string + "The file name of the associated keyfile, e.g. \"00-login-screen\".") + (content text-config "The content of the associated keyfile.")) + +(define-configuration/no-serialization dconf-profile + (name string "The file name of the dconf system profile, which should match +the name of a user for which the profile is to be used with. To have the +profile used, the environment variable \"DCONF_PROFILE\" should be set to the +profile file, e.g.: +@example + export DCONF_PROFILE=/etc/dconf/profile/gdm +@end example") + (content maybe-text-config "The content of the Dconf profile. Unless +provided, it defaults to include the user database (\"user-db:NAME\") as well +as the system database (\"system-db:NAME\"), which corresponds to the +generated database, @file{/etc/dconf/db/NAME}.") + (keyfile dconf-keyfile "The keyfile associated with the profile")) + +(define dconf-profiles? + (list-of dconf-profile?)) + +(define-configuration/no-serialization dconf-configuration + (profiles dconf-profiles "The list of objects to populate.")) + +(define (dconf-profile->profile-file profile) + "Given PROFILE, a object, return a dconf profile file." + (let ((name (dconf-profile-name profile)) + (content (dconf-profile-content profile))) + (apply mixed-text-file + name + (if (maybe-value-set? content) + (interpose content "\n" 'suffix) + (interpose (list (string-append "user-db:" name) + (string-append "system-db:" name)) + "\n" 'suffix))))) + +(define (dconf-profile->db-keyfile profile) + "Given PROFILE, a object, return a dconf profile file." + (let ((keyfile (dconf-profile-keyfile profile))) + (apply mixed-text-file (dconf-keyfile-name keyfile) + (interpose (dconf-keyfile-content keyfile) "\n" 'suffix)))) + +(define (dconf-profile->db-keyfile-dir profile) + "Wrap the keyfile in a directory, to satisfy 'dconf compile'." + (let ((name (dconf-profile-name profile)) + (keyfile-name (dconf-keyfile-name (dconf-profile-keyfile profile)))) + (computed-file name + #~(begin + (mkdir #$output) + (symlink #$(dconf-profile->db-keyfile profile) + (string-append #$output "/" #$keyfile-name)))))) + +(define (dconf-profile->db profile) + "Compile the a object into a GVariant Database file." + (let ((name (dconf-profile-name profile))) + (computed-file + name + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (setenv "DCONF_PROFILE" #$(dconf-profile->profile-file profile)) + (invoke #$(file-append dconf "/bin/dconf") "compile" + #$output #$(dconf-profile->db-keyfile-dir profile))))))) + +(define (dconf-profile->files profile) + "Given PROFILE, a object, return a dconf directory +containing the associated profile, keyfile and database files to be assembled +under /etc." + (let ((name (dconf-profile-name profile)) + (keyfile-name (dconf-keyfile-name (dconf-profile-keyfile profile)))) + (list (list (string-append "dconf/profile/" name) + (dconf-profile->profile-file profile)) + (list (string-append "dconf/db/" name ".d/" keyfile-name) + (dconf-profile->db-keyfile profile)) + (list (string-append "dconf/db/" name) + (dconf-profile->db profile))))) + +(define dconf-service-type + (service-type + (name 'dconf-profile) + (extensions + (list (service-extension etc-service-type + (lambda (dconf-profiles) + (append-map dconf-profile->files + dconf-profiles))))) + (compose concatenate) + (extend append) + (default-value '()) + (description "Extend the @code{etc-service-type} to populate the file +hierarchy under @file{/etc/dconf} with the objects provided as +argument."))) + ;;; ;;; GNOME Desktop Manager. From patchwork Fri Sep 23 05:00:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42870 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8951527BBE9; Fri, 23 Sep 2022 06:06:53 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EBB8827BBF0 for ; Fri, 23 Sep 2022 06:06:49 +0100 (BST) Received: from localhost ([::1]:37644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obatl-0005rz-32 for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:06:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obaq6-00040h-SD for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obaq6-0002Em-IC for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obaq6-00057j-C8 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 14/15] services: xorg: Add auto-suspend? field to . Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390933219632 (code B ref 58014); Fri, 23 Sep 2022 05:03:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:02:12 +0000 Received: from localhost ([127.0.0.1]:39051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obapI-00056Y-8a for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:12 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:44841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obapD-00054K-35 for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:07 -0400 Received: by mail-qt1-f180.google.com with SMTP id f26so7741118qto.11 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=vuq0hriT3+MgMFrP0QkAVley/t4x1B0R+S/83oneL4I=; b=VdcrYqUDwG8KbqsFPCYOwMJvSdx/W/5805kaqQNm25aFyYthv3GahFuFHcU22x5tl/ 2FoOEBrT0ni7/FplwPxadHdiiPSfjC1dzr3g8SaI2dvQv8syOpkJxlO+hGPLKSOMUwmm W6NnOhbMnBzMZg1CF1Qo5KLikUqCayUwV4jOUk+mRnA5hjtfjgY6YGMn3dZOd4hkrm0M Y/pRqXlxOp9xq+brkk9eyB+LaIt8RcB1tOnZU1vl6jILsD3k+g8NHe8xCgPrxbYRe8Y2 2HkH8Aj1mztDBjYLPjyON7LzxOCraxdiYEQbSrYrIeEPPVZAlJ4iUJhE/LPgGn1CjUbc s1UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=vuq0hriT3+MgMFrP0QkAVley/t4x1B0R+S/83oneL4I=; b=ZQZO+3zVqkXRbcdT2nKxTysBlRaq9aio+wXO5yPBf2wJJI/jzS1DY4XjgMHrlHXy66 sPSkiTuPVYeZACCev+ObKE4QRDJytAeF3dslHnvQDUx1m4xCwb+gLtE3vfCfHBdA52FZ srBPX2yTVP34UHk/HoSJmT/9VD3akrzMHCmI/UsefcP0c49vQfi/9GE1pHvQiTd+mLXm aEM2fUJzxBMzYO7U8cl/7g/xW3y/2tPCWPxhHgIM8clhNQm7F/Tl6LeLL1y0dJO1K6pa L0SyklfOS9SSf0nkCUxctB5W1hkq0ze8wD1lHdMN+hAZ8XeeR3MA6s6fIGZSkVp3+htN V/fQ== X-Gm-Message-State: ACrzQf3tYQDBfpfEIT0JzE7DemVjzkWlVK8S4fnKbPWNcr+MC8mFfbUy RV3weBaPU0VjXfJoHkuv3hA95HtkESc= X-Google-Smtp-Source: AMsMyM6vzg1vytYUI3NfeFitCp0PKDdFgwvyYLjcD+dPwLmt7AdeqqNqW9Ws7WY8W51ASmga1uQ9kg== X-Received: by 2002:a05:622a:301:b0:35c:fca2:4641 with SMTP id q1-20020a05622a030100b0035cfca24641mr5807411qtw.206.1663909321397; Thu, 22 Sep 2022 22:02:01 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:02:01 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:41 -0400 Message-Id: <20220923050042.29893-14-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/xorg.scm () : New field. (gdm-dconf-profiles): New variable. * gnu/services/xorg.scm (gdm-shepherd-service) [!auto-suspend?]: Specify DCONF_PROFILE. (gdm-service-type): Extend DCONF-SERVICE-TYPE. * doc/guix.texi (X Window): Document the new field. --- doc/guix.texi | 6 ++++++ gnu/services/xorg.scm | 32 +++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index be1f2e0063..b04ec25399 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21050,6 +21050,12 @@ When @code{auto-login?} is false, GDM presents a log-in screen. When @code{auto-login?} is true, GDM logs in directly as @code{default-user}. +@item @code{auto-suspend?} (default @code{#t}) +When true, GDM will automatically suspend to RAM when nobody is +physically connected. When a machine is used via remote desktop or SSH, +this should be set to false to avoid GDM interrupting remote sessions or +rendering the machine unavailable. + @item @code{debug?} (default: @code{#f}) When true, GDM writes debug messages to its log. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 9205c6f9f4..902fef0058 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -986,6 +986,7 @@ (define-record-type* (gdm gdm-configuration-gdm (default gdm)) (allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t)) (auto-login? gdm-configuration-auto-login? (default #f)) + (auto-suspend? gdm-configuration-auto-suspend? (default #t)) (dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper)) (debug? gdm-configuration-debug? (default #f)) (default-user gdm-configuration-default-user (default #f)) @@ -1001,6 +1002,30 @@ (define-record-type* (wayland-session gdm-configuration-wayland-session (default gdm-wayland-session-wrapper))) +(define (gdm-dconf-profiles config) + (if (gdm-configuration-auto-suspend? config) + '() + ;; This custom gconf profile works around a lack of configuration option + ;; to disable auto-suspend when no users are physically logged in (see: + ;; https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/22). + (list (dconf-profile + (name "gdm") + (content (list #~(begin + (use-modules (ice-9 textual-ports)) + (string-trim + (call-with-input-file + #$(file-append gdm "/share/dconf/profile/gdm") + get-string-all))) + "system-db:gdm")) + (keyfile (dconf-keyfile + (name "00-disable-suspend") + (content + (list "[org/gnome/settings-daemon/plugins/power]" + "sleep-inactive-ac-type='nothing'" + "sleep-inactive-battery-type='nothing'" + "sleep-inactive-ac-timeout=0" + "sleep-inactive-battery-timeout=0")))))))) + (define (gdm-configuration-file config) (mixed-text-file "gdm-custom.conf" "[daemon]\n" @@ -1073,7 +1098,10 @@ (define (gdm-shepherd-service config) (list #$(file-append (gdm-configuration-gdm config) "/bin/gdm")) #:environment-variables - (list (string-append + (list #$@(if (gdm-configuration-auto-suspend? config) + #~() + #~("DCONF_PROFILE=/etc/dconf/profile/gdm")) + (string-append "GDM_CUSTOM_CONF=" #$(gdm-configuration-file config)) (string-append @@ -1152,6 +1180,8 @@ (define gdm-service-type gdm-shepherd-service) (service-extension account-service-type (const %gdm-accounts)) + (service-extension dconf-service-type + gdm-dconf-profiles) (service-extension pam-root-service-type gdm-pam-service) (service-extension polkit-service-type From patchwork Fri Sep 23 05:00:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42863 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DC1B027BBEA; Fri, 23 Sep 2022 06:04:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0AF0527BBE9 for ; Fri, 23 Sep 2022 06:04:44 +0100 (BST) Received: from localhost ([::1]:45964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obarj-0004H6-5q for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obaq7-00042F-B4 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obaq7-0002Ew-1D for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obaq6-00057r-Qs for guix-patches@gnu.org; Fri, 23 Sep 2022 01:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 15/15] services: Add xvnc-service-type. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390933419639 (code B ref 58014); Fri, 23 Sep 2022 05:03:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:02:14 +0000 Received: from localhost ([127.0.0.1]:39053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obapI-00056b-My for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:14 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:42536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obapF-00054z-Gd for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:02:10 -0400 Received: by mail-qk1-f175.google.com with SMTP id d15so7604483qka.9 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YrorYe90Kub66keRTh+v0ojqYIYCWNFXJbF56CN4jdY=; b=qRMxldOT14zFVO4eRUPyN/u2k8glxotIi5dNskuU3onfHO3wEM73DL8mo5kUqgCi02 Ke+/nYBLaj9k6E9CJMTq+E0OvjsiHMtwh9VhUxSSqPTADrTpGO+hfiUqBh2fcS3I/9q2 h4oBAcpQHkKn+btcG6gG2EsR9gCLY1v29C3TjavqAvVNdqrWysDSrjdzuJRDh4mkDPWZ IsvSyRgUZhWfXIIL8hVuZfdLltdkuKmctsV3UJuTKeWx31V8hbrj82v1aO5MWKNMUaw7 z2YXwrmMEZTzIyOsImE5+vPmNZJnWmah9sN6wxuapXVakQK/0s14A0e5O/jY58vk1Qkr XyDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YrorYe90Kub66keRTh+v0ojqYIYCWNFXJbF56CN4jdY=; b=VoBuqZ6JTdCR+2ANT63Y57ZP6AjqoFPf5vlOtynimndpoCjcDBY20Lp95lVM8v3a5k V+OnbCllbdtx9N2JBmJHQjHyCq/iI2zeVVpYcSTDd7RF20s2s/45vkT0lObk0OLjXkJV xEf4ews0R4qShdg1VXmn8vGiuEaDI7cHNQuc16w1YPcEwbhk7IRLN9LLngADPUibAQ1g vi7W3bHyGKtwy5rwQobqG5E4Ry/d/Fp2cz9Z6Kto6+wSolkhNGRbQXEhHULCol2KPtXY qH+SPIThu3AfMkeWfUIo3Sc4ji0zQ5emk2RXaBQ7oYY+QrZqBvaykPYUTmngK6MUwh7I H7iA== X-Gm-Message-State: ACrzQf2FXGXAUcU2L8mgvmct/ujupgp4LPdWEPNLh0hlPYq3A4pV2XbZ x/QfHuPcIj7kMKm6fKTtJ5WA+h6778k= X-Google-Smtp-Source: AMsMyM6J9NgML5Amu6UCOoWlgvxlWwXpsXWlQxZS8wKfkNm88SPsoLFLAdglh2CSKCV0XEW37g0e6g== X-Received: by 2002:a05:620a:2e5:b0:6cf:6307:7d22 with SMTP id a5-20020a05620a02e500b006cf63077d22mr3893562qko.463.1663909323333; Thu, 22 Sep 2022 22:02:03 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:02:02 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:42 -0400 Message-Id: <20220923050042.29893-15-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/vnc.scm: New file. * gnu/tests/vnc.scm: Likewise. * gnu/local.mk: Register them. --- doc/guix.texi | 163 +++++++++++++++++++++++++++- gnu/local.mk | 2 + gnu/services/vnc.scm | 247 +++++++++++++++++++++++++++++++++++++++++++ gnu/tests/vnc.scm | 200 +++++++++++++++++++++++++++++++++++ 4 files changed, 608 insertions(+), 4 deletions(-) create mode 100644 gnu/services/vnc.scm create mode 100644 gnu/tests/vnc.scm diff --git a/doc/guix.texi b/doc/guix.texi index b04ec25399..26dcc7fdbe 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17514,6 +17514,7 @@ declaration. * Web Services:: Web servers. * Certificate Services:: TLS certificates via Let's Encrypt. * DNS Services:: DNS daemons. +* VNC Services:: VNC daemons. * VPN Services:: VPN daemons. * Network File System:: NFS related services. * Continuous Integration:: Cuirass and Laminar services. @@ -21005,6 +21006,7 @@ started by the @dfn{login manager}, by default the GNOME Display Manager (GDM). @cindex GDM @cindex GNOME, login manager +@anchor{gdm} GDM of course allows users to log in into window managers and desktop environments other than GNOME; for those using GNOME, GDM is required for features such as automatic screen locking. @@ -21306,6 +21308,7 @@ Relogin after logout. @cindex lightdm, graphical login manager @cindex display manager, lightdm +@anchor{lightdm} @defvr {Scheme Variable} lightdm-service-type This is the type of the service to run the @url{https://github.com/canonical/lightdm,LightDM display manager}. Its @@ -21509,10 +21512,11 @@ Extra configuration values to append to the seat configuration section. @cindex Xorg, configuration @deftp {Data Type} xorg-configuration -This data type represents the configuration of the Xorg graphical display -server. Note that there is no Xorg service; instead, the X server is started -by a ``display manager'' such as GDM, SDDM, and SLiM@. Thus, the configuration -of these display managers aggregates an @code{xorg-configuration} record. +This data type represents the configuration of the Xorg graphical +display server. Note that there is no Xorg service; instead, the X +server is started by a ``display manager'' such as GDM, SDDM, LightDM or +SLiM@. Thus, the configuration of these display managers aggregates an +@code{xorg-configuration} record. @table @asis @item @code{modules} (default: @code{%default-xorg-modules}) @@ -30779,6 +30783,157 @@ Defaults to @samp{()}. @c %end of fragment +@node VNC Services +@subsection VNC Services +@cindex VNC (virtual network computing) +@cindex XDMCP (x display manager control protocol) + +The @code{(gnu services vnc)} module provides services related to +@dfn{Virtual Network Computing} (VNC), which makes it possible to +locally use graphical Xorg applications running on a remote machine. +Combined with a graphical manager that supports the @dfn{X Display +Manager Control Protocol}, such as GDM (@pxref{gdm}) or LightDM +(@pxref{lightdm}), it is possible to remote an entire desktop for a +multi-user environment. + +@subsubheading Xvnc + +Xvnc is a VNC server that spawns its own X window server; which means it +can run on headless servers. The Xvnc implementations provided by the +@code{tigervnc-server} and @code{turbovnc} aim to be fast and efficient. + +@defvar {Scheme Variable} xvnc-service-type + +The @code{xvnc-server-type} service can be configured via the +@code{xvnc-configuration} record, documented below. A second virtual +display could be made available on a remote machine for via the +following configuration: +@end defvar + +@lisp +(service xvnc-service-type (xvnc-configuration (display-number 10) +@end lisp + +As a demonstration, the @command{xclock} command could then be started +on the remote machine on display number 10, and it could be display +locally via the @command{vncviewer} command: +@example +# Start xclock on the remote machine. +ssh -L5910:localhost:5910 -- guix shell xclock -- env DISPLAY=:10 xclock +# Access it via VNC. +guix shell tigervnc-client -- vncviewer localhost:5910 +@end example + +The following configuration combines XDMCP and Inetd to allow multiple +users to concurrently use the remote system, login in graphically via +the GDM display manager: + +@lisp +(operating-system + [...] + (services (cons* + [...] + (service xvnc-service-type (xvnc-configuration + (display-number 5) + (localhost? #f) + (xdmcp? #t) + (inetd? #t))) + (modify-services %desktop-services + (gdm-service-type config => (gdm-configuration + (inherit config) + (auto-suspend? #f) + (xdmcp? #t))))))) +@end lisp + +A remote user could then connect to it by using the @command{vncviewer} +command or a compatible VNC client and start a desktop session of their +choosing: +@example +vncviewer remote-host:5905 +@end example + +@quotation Warning +Unless your machine is in a controlled environment, for security +reasons, the @code{localhost?} configuration of the +@code{xvnc-configuration} record should be left to its default @code{#t} +value and exposed via a secure means such as an SSH port forward. The +XDMCP port, UDP 177 should also be blocked from the outside by a +firewall, as it is not a secure protocol and can expose login +credentials in clear. +@end quotation + +@c Use (configuration->documentation 'xvnc-configuration) to regenerate +@c the documentation. +@c %start of fragment +@deftp {Data Type} xvnc-configuration +Available @code{xvnc-configuration} fields are: + +@table @asis +@item @code{xvnc} (default: @code{tigervnc-server}) (type: file-like) +The package that provides the Xvnc binary. + +@item @code{display-number} (default: @code{0}) (type: number) +The display number used by Xvnc. You should set this to a number not +already used a Xorg server. + +@item @code{geometry} (default: @code{"1024x768"}) (type: string) +The size of the desktop to be created. + +@item @code{depth} (default: @code{24}) (type: color-depth) +The pixel depth in bits of the desktop to be created. Accepted values +are 16, 24 or 32. + +@item @code{port} (type: maybe-port) +The port on which to listen for connections from viewers. When left +unspecified, it defaults to 5900 plus the display number. + +@item @code{ipv4?} (default: @code{#t}) (type: boolean) +Use IPv4 for incoming and outgoing connections. + +@item @code{ipv6?} (default: @code{#t}) (type: boolean) +Use IPv6 for incoming and outgoing connections. + +@item @code{password-file} (type: maybe-string) +The password file to use, if any. Refer to vncpasswd(1) to learn how to +generate such a file. + +@item @code{xdmcp?} (default: @code{#f}) (type: boolean) +Query the XDMCP server for a session. This enables users to log in a +desktop session from the login manager screen. For a multiple users +scenario, you'll want to enable the @code{inetd?} option as well, so +that each connection to the VNC server is handled separately rather than +shared. + +@item @code{inetd?} (default: @code{#f}) (type: boolean) +Use an Inetd-style service, which runs the Xvnc server on demand. + +@item @code{frame-rate} (default: @code{60}) (type: number) +The maximum number of updates per second sent to each client. + +@item @code{security-types} (default: @code{("None")}) (type: security-types) +The allowed security schemes to use for incoming connections. The +default is "None", which is safe given that Xvnc is configured to +authenticate the user via the display manager, and only for local +connections. Accepted values are any of the following: ("None" +"VncAuth" "Plain" "TLSNone" "TLSVnc" "TLSPlain" "X509None" "X509Vnc") + +@item @code{localhost?} (default: @code{#t}) (type: boolean) +Only allow connections from the same machine. It is set to #true by +default for security, which means SSH or another secure means should be +used to expose the remote port. + +@item @code{log-level} (default: @code{30}) (type: log-level) +The log level, a number between 0 and 100, 100 meaning most verbose +output. The log messages are output to syslog. + +@item @code{extra-options} (default: @code{()}) (type: strings) +This can be used to provide extra Xvnc options not exposed via this + record. + +@end table + +@end deftp +@c %end of fragment @node VPN Services @subsection VPN Services diff --git a/gnu/local.mk b/gnu/local.mk index ef1bae5f3c..eaccf763c7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -689,6 +689,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/sysctl.scm \ %D%/services/telephony.scm \ %D%/services/version-control.scm \ + %D%/services/vnc.scm \ %D%/services/vpn.scm \ %D%/services/web.scm \ %D%/services/xorg.scm \ @@ -768,6 +769,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests/telephony.scm \ %D%/tests/version-control.scm \ %D%/tests/virtualization.scm \ + %D%/tests/vnc.scm \ %D%/tests/web.scm INSTALLER_MODULES = \ diff --git a/gnu/services/vnc.scm b/gnu/services/vnc.scm new file mode 100644 index 0000000000..15c3c14fee --- /dev/null +++ b/gnu/services/vnc.scm @@ -0,0 +1,247 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Maxim Cournoyer +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services vnc) + #:use-module (gnu packages vnc) + #:use-module ((gnu services) #:hide (delete)) + #:use-module (gnu system shadow) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + + #:export (xvnc-configuration + xvnc-configuration-xvnc + xvnc-configuration-display-number + xvnc-configuration-geometry + xvnc-configuration-depth + xvnc-configuration-port + xvnc-configuration-ipv4? + xvnc-configuration-ipv6? + xvnc-configuration-password-file + xvnc-configuration-xdmcp? + xvnc-configuration-inetd? + xvnc-configuration-frame-rate + xvnc-configuration-security-types + xvnc-configuration-localhost? + xvnc-configuration-log-level + xvnc-configuration-extra-options + + xvnc-service-type)) + +;;; +;;; Xvnc. +;;; + +(define (color-depth? x) + (member x '(16 24 32))) + +(define (port? x) + (and (number? x) + (and (>= x 0) (<= x 65535)))) + +(define-maybe/no-serialization port) + +(define-maybe/no-serialization string) + +(define %security-types '("None" "VncAuth" "Plain" "TLSNone" "TLSVnc" "TLSPlain" + "X509None" "X509Vnc")) + +(define (security-type? x) + (member x %security-types)) + +(define (security-types? x) + (and (list? x) + (and-map security-type? x))) + +(define (log-level? x) + (and (number? x) + (and (>= x 0) (<= x 100)))) + +(define (strings? x) + (and (list? x) + (and-map string? x))) + +(define-configuration/no-serialization xvnc-configuration + (xvnc + (file-like tigervnc-server) + "The package that provides the Xvnc binary.") + (display-number + (number 0) + "The display number used by Xvnc. You should set this to a number not +already used by a Xorg server. When remoting a complete desktop session via +XDMCP and using a compatible VNC viewer as provided by the +@code{tigervnc-client} or @code{turbovnc} packages, the geometry is +automatically adjusted.") + (geometry + (string "1024x768") + "The size of the desktop to be created.") + (depth + (color-depth 24) + "The pixel depth in bits of the desktop to be created. Accepted values are +16, 24 or 32.") + (port + maybe-port + "The port on which to listen for connections from viewers. When left +unspecified, it defaults to 5900 plus the display number.") + (ipv4? + (boolean #t) + "Use IPv4 for incoming and outgoing connections.") + (ipv6? + (boolean #t) + "Use IPv6 for incoming and outgoing connections.") + (password-file + maybe-string + "The password file to use, if any. Refer to vncpasswd(1) to learn how to +generate such a file.") + (xdmcp? + (boolean #f) + "Query the XDMCP server for a session. This enables users to log in a +desktop session from the login manager screen. For a multiple users scenario, +you'll want to enable the @code{inetd?} option as well, so that each +connection to the VNC server is handled separately rather than shared.") + (inetd? + (boolean #f) + "Use an Inetd-style service, which runs the Xvnc server on demand.") + (frame-rate + (number 60) + "The maximum number of updates per second sent to each client.") + (security-types + (security-types (list "None")) + (format #f "The allowed security schemes to use for incoming connections. +The default is \"None\", which is safe given that Xvnc is configured to +authenticate the user via the display manager, and only for local connections. +Accepted values are any of the following: ~s" %security-types)) + (localhost? + (boolean #t) + "Only allow connections from the same machine. It is set to @code{#true} +by default for security, which means SSH or another secure means should be +used to expose the remote port.") + (log-level + (log-level 30) + "The log level, a number between 0 and 100, 100 meaning most verbose +output. The log messages are output to syslog.") + (extra-options + (strings '()) + "This can be used to provide extra Xvnc options not exposed via this + record.")) + +(define (xvnc-configuration->command-line-arguments config) + "Derive the command line arguments to used to launch the Xvnc daemon from +CONFIG, a object." + (match-record config + (xvnc display-number geometry depth port ipv4? ipv6? password-file xdmcp? + inetd? frame-rate security-types localhost? log-level extra-options) + #~(list #$(file-append xvnc "/bin/Xvnc") + #$(format #f ":~a" display-number) + "-geometry" #$geometry + "-depth" #$(number->string depth) + #$@(if inetd? + (list "-inetd") + '()) + #$@(if (not inetd?) + (if (maybe-value-set? port) + (list "-rfbport" (number->string port)) + '()) + '()) + #$@(if (not inetd?) + (if ipv4? + (list "-UseIPv4") + '()) + '()) + #$@(if (not inetd?) + (if ipv6? + (list "-UseIPv6") + '()) + '()) + #$@(if (maybe-value-set? password-file) + (list "-PasswordFile" password-file) + '()) + "-FrameRate" #$(number->string frame-rate) + "-SecurityTypes" #$(string-join security-types ",") + #$@(if localhost? + (list "-localhost") + '()) + "-Log" #$(format #f "*:syslog:~a" log-level) + #$@(if xdmcp? + (list "-query" "localhost" "-once") + '()) + #$@extra-options))) + +(define %xvnc-accounts + (list (user-group + (name "xvnc") + (system? #t)) + (user-account + (name "xvnc") + (group "xvnc") + (system? #t) + (comment "User for Xvnc server")))) + +(define (xvnc-shepherd-service config) + "Return a for Xvnc with CONFIG." + (let* ((display-number (xvnc-configuration-display-number config)) + (port (if (maybe-value-set? (xvnc-configuration-port config)) + (xvnc-configuration-port config) + #f)) + (port* (or port (+ 5900 display-number)))) + (shepherd-service + (provision '(xvnc vncserver)) + (documentation "Run the Xvnc server.") + (requirement '(networking syslogd)) + (start (if (xvnc-configuration-inetd? config) + #~(let* ((inaddr (if #$(xvnc-configuration-localhost? config) + INADDR_LOOPBACK + INADDR_ANY)) + (in6addr (if #$(xvnc-configuration-localhost? config) + IN6ADDR_LOOPBACK + IN6ADDR_ANY)) + (ipv4-socket (and #$(xvnc-configuration-ipv4? config) + (make-socket-address AF_INET inaddr + #$port*))) + (ipv6-socket (and #$(xvnc-configuration-ipv6? config) + (make-socket-address AF_INET6 in6addr + #$port*)))) + (make-inetd-constructor + #$(xvnc-configuration->command-line-arguments config) + `(,@(if ipv4-socket + (list (endpoint ipv4-socket)) + '()) + ,@(if ipv6-socket + (list (endpoint ipv6-socket)) + '())) + #:user "xvnc" + #:group "xvnc")) + #~(make-forkexec-constructor + #$(xvnc-configuration->command-line-arguments config) + #:user "xvnc" + #:group "xvnc"))) + (stop #~(make-inetd-destructor))))) + +(define xvnc-service-type + (service-type + (name 'xvnc) + (default-value (xvnc-configuration)) + (description "Run the Xvnc server, which creates a virtual X11 session and +allow remote clients connecting to it via the remote framebuffer (RFB) +protocol.") + (extensions (list (service-extension + shepherd-root-service-type + (compose list xvnc-shepherd-service)) + (service-extension account-service-type + (const %xvnc-accounts)))))) diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm new file mode 100644 index 0000000000..34c2db1203 --- /dev/null +++ b/gnu/tests/vnc.scm @@ -0,0 +1,200 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Maxim Cournoyer . +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests vnc) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages) + #:use-module (gnu packages ocr) + #:use-module (gnu packages glib) + #:use-module (gnu services) + #:use-module (gnu services dbus) + #:use-module (gnu services desktop) + #:use-module (gnu services networking) + #:use-module (gnu services ssh) + #:use-module (gnu services vnc) + #:use-module (gnu services xorg) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system shadow) + #:use-module (gnu system vm) + #:use-module (gnu tests) + #:use-module (guix gexp) + #:use-module (guix modules) + #:export (%test-xvnc)) + +(define %xvnc-os + (operating-system + ;; Usual boilerplate. + (host-name "komputilo") + (timezone "Europe/Berlin") + (locale "en_US.UTF-8") + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets '("/dev/sdX")))) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + + (users (cons (user-account + (name "dummy") + (group "users") + (supplementary-groups '("wheel" "netdev" + "audio" "video"))) + %base-user-accounts)) + (packages (append (map specification->package + '("dbus" ;for dbus-run-session + "dconf" + "gnome-settings-daemon" ;for schemas + "ratpoison" + "tigervnc-client" + "xterm")) + %base-packages + (list `(,glib "bin") + glib))) + (services (cons* + (service openssh-service-type (openssh-configuration + (permit-root-login #t) + (allow-empty-passwords? #t))) + (service xvnc-service-type (xvnc-configuration + (display-number 5) + (security-types (list "None")) + (log-level 100) + (localhost? #f) + (xdmcp? #t) + (inetd? #t))) + (modify-services %desktop-services + (gdm-service-type config => (gdm-configuration + (inherit config) + (auto-login? #t) + (auto-suspend? #f) + (default-user "root") + (debug? #t) + (xdmcp? #t)))))))) + +(define (run-xvnc-test) + "Run tests in %XVNC-OS." + + (define os (marionette-operating-system + %xvnc-os + #:imported-modules (source-module-closure + '((gnu services herd))))) + + (define vm (virtual-machine + (operating-system os) + (memory-size 1024))) + + (define test + (with-imported-modules (source-module-closure + '((gnu build marionette) + (guix build utils))) + #~(begin + (use-modules (gnu build marionette) + (guix build utils) + (srfi srfi-26) + (srfi srfi-64)) + + (let ((marionette (make-marionette (list #$vm)))) + + (test-runner-current (system-test-runner #$output)) + (test-begin "xvnc") + + (test-assert "service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'xvnc)) + marionette)) + + (test-assert "wait for port 5905, IPv4" + (wait-for-tcp-port 5905 marionette)) + + (test-assert "wait for port 5905, IPv6" + (wait-for-tcp-port 5905 marionette + #:address + '(make-socket-address + AF_INET6 (inet-pton AF_INET6 "::1") 5905))) + + (test-assert "gdm auto-suspend is disabled" + ;; More a GDM than a Xvnc test, but since it's a cross-cutting + ;; concern and we have everything set up here, we might as well + ;; check it here. + (marionette-eval + '(begin + ;; Check that DCONF_PROFILE is set... + (invoke "/bin/sh" "-lc" "\ +pgrep gdm | head -n1 | xargs -I{} grep -Fq DCONF_PROFILE /proc/{}/environ") + + ;; ... and that + (invoke "/bin/sh" "-lc" "\ +sudo -E -u gdm env DCONF_PROFILE=/etc/dconf/profile/gdm dbus-run-session \ +gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type \ +| grep -Fq nothing")) + marionette)) + + (test-assert "vnc lands on the gdm login screen" + ;; This test runs vncviewer on the local VM and verifies that it + ;; manages to access the GDM login screen (via XDMCP). + (begin + (define (ratpoison-abort) + (marionette-control "sendkey ctrl-g" marionette)) + + (define (ratpoison-help) + (marionette-control "sendkey ctrl-t" marionette) + (marionette-type "?" marionette) + (sleep 1)) ;wait for help screen to appear + + (define (ratpoison-exec command) + (marionette-control "sendkey ctrl-t" marionette) + (marionette-type "!" marionette) + (marionette-type (string-append command "\n") marionette)) + + ;; Wait until the ratpoison help screen can be displayed; this + ;; means the window manager is ready. + (wait-for-screen-text marionette + (cut string-contains <> "key bindings") + #:ocr #$(file-append tesseract-ocr + "/bin/tesseract") + #:pre-action ratpoison-help + #:post-action ratpoison-abort) + + ;; Run vncviewer and expect the GDM login screen (accessed via + ;; XDMCP). This can take a while to appear on slower machines. + (ratpoison-exec "vncviewer localhost:5905") + ;; XXX: tesseract narrowly recognizes "Guix" as "uix" from the + ;; background image; ocrad fares worst. Sadly, 'Username' is + ;; not recognized at all. + (wait-for-screen-text marionette + (cut string-contains <> "uix") + #:ocr #$(file-append tesseract-ocr + "/bin/tesseract") + #:timeout 120))) + + (test-end))))) + + (gexp->derivation "xvnc-test" test)) + +(define %test-xvnc + (system-test + (name "xvnc") + (description "Basic tests for the Xvnc service. One of the tests validate +that XDMCP works with GDM, and is therefore heavy in terms of disk and memory +requirements.") + (value (run-xvnc-test))))