From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kLV1DQ0yNmXpZAEA9RJhRA:P1 (envelope-from ) for ; Mon, 23 Oct 2023 10:42:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kLV1DQ0yNmXpZAEA9RJhRA (envelope-from ) for ; Mon, 23 Oct 2023 10:42:53 +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 DA8E134ED7 for ; Mon, 23 Oct 2023 10:42:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=PXVq6Vy2; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698050573; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=ENCACdBq1IKzp++45h3pz+EXCRXjKrFrlvBt3aQFodU=; b=c9yvNNQmHn6EVGAzAplFGeZisqaQ1q9SUHxn3qZlEzXjAbfy+wEvO/sfga4Yriw0U40Z3p FijGYH3Hwa/h6gU/eV18leLWgPWhLWYgxhLVHixyKZS7+S65q0EinIwKvJnYV3JJP3t0Vk pTXRw1sXizBslle4VH34SROnWtJm/LIkOBL9ZXb6TIFsrG2IZdxHPyoC2vZcJsqLsEfbY9 9n3XCQKkz7n8gNS1GkcDeyDCu1kHYyEh0lLW0K3kXERV1xnXAe5r7XQa/1ny2I6Ty3cgTj iOvq1rvul1CIyXpm6YvWSG5m9HaZRN8LJC1mNG8ZAfW3RgUxMm7scvaojxDTVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=PXVq6Vy2; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698050573; a=rsa-sha256; cv=none; b=akZcF2VZZNUZhSE8qYuypZSWW1Ofx0FVRTiX35XL/COzJ4YUNlz+M3t1ojjcquMjMfbXv6 hjWVdQoCpjRHP592m/Ta9yIJQt0a6vzxycS7Vx2kcNNDm//v84H79xXbyWR+mrsx30gV8q TPUwy4aGpoA5iXiIGB2WSGd/JxKRbtp3nF6a0WrkEVCV2uxx8KMYXDfLHONp/Jkh2UEiJk +Sz+X9PTZfAWXwFEnRxymrHUXKySfnoaz4m7B3QvkQP1ABcwvPk1UpFazlLrJ7QfUSY1d2 R5i1VD4VoqxbKjo4ku0nOcp1GHxvfgGKqKdyCael66STRrAE728yvC1f/hGIcA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quqWI-0001lT-Of; Mon, 23 Oct 2023 04:42:42 -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 1quqWA-0001gG-9J for guix-patches@gnu.org; Mon, 23 Oct 2023 04:42:34 -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 1quqWA-0003yG-0i for guix-patches@gnu.org; Mon, 23 Oct 2023 04:42:34 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quqWc-0002r7-IU for guix-patches@gnu.org; Mon, 23 Oct 2023 04:43:02 -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: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Oct 2023 08:43:02 +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: Liliana Marie Prikler , 66624@debbugs.gnu.org Cc: cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com Received: via spool by 66624-submit@debbugs.gnu.org id=B66624.169805053410900 (code B ref 66624); Mon, 23 Oct 2023 08:43:02 +0000 Received: (at 66624) by debbugs.gnu.org; 23 Oct 2023 08:42:14 +0000 Received: from localhost ([127.0.0.1]:49003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quqVq-0002pj-00 for submit@debbugs.gnu.org; Mon, 23 Oct 2023 04:42:14 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:36975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quqVl-0002pP-3j for 66624@debbugs.gnu.org; Mon, 23 Oct 2023 04:42:12 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 096A924001A; Mon, 23 Oct 2023 08:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1698050493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ENCACdBq1IKzp++45h3pz+EXCRXjKrFrlvBt3aQFodU=; b=PXVq6Vy2tO2DV2EHtrYr7wf+YOVdv3iWQWCJnkMOCZPRdr+a49IzuJuvK+zVD5weWVAz27 VU1/qRC0hjbPEICg4a2Ncl5ob0IfWkAiplbxNmRDEdzfeJxY0mqejSnM98bfXvTbJ8OCiM quRWIYyVb3b/567/ofcO4En+QPbLkYoVYJ9RMFf2EDPRwqQxh4daSmG5Oq2lyKCgdVsCMl JaQAJ0E1clhmqhCqvrSvf07zjKT3EQnoya5bUGSPfcCN8ctjAxdkUD0/l07dS7d7jDWc7N xIhF7N7s22y58g6EoZHngAkjS2jM+Tvw3VT77dY9cRD2QXM4ZRRPgJ5uQhcKnw== From: Andrew Tropin In-Reply-To: References: Date: Mon, 23 Oct 2023 12:41:29 +0400 Message-ID: <8734y13f46.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-GND-Sasl: andrew@trop.in 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.80 X-Spam-Score: -0.80 X-Migadu-Queue-Id: DA8E134ED7 X-Migadu-Scanner: mx2.migadu.com X-TUID: +45dQS2iC+H0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2023-10-19 06:06, Liliana Marie Prikler wrote: > * guix/build/emacs-build-system.scm (ensure-package-description) > (patch-el-files, make-autoloads): Operate on the current working director= y, > either implicitly, or through (getcwd). Sounds reasonable and seems to simplify build phases. > (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-s= ystem.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))))) >=20=20 > -(define* (patch-el-files #:key outputs #:allow-other-keys) > - "Substitute the absolute \"/bin/\" directory with the right location i= n 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)))) >=20=20 > (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))) >=20=20 > - (let* ((out (assoc-ref outputs "out")) > - (elpa-name-ver (store-directory->elpa-name-version out))) > - (with-directory-excursion (elpa-directory out) > - (and=3D> (find-root-library-file elpa-name-ver) write-pkg-file)))) > + (let ((name (store-directory->elpa-name-version (assoc-ref outputs "ou= t")))) > + (and=3D> (find-root-library-file name) write-pkg-file))) >=20=20 > (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)) >=20=20 > -(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 generat= ed > -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.*") ""))) >=20=20 > (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-fi= les) > - (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-aut= oloads) > (add-after 'validate-compiled-autoloads 'move-doc move-doc))) I didn't spot any obvious issues with the patch series. Thank you for work= ing on it! =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmU2MbkACgkQIgjSCVjB 3rAlFRAAlsvHuiPUOFl/H1bkfMtKZKlffx+gU3u7glfUwJ/qeIOG7S1AplxcJ6Qj KK61lpSOYJoQjardbTXQ/LL5yyifB8v+oh0pDGALJHrS8HFzJ//TO83qtdXxrrM5 pow74JurhZ3szx1ruOjdV5zD4VcxLEbRuH8hcItOi69Mni1jX88f5oqfoBOD89tR itvMbEVM+PepgTNqpwUNA8pak71qwleN1tZrAzVQayVM8bdSyIG18THuiY99jaWD ORnzDvZI1tH1YymOYVWIMmVWdgJQUChFBwW/TDH00C76j8qISv28ncAtxhIE7HaV aYva2KzMNRy4sC4Woaxe2xGCPGg+Nn6F2I3yb2Azc7Kp+YfhF/qmMbpBIyyH3C0k axQUSft0dpSBjv4lARwKa7x0JmSQfPckiVUrwcEsmSyZri8T9ulLD2/n/2ln0Vg0 WE+qMqlbIHYUszN2B/9mk4arJ4iIbNZA6dhvx8CglzNx5b4fKyy9nb1+/865W07Q MAD8ICvK3RGbXwyVIO3Bbmybe9Jr+89c2e4M3PhJcgkh4J2Fan9LfFhKji71h51D 6STXXZg0BaMNh4h5Y3V9K4Cn7XYVEnM+rXMZJvaqP2qerQveBr7krdMSjd3acD65 5/H33FE25Y7rcIQZwAPpd2mjMS9FAihaT1l4Yq5/twx+eWLzJqI= =x7AG -----END PGP SIGNATURE----- --=-=-=--