From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KJ2XG6yoqma2gAAAqHPOHw:P1 (envelope-from ) for ; Wed, 31 Jul 2024 21:12:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KJ2XG6yoqma2gAAAqHPOHw (envelope-from ) for ; Wed, 31 Jul 2024 23:12:12 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=kAxZUT0u; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=PdRjygUi; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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=1722460332; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: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=JeWDk95aP1rLpDgnQg9hgjaEq9E0FpUpaBdvKv+m8w8=; b=u6SFocEaWVwulccOTYWLANRWIvbFy605JHxa6q7S5nhI6edjBwsWqd29jJQKTX1JdaOT/1 KKKk79xxFNUMnUgE1MNsud6lzm5EY5SqferdWSpC5Ii2dVHqL1KrNAAX/sKCAbRakFkbtn bmg+gJo/gHuvV4scdjvRGsAzHT0iFsZ1B5gSymSQqR8auNlMP7xgzn3ATEaZM5Q10IfQwK EwYP4BFV9hjDGDT6sDEXPktIfjET6pjV2W4KnJZ2AZTp7D/m1sR5VR71PANq21CYb5GiQ4 aMBu7FXf16VHCKepuA/DWhq+qX9+jgZxHohaY62TIDYH+fQ/70byVHrJdoIYWg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722460332; a=rsa-sha256; cv=none; b=LAx1VdwAecsTcF450FI6nd8jHpwUomK44xcpIUTXb9Mz3soKnk7iU57Oyg2xvfuFSi6KEF NGDIMMDXP4/rb0BXOZj1vQhn9dBawEnR+GfkhoR4eclNDsXZP4EW7sQOsMqW5c+Ul+OU4k 0tQY7bv5YnAmhyHO8S7B5LtmSDktOlLtmX3SER5wXSzNbO1zd02F69xc3f9qMDFQ7JLxX7 Diir0BKgM4pmfAbsh+aUdO94zjW2QyX7WSFtOSC/xtcSbYe9s5pFOwioagnDkf9rZ21gt4 0nVo87hyKHwqRpsWLSz8JKo6iR2eKLWeo5uYr9+DqtB+FPua+isOB/jPgF9zPw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=kAxZUT0u; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=PdRjygUi; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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" 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 226AAE6FF for ; Wed, 31 Jul 2024 23:12:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZGbx-00053p-5x; Wed, 31 Jul 2024 17:11:53 -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 1sZGbr-0004tI-KQ for guix-patches@gnu.org; Wed, 31 Jul 2024 17:11:48 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZGbr-0002Zh-Ax for guix-patches@gnu.org; Wed, 31 Jul 2024 17:11:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:References:In-Reply-To:To:Subject; bh=JeWDk95aP1rLpDgnQg9hgjaEq9E0FpUpaBdvKv+m8w8=; b=kAxZUT0uMGaExW+DfywwJVjR84o7zuE6ybv9mKkwCMzoRDSpWF6/WyQR+RH2OwaFsP4WpctF4loSGGgH3mh85cSlvqKhEx1Fyk0igIvEm2qTOsy60CqD3TxBHfXP1X744H3h5jrK9/zYKA69zGKHDs2pLsNX+nYJ+Tvita9cJU8bldtCyoGWCw39nbeLI01yBjupG6UZhJHyeFQQGPjvldsjFI2YHF0CqPT+qt2VR/7H7e1ZgyYefOHw1nQMNRzcClcXZqwP1UZoHhny9/KqgziS4EWRMffAH4TRWuihF4sHy1AqYjdU4kPENgCOn+5yHxaHPBOCv55WNjaDyYDi3g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sZGc6-0003tS-DV; Wed, 31 Jul 2024 17:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72406] [PATCH emacs-team WIP 1/4] build-system: emacs: Define package-with-explicit-emacs. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, guix-patches@gnu.org Resent-Date: Wed, 31 Jul 2024 21:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72406 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72406@debbugs.gnu.org Cc: gemmaro.dev@gmail.com, andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com X-Debbugs-Original-Xcc: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com Received: via spool by 72406-submit@debbugs.gnu.org id=B72406.172246031414937 (code B ref 72406); Wed, 31 Jul 2024 21:12:02 +0000 Received: (at 72406) by debbugs.gnu.org; 31 Jul 2024 21:11:54 +0000 Received: from localhost ([127.0.0.1]:50375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZGbx-0003sq-V9 for submit@debbugs.gnu.org; Wed, 31 Jul 2024 17:11:54 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:54421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZGbv-0003sJ-3t for 72406@debbugs.gnu.org; Wed, 31 Jul 2024 17:11:52 -0400 Received: by mail-lf1-f68.google.com with SMTP id 2adb3069b0e04-52f008aa351so9137750e87.0 for <72406@debbugs.gnu.org>; Wed, 31 Jul 2024 14:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722460229; x=1723065029; darn=debbugs.gnu.org; h=mime-version:cc:to:subject:date:from:references:in-reply-to :message-id:from:to:cc:subject:date:message-id:reply-to; bh=JeWDk95aP1rLpDgnQg9hgjaEq9E0FpUpaBdvKv+m8w8=; b=PdRjygUiqXvWy83pm62kFnJ/Jnrbg0J0Idll72f4xFYiqvS5JoqEG3umfTjoEEwbs0 uAE1HsKnmPzkjaOPa+NYG6fb6X4cTS0WoFgMp3nXuUNhPMFlSEORzb7M6ve6UyxINVd3 M0/IOa/P1RJSF1DtvfdraRlBWVxEWe0/pDePsTI/5qrxhr1M9PNulOrgEPULHTsjykmw yPxmyQR+0Lf70KjJkNdjHq/gd4faLR+jScAv5avzw8QNwi0qQXqhZpH6wsQmrL3vHrwT wmWPqp0fpq5xgPqGFX3JMjsB9OyjhyL2fKnV/pusSQx2ddZ8RjDj+qFsmOUghoG+AEHM 7kEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722460229; x=1723065029; h=mime-version:cc:to:subject:date:from:references:in-reply-to :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JeWDk95aP1rLpDgnQg9hgjaEq9E0FpUpaBdvKv+m8w8=; b=tC2XLQvYGNGFvSiT/SHIUEH8Bse59lfm+xEO2GT35hjtTzbBk2atJxgin+/TDlMo0N RYvIWlujN3MnfuSmX3+4Y/S3oI+MH3la1h3qHrWQ1xblsyIX2xtNl85tvoDuhLWHGk/f DZtxiPZZR8XmMGFL+y/KJuWKb53Ao4Ql5HJ6Ldl4Ljj+WaUMmS8RoXmaQyi1VDfM/CJk DnZ3EJ0YyjpkTzyhnGWVzhydvKe4N3RaoqdToDVfAm5Glie7I4HqLIxJEBrsUICd7Ghh ECWpEF1GGGaWjfCmA/paTmdPmQ1j5F1xw1zs3JGUha/WRuswii2pxrz6Yh/OWDET/oU3 QfRA== X-Gm-Message-State: AOJu0YyZAyaj7bNdl4fx8wbuURaZJ8QgCkFfiaP0dB9CrtjxN37Bkhpr qD85Eg3O4QiLn+Ld1iu/IwSkNk19NBwUhvqTXodB6OD9B3vGB72I5IwBMm2L X-Google-Smtp-Source: AGHT+IFDdnHwpJ+whbVuCn4c291AuGlEDnlpFFL9G9OGW+hA61A2TcbSAaNSVQKT8TrVMmg3hMlO5A== X-Received: by 2002:a05:6512:2302:b0:52c:df9d:7cbe with SMTP id 2adb3069b0e04-530b61f4cd8mr128056e87.39.1722460228467; Wed, 31 Jul 2024 14:10:28 -0700 (PDT) Received: from lumine.fritz.box (85-127-20-124.dsl.dynamic.surfer.at. [85.127.20.124]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac64eb3a95sm9047273a12.61.2024.07.31.14.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 14:10:28 -0700 (PDT) Message-ID: In-Reply-To: References: From: Liliana Marie Prikler Date: Wed, 31 Jul 2024 21:57:54 +0200 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.36 X-Spam-Score: -2.36 X-Migadu-Queue-Id: 226AAE6FF X-Migadu-Scanner: mx11.migadu.com X-TUID: sggTaIbch/N7 * guix/build-system/emacs.scm (package-with-explicit-emacs): New procedure. --- guix/build-system/emacs.scm | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm index ebf97a5344..3a11738496 100644 --- a/guix/build-system/emacs.scm +++ b/guix/build-system/emacs.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2020 Morgan Smith +;;; Copyright © 2024 Liliana Marie Prikler ;;; ;;; This file is part of GNU Guix. ;;; @@ -128,4 +129,54 @@ (define emacs-build-system (description "The build system for Emacs packages") (lower lower))) +(define* (package-with-explicit-emacs emacs old-prefix new-prefix + #:key variant-property) + "Return a procedure of one argument, P. The procedure creates a package with +the same fields as P, which is assumed to use EMACS-BUILD-SYSTEM, such that +it is compiled with EMACS instead. The inputs are changed recursively +accordingly. If the name of P starts with OLD-PREFIX, this is replaced by +NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name. + +When VARIANT-PROPERTY is present, it is used as a key to search for +pre-defined variants of this transformation recorded in the 'properties' field +of packages. The property value must be the promise of a package. This is a +convenient way for package writers to force the transformation to use +pre-defined variants." + (define package-variant + (if variant-property + (lambda (package) + (assq-ref (package-properties package) + variant-property)) + (const #f))) + + (define (transform pkg) + (cond + ;; If VARIANT-PROPERTY is present, use that. + ((package-variant pkg) + => force) + + ;; Otherwise build the new package object graph. + ((eq? (package-build-system pkg) emacs-build-system) + (package/inherit pkg + (location (package-location pkg)) + (name (let ((name (package-name pkg))) + (string-append new-prefix + (if (string-prefix? old-prefix name) + (substring name + (string-length old-prefix)) + name)))) + (arguments + (let ((emacs (if (promise? emacs) + (force emacs) + emacs))) + (ensure-keyword-arguments (package-arguments pkg) + `(#:emacs ,emacs)))))) + (else pkg))) + + (define (cut? pkg) + (or (not (eq? (package-build-system pkg) emacs-build-system)) + (package-variant pkg))) + + (package-mapping transform cut?)) + ;;; emacs.scm ends here -- 2.45.2