From patchwork Sun Feb 12 18:52:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Scherer X-Patchwork-Id: 46886 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 6B30216640; Sun, 12 Feb 2023 19:17:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 3164E16633 for ; Sun, 12 Feb 2023 19:17:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRHqT-0001Hl-Nf; Sun, 12 Feb 2023 14:17:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRHqR-0001HU-Dj for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRHqR-00030r-2i for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRHqQ-0008BN-GB for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61458] [PATCH] services: xorg-wrapper: Support xorg server input Resent-From: Roman Scherer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Feb 2023 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61458 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61458@debbugs.gnu.org X-Debbugs-Original-To: Guix Patches Received: via spool by submit@debbugs.gnu.org id=B.167622941031426 (code B ref -1); Sun, 12 Feb 2023 19:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2023 19:16:50 +0000 Received: from localhost ([127.0.0.1]:46779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHqD-0008Am-Ih for submit@debbugs.gnu.org; Sun, 12 Feb 2023 14:16:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:54880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHqB-0008Ae-FW for submit@debbugs.gnu.org; Sun, 12 Feb 2023 14:16:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRHq9-0001GM-Ux for guix-patches@gnu.org; Sun, 12 Feb 2023 14:16:45 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRHq7-0002y8-Lo for guix-patches@gnu.org; Sun, 12 Feb 2023 14:16:45 -0500 Received: by mail-ej1-x632.google.com with SMTP id sb24so3110752ejb.8 for ; Sun, 12 Feb 2023 11:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20210112.gappssmtp.com; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=QCDCXi0iqJWNgDoV4cOhFKiyCk2s/AHQR/iEJhxzcBg=; b=MNNP4Ovj+wjdSB3Byp0wLhm7riDa3RIuVRBZLQPLSxgQRIunDzL3dNtC6o52A5gVL7 rwIv6XaIr0pfHwIE9UHnqhgDWG3kwhzKnw1PQio4lRKH9abOmOCEnO0KqCW1vhPViafX gtclpjYOOtjnWSJpami4yLI08xAYuMbhTX0d9Je51s42MTPZLf5r6WEjfLkPwK/dCAwO aA30QxqTwZlpTmE9FlJMYEy+yUQp2kCm4adZpdU6t/GmnoAnREc3BiW1PzNcIBcek9QN 4EY55zCcwCD/4ht8Mhn+i78OHLXe3jCEmn2uyBvaSBqmSqV2key/nBoMCnDAcSXOqZ7O lOKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QCDCXi0iqJWNgDoV4cOhFKiyCk2s/AHQR/iEJhxzcBg=; b=OcVIDy6ee4tvaxBIL+dBroC3oT82Pz5D45A33eC2iIiM/I+6W2rTFwhCwVbLiSzED+ DI5oY+/EFOA357WTuMDdZXjVFRt8lBy9ytcHl5UTpIA3K5AAnCwX4Of0ETgUe5rAiSoa P4Z3VcdQyVSJHcc1MNr5PPkY3QiWP8SrrK2JCr7Kv/eqPQAu43QNEPYTkd7nk6b38Ybt mdRhfbVPyYWFz6FM1w4T9jPyhvhZJHmgrJqW6qvUiom/rEk5Kc4grVmcNE87L496jHw5 xeCwDyto/uBwkjc91BeN0K3M9b6bfEdrfTUOrz0DuAmNmKreIRIJ0/j/ZC7N4zLfN6a3 fc8g== X-Gm-Message-State: AO0yUKUdwhcnG4NyXgSXh+6+OTsk0xau3InPZR8XyYY/iOWE6WE0wjca d/CdHaCk9UCCoEsrZF8Om/AFZAzof22f/t2q8Wk= X-Google-Smtp-Source: AK7set+SIe6WBWdor+TTgko6WNTFT+tZqf3zHTnot4zdP8jMRfWxDG9l/PlA8+yceYSRrQdyZG5VBw== X-Received: by 2002:a17:906:b202:b0:882:239e:23c0 with SMTP id p2-20020a170906b20200b00882239e23c0mr19263202ejz.12.1676229399976; Sun, 12 Feb 2023 11:16:39 -0800 (PST) Received: from bombaclaat ([2a01:598:b1b0:992:157d:949e:916b:98f2]) by smtp.gmail.com with ESMTPSA id r14-20020a170906364e00b0088351ea808bsm5676609ejb.46.2023.02.12.11.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 11:16:39 -0800 (PST) User-agent: mu4e 1.8.13; emacs 29.0.50 From: Roman Scherer Date: Sun, 12 Feb 2023 19:52:40 +0100 Message-ID: <86k00mvgmi.fsf@burningswell.com> MIME-Version: 1.0 Received-SPF: none client-ip=2a00:1450:4864:20::632; envelope-from=roman.scherer@burningswell.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello Guix, I would like to replace the Mesa package in my Xorg configuration. I tried to do this with the following snippet: ``` (modify-services %desktop-services (slim-service-type config => (slim-configuration (inherit config) (xorg-configuration (xorg-configuration (server (replace-mesa xorg-server))))))) ``` But this unfortunately does not work, because the xorg-wrapper uses static paths for the mesa, xkbcomp and xkeyboard-config packages in the derivation. The xserver starts now with the replaced mesa, but some paths still point to the hard coded packages in Guix itself (and not the replacement), which cause some things to not work. This patch changes this to lookup the paths from the inputs of the server field of the xorg-configuration instead. That way the correct paths are setup in the xor-wrapper script. If those inputs are not found for some reason it falls back to the current behavior, using the packages from Guix. Could you please review this? Thanks, Roman. From d035c99ed4703da0e3e9b62299c390560c074a17 Mon Sep 17 00:00:00 2001 From: r0man Date: Sat, 11 Feb 2023 19:36:16 +0100 Subject: [PATCH] services: xorg-wrapper: Support xorg server input transformations. * gnu/services/xorg.scm (xorg-wrapper): Support xorg server input transformations. --- gnu/services/xorg.scm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 5f073d05d3..92735e6004 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -355,6 +355,21 @@ (define files files) #t)))) +(define (xorg-configuration-append-input config input default-input path) + (let ((server (xorg-configuration-server config))) + (file-append (or (lookup-package-direct-input server input) default-input) + path))) + +(define (xorg-configuration-dri-driver-path config) + (xorg-configuration-append-input config "mesa" mesa "/lib/dri")) + +(define (xorg-configuration-xkb-bin-dir config) + (xorg-configuration-append-input config "xkbcomp" xkbcomp "/bin")) + +(define (xorg-configuration-xkb-dir config) + (xorg-configuration-append-input config "xkeyboard-config" + xkeyboard-config "/share/X11/xkb")) + (define* (xorg-wrapper #:optional (config (xorg-configuration))) "Return a derivation that builds a script to start the X server with the given @var{config}. The resulting script should be used in place of @@ -362,12 +377,13 @@ (define* (xorg-wrapper #:optional (config (xorg-configuration))) (define exp ;; Write a small wrapper around the X server. #~(begin - (setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri")) - (setenv "XKB_BINDIR" (string-append #$xkbcomp "/bin")) + (setenv "XORG_DRI_DRIVER_PATH" + #$(xorg-configuration-dri-driver-path config)) + (setenv "XKB_BINDIR" #$(xorg-configuration-xkb-bin-dir config)) (let ((X (string-append #$(xorg-configuration-server config) "/bin/X"))) (apply execl X X - "-xkbdir" (string-append #$xkeyboard-config "/share/X11/xkb") + "-xkbdir" #$(xorg-configuration-xkb-dir config) "-config" #$(xorg-configuration->file config) "-configdir" #$(xorg-configuration-directory (xorg-configuration-modules config)) -- 2.38.1