From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IIjvHNIBGmQLKAAASxT56A (envelope-from ) for ; Tue, 21 Mar 2023 20:13:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IPnxHNIBGmTpggAAauVa8A (envelope-from ) for ; Tue, 21 Mar 2023 20:13:22 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 316E9E9F2 for ; Tue, 21 Mar 2023 20:13:22 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=FI6HqHxu; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679426002; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PjWUSwnBzJVkDRgazEARRYOVduH/UNd/SN8rsqwZeLU=; b=J9XLy0PeAUxF10szkIKwbze+reVTihw477B2y49vgjiByILJZ0qbb9L0oLGT0wgha5hNI5 DRmRZUpp/N1lZ4N6ZgsUiByG8kjWSB+NMxeQM+pw8TkHobbiLHnRu/os38xT1F7LuoA0Za MU3kadwDa50YQrOYrw/XUud+qJG4EBmhS+Af2UGK4975Keri1eH+2Bofu5FbT03SBh+VCV lcspgnOuWB2NL4yb8WSLPE9RVq7rpXfzzPDgfktdGfDEUGiMEr2OSJ2MW25ve0Ax+YRIyw 4vEkdalNaLIW3cx7PYh6M97TZ/6pWBayupS2Rk/noxUb5fYijm0uXihLhDkKHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=FI6HqHxu; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679426002; a=rsa-sha256; cv=none; b=O1vm0svITyLYe5jtVA9fqBtsyp2b0C6I48OV+f1VekAz5GL/Ld2aOk+gbOWMTga6+rsULI d9QENIve0OOBLd3vPrWEBgYziJEyJvAwRMvpJ/84/oafNEPsVKAkw/bXt5ooUYlT1jVtx9 hB97Id2e1Klv/0fWqMLl94C7epS0aUMpQehUxAHL60/yFOcdVsqWdQAMvpe/qnYQWTl396 66Zf9/QYpI6CbyLkWLiHBjTwEHj3dFVIWly+hAwUWA5k9GTm4ol6DCaU87cLKfq4CLOolx gABd5oJPS6CkVFnC0n6KQMIGXeAWBc5Luqvu5vc1/UpRBWssGPMvqgC+MwmiMQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pehPx-00082O-IF; Tue, 21 Mar 2023 15:13:09 -0400 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 1pehPr-0007yn-CH for guix-patches@gnu.org; Tue, 21 Mar 2023 15:13:06 -0400 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 1pehPr-0004UY-3d for guix-patches@gnu.org; Tue, 21 Mar 2023 15:13:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pehPq-00066G-VV for guix-patches@gnu.org; Tue, 21 Mar 2023 15:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#61458] [PATCH v2 1/1] services: xorg-wrapper: Support xorg server input rewriting. Resent-From: Roman Scherer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Mar 2023 19:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61458 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: 61458@debbugs.gnu.org Cc: r0man , iyzsong@envs.net Received: via spool by 61458-submit@debbugs.gnu.org id=B61458.167942594323380 (code B ref 61458); Tue, 21 Mar 2023 19:13:02 +0000 Received: (at 61458) by debbugs.gnu.org; 21 Mar 2023 19:12:23 +0000 Received: from localhost ([127.0.0.1]:60699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pehPD-000651-B3 for submit@debbugs.gnu.org; Tue, 21 Mar 2023 15:12:23 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:39865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pehPA-00064c-Lx for 61458@debbugs.gnu.org; Tue, 21 Mar 2023 15:12:21 -0400 Received: by mail-wm1-f43.google.com with SMTP id i5-20020a05600c354500b003edd24054e0so4936507wmq.4 for <61458@debbugs.gnu.org>; Tue, 21 Mar 2023 12:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20210112.gappssmtp.com; s=20210112; t=1679425935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PjWUSwnBzJVkDRgazEARRYOVduH/UNd/SN8rsqwZeLU=; b=FI6HqHxuKtFxvRAG/mzoM7Q4DnfcbPZBUNJvGGdgIMNvgBje1bnKKhWKk8Cmf2BhCw Mj49QIF3USIPfmu//vR8nDLx91zNHDVOiRifW/zBU9UNXvuwdMm2ZWc7LCRXPMBHBIDn b0C5O3pdQXJDono4jqZxQx6wUSrffzO6gy1i5EamwDj9MQV1VbKgtTV6R5CG/Nc+Hj6F VSU/5abr95Qrem/Y1e37M/igqAjMPSuu/wASVervqWW+HPfZOIw4UztYBGxP7A+sYlqn MqozfVfxkJeTINJ55UXZvuWmxJcJ2VDY76aq//WBcxJjN8m7ohssnW4YEhCgp2CAHVY/ K/sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679425935; 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:message-id:reply-to; bh=PjWUSwnBzJVkDRgazEARRYOVduH/UNd/SN8rsqwZeLU=; b=dKqtD1D397CJVImyFFhBLphA19jwG20tfbYlzNJ4A0nSu31+282VpL3cyVQSZb8N9z Ko+cysIDceoRcU20iIqBWFlAJ32ZIlA1/cRD7NwfuKdWdaa9TIKrGHXjlvy87voYwaEg wtjE7uvH3vIlRq+0N1hKoD8KHxgJR//vMrRbpLJ3mMqQiAX9SQtSyS8m5Quim9EzrJ45 Jn0QWxfGHCDoAR4gR1vh09uwxJKGx2V3AXObQvEAmknNm//ym8a7jqu40yLZ5d/tn1wv HYR1Cy/oC6CR99fj/ezRdhfI9LNiVJVdzy41PKmXpYP4PY97lLTl8Hq1tixh+dcLzsR8 MNTg== X-Gm-Message-State: AO0yUKUBxpbsQGqV9vWd5wzRp1eS1Jg3XtIjlfKozJaJcWzJcmwvCq3Q N1MLklcobLby/Un/6q49FhZ8K7Xf31SkD9Ncvs4= X-Google-Smtp-Source: AK7set/VzpVakjSipPxSLisdxwY5Uo2Bu5d2j3GW04RPEN7i3alvrxMtEOXXzFepXThoxEYDOxfwqA== X-Received: by 2002:a7b:c845:0:b0:3ed:df74:bac7 with SMTP id c5-20020a7bc845000000b003eddf74bac7mr3094663wml.21.1679425934831; Tue, 21 Mar 2023 12:12:14 -0700 (PDT) Received: from localhost.localdomain ([2a01:598:b1af:cb71:ef:b0c6:7178:9dc0]) by smtp.gmail.com with ESMTPSA id j19-20020a05600c191300b003eddc6aa5fasm8807634wmq.39.2023.03.21.12.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 12:12:14 -0700 (PDT) From: Roman Scherer Date: Tue, 21 Mar 2023 20:11:41 +0100 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: X-Migadu-Queue-Id: 316E9E9F2 X-Spam-Score: -1.55 X-Migadu-Spam-Score: -1.55 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: NYsigcgTowqz From: r0man * gnu/services/xorg.scm (xorg-wrapper): Support xorg server input rewriting. This patch adds support for proper xorg server input rewriting. It uses the lookup-package-direct-input procedure to configure the X server paths dynamically, instead of always using the hard coded package. Something like this is now possible: (define other-mesa (package-input-rewriting/spec `(("mesa" . ,(const other-mesa))))) (xorg-configuration (xorg-configuration (server (other-mesa xorg-server)))) Without this patch the X server would still be configured with mesa (causing version issues), and not with other-mesa (as per the input rewrite). --- gnu/services/xorg.scm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index c4745cecf5..7295a45b59 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -358,6 +358,22 @@ (define (xorg-configuration-directory modules) files) #t)))) +(define (xorg-configuration-server-package-path config input path) + "Lookup the direct @var{input} in the xorg server package of @var{config} +and append @var{path} to it." + (let* ((server (xorg-configuration-server config)) + (package (lookup-package-direct-input server input))) + (when package (file-append package path)))) + +(define (xorg-configuration-dri-driver-path config) + (xorg-configuration-server-package-path config "mesa" "/lib/dri")) + +(define (xorg-configuration-xkb-bin-dir config) + (xorg-configuration-server-package-path config "xkbcomp" "/bin")) + +(define (xorg-configuration-xkb-dir config) + (xorg-configuration-server-package-path 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 @@ -365,12 +381,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.39.1