From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id eErKNpHEMGXfHwAAauVa8A:P1 (envelope-from ) for ; Thu, 19 Oct 2023 07:54:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eErKNpHEMGXfHwAAauVa8A (envelope-from ) for ; Thu, 19 Oct 2023 07:54:25 +0200 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 AC16046E81 for ; Thu, 19 Oct 2023 07:54:25 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=law77mn5; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697694865; 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=69c2V3RnTf25qd4I7MfyaW6muQgnLDJZkvWsa0n+taU=; b=t77Fppy34BtQ2qABoRiZQoj2ZDb9sSUXFa3v0o84FioPFHwrewA/V3tBD6N0k/s5H5G/Br OWNZAlJOcaEkOxZrY3RbslfL6HyeI6aXo2OHCAJfHpXSPoMFLN2E5DkPPg+QX2gPZ23jvl 873s4uGqX/QCU9Np6b1eWPVztUwHom3vJNf2ETXEvdOKWavT4xIL3DrQ4WtV0W3RI5hKBw Vi0LsJaomYWUwGfuVI6BW5nRsjP3iCNUv+WXw2h+8wB2p0QUPNEEBPdx2FlTm6sMIQuhbG FZdH3zXTZxwz62x7L5B8udTYoPqSmLqRUuoTQW9+s59mQvJYXl875mtGLZ8fsA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697694865; a=rsa-sha256; cv=none; b=jJfEQsAc5PRnsiB3Hzwk7jRK3cWsKmvWAnO7Di1TKwCYdn2TQQ9ljiaZQxf2PuAejWpflG EulJ3FU7VS09YeSOcRRLWMxn8aQ6KawgsEkb3oRUq7NjbhRn9Bq0OYHTW4hvhjJPH6FET+ iFvcJ6oqxx/9oDpnkRAn0W79R2N9wk3kNKbezEaufumgVm1S+Nj9vjinPMHQw8uuKpcZxY ytGRHjYKFh8EMC6D7YacF9kg4bEmcl/X0oTtAJSP0gmjxYPfFwu6Lt0RTFASZXBvnWaL4f g1BkKBX0zUTOj6YpHgw5ToFNpxGwaKl7bh+okvN0Yo1sPgvBt7OJ8M4JhhAD/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=law77mn5; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtLyU-0003j6-KW; Thu, 19 Oct 2023 01:53:38 -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 1qtLyR-0003iH-Ks for guix-patches@gnu.org; Thu, 19 Oct 2023 01:53:36 -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 1qtLyR-0002NX-Bf for guix-patches@gnu.org; Thu, 19 Oct 2023 01:53:35 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtLyr-0000vB-JZ; Thu, 19 Oct 2023 01:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66624] [PATCH emacs-team 01/15] guix: emacs-build-system: Process package source in build tree. 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: Thu, 19 Oct 2023 05:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66624 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66624@debbugs.gnu.org Cc: 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 66624-submit@debbugs.gnu.org id=B66624.16976948133357 (code B ref 66624); Thu, 19 Oct 2023 05:54:01 +0000 Received: (at 66624) by debbugs.gnu.org; 19 Oct 2023 05:53:33 +0000 Received: from localhost ([127.0.0.1]:35473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtLyO-0000s4-BR for submit@debbugs.gnu.org; Thu, 19 Oct 2023 01:53:32 -0400 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:58780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtLyL-0000ra-PD for 66624@debbugs.gnu.org; Thu, 19 Oct 2023 01:53:30 -0400 Received: by mail-ed1-x541.google.com with SMTP id 4fb4d7f45d1cf-53f9af41444so263635a12.1 for <66624@debbugs.gnu.org>; Wed, 18 Oct 2023 22:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697694777; x=1698299577; darn=debbugs.gnu.org; h=mime-version:to:subject:date:from:references:in-reply-to:message-id :from:to:cc:subject:date:message-id:reply-to; bh=69c2V3RnTf25qd4I7MfyaW6muQgnLDJZkvWsa0n+taU=; b=law77mn5mqv8X4AsN4MkSyYeATHNWhU88SMW7JtRhZ7fpmrKDf64nTPz1AkolqnWZs vxZmnXN63mOwMZ+zINNTU8Z49ruQZCKPXq7GUYecR7Z5VOmsNFeOhcfmChW/DORF2+ag mgPycddUGRlVrVHxRZ8rJYCyBej1HhmIc5xof1RHEDyOlfe0aUmJ0VwQLek8OtNdGuqV D3IaKZlNJPnLeq42EPCcMfmnTUSi2D7wKUdPHB43c9xkkt/vZjcfwTVV10r/8Gk44e9V rktICHBX1BaO7CKPiGJ7GDQCqwkNJvsHFuIEsUjJfZ2ZVHejbdCQX8MOA7fKxJx826pm ncWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697694777; x=1698299577; h=mime-version:to:subject:date:from:references:in-reply-to:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=69c2V3RnTf25qd4I7MfyaW6muQgnLDJZkvWsa0n+taU=; b=ebO9Z0Ch9L90+HVzvfiNrnlKwXH8PL8VX7K+38qFLNESJ9sPJ6tIrWO/NYlZizCL8N CRH7XdcgTYXZN5DF6WO8Dosy0ei8dljBetRYahi5IU88PzZ1bJbrbjpXVRNtXn2nA57x kPYILqfpwpPKm82jfObUPe86qspRx0Nk9JZHb2NiIQNsbm9EmKWGQBYdUOIRy7PiuS/O qcmQQojNMLv4Zk45rGM8A5Ioen9KXpF4G6IcWbUuuGWe869UVTVsISdXu3pSLgqDdLeu JFWJ32xyJqY4Lr8zwZ5NDMouNbu3dBOC9MMaXKFOwXwFZ3MQCmC6jSYqnp+c+aBdMqhV MHCA== X-Gm-Message-State: AOJu0Yy5r9WWINdfG2F72JoHaTyP5WSIbXDCqnQZ87+7rHi046M3NimT yyaENUw90rEklwDcqyUNpGMJA0DL0VLyAA== X-Google-Smtp-Source: AGHT+IHXXbOHceUHML/eR0FC9DXwtMFYGBOnTch463wKJje+4R7HWiSz2sxrMCMjUUoV45m1ioErsA== X-Received: by 2002:a50:cc83:0:b0:53e:7d91:611f with SMTP id q3-20020a50cc83000000b0053e7d91611fmr714186edi.11.1697694777189; Wed, 18 Oct 2023 22:52:57 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id s22-20020a50ab16000000b0053e589016a7sm3605507edc.16.2023.10.18.22.52.56 for <66624@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 22:52:56 -0700 (PDT) Message-ID: In-Reply-To: References: From: Liliana Marie Prikler Date: Thu, 19 Oct 2023 06:06:48 +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-Spam-Score: 7.35 X-Migadu-Queue-Id: AC16046E81 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: 7.35 X-TUID: XxKgzTs2CdkP * guix/build/emacs-build-system.scm (ensure-package-description) (patch-el-files, make-autoloads): Operate on the current working directory, either implicitly, or through (getcwd). (enable-autoloads-compilation): Deleted variable, logic moved into make-autoloads. (%standard-phases): Adjust accordingly. --- guix/build/emacs-build-system.scm | 85 +++++++++++++------------------ 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 3808b60445..aa083c6409 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -132,29 +132,25 @@ (define* (build #:key outputs inputs #:allow-other-keys) (parameterize ((%emacs emacs)) (emacs-compile-directory (elpa-directory out))))) -(define* (patch-el-files #:key outputs #:allow-other-keys) - "Substitute the absolute \"/bin/\" directory with the right location in the -store in '.el' files." - - (let* ((out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out)) - (el-dir (string-append out %install-dir "/" elpa-name-ver)) - (el-files (find-files (getcwd) "\\.el$"))) - (define (substitute-program-names) - (substitute* el-files - (("\"/bin/([^.]\\S*)\"" _ cmd-name) - (let ((cmd (which cmd-name))) - (unless cmd - (error "patch-el-files: unable to locate " cmd-name)) - (string-append "\"" cmd "\""))))) - - (with-directory-excursion el-dir - ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still - ;; ISO-8859-1-encoded. - (unless (false-if-exception (substitute-program-names)) - (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute-program-names)))) - #t)) +(define* (patch-el-files #:key inputs outputs #:allow-other-keys) + "Substitute the absolute \"/bin/\" and \"/sbin\" directories with the right +locations in the store in '.el' files." + + (define substitute-program-names + (let ((el-files (find-files (getcwd) "\\.el$"))) + (lambda () + (substitute* el-files + (("\"/(s?bin/[^.]\\S*)\"" _ cmd) + (let ((cmd (search-input-file inputs cmd))) + (unless cmd + (error "patch-el-files: unable to locate " (basename cmd))) + (string-append "\"" cmd "\""))))))) + + (unless (false-if-exception (substitute-program-names)) + ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still + ;; ISO-8859-1-encoded. + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute-program-names)))) (define (find-root-library-file name) (let loop ((parts (string-split @@ -224,10 +220,8 @@ (define* (ensure-package-description #:key outputs #:allow-other-keys) (emacs-batch-edit-file (string-append name ".el") %write-pkg-file-form))) - (let* ((out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out))) - (with-directory-excursion (elpa-directory out) - (and=> (find-root-library-file elpa-name-ver) write-pkg-file)))) + (let ((name (store-directory->elpa-name-version (assoc-ref outputs "out")))) + (and=> (find-root-library-file name) write-pkg-file))) (define* (check #:key tests? (test-command '("make" "check")) (parallel-tests? #t) #:allow-other-keys) @@ -306,24 +300,15 @@ (define* (move-doc #:key outputs #:allow-other-keys) info-files))) #t)) -(define* (make-autoloads #:key outputs inputs #:allow-other-keys) +(define* (make-autoloads #:key outputs #:allow-other-keys) "Generate the autoloads file." - (let* ((emacs (search-input-file inputs "/bin/emacs")) - (out (assoc-ref outputs "out")) - (elpa-name-ver (store-directory->elpa-name-version out)) - (elpa-name (package-name->name+version elpa-name-ver)) - (el-dir (elpa-directory out))) - (parameterize ((%emacs emacs)) - (emacs-generate-autoloads elpa-name el-dir)))) - -(define* (enable-autoloads-compilation #:key outputs #:allow-other-keys) - "Remove the NO-BYTE-COMPILATION local variable embedded in the generated -autoload files." - (let* ((out (assoc-ref outputs "out")) - (autoloads (find-files out "-autoloads.el$"))) - (substitute* autoloads - ((";; no-byte-compile.*") "")) - #t)) + (emacs-generate-autoloads + (package-name->name+version (store-directory->elpa-name-version + (assoc-ref outputs "out"))) + (getcwd)) + ;; Ensure that autoloads can be byte-compiled. + (substitute* (find-files "." "-autoloads\\.el$") + ((";; no-byte-compile.*") ""))) (define* (validate-compiled-autoloads #:key outputs #:allow-other-keys) "Verify whether the byte compiled autoloads load fine." @@ -358,7 +343,11 @@ (define (elpa-directory store-dir) (define %standard-phases (modify-phases gnu:%standard-phases (replace 'unpack unpack) + (add-after 'unpack 'ensure-package-description + ensure-package-description) (add-after 'unpack 'expand-load-path expand-load-path) + (add-after 'unpack 'patch-el-files patch-el-files) + (add-after 'expand-load-path 'make-autoloads make-autoloads) (add-after 'expand-load-path 'add-install-to-native-load-path add-install-to-native-load-path) (delete 'bootstrap) @@ -366,14 +355,8 @@ (define %standard-phases (delete 'build) (replace 'check check) (replace 'install install) - (add-after 'install 'make-autoloads make-autoloads) - (add-after 'make-autoloads 'enable-autoloads-compilation - enable-autoloads-compilation) - (add-after 'enable-autoloads-compilation 'patch-el-files patch-el-files) - (add-after 'patch-el-files 'ensure-package-description - ensure-package-description) ;; The .el files are byte compiled directly in the store. - (add-after 'ensure-package-description 'build build) + (add-after 'install 'build build) (add-after 'build 'validate-compiled-autoloads validate-compiled-autoloads) (add-after 'validate-compiled-autoloads 'move-doc move-doc))) -- 2.41.0