From patchwork Mon Mar 3 02:09:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 39631 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 19A2927BBE9; Mon, 3 Mar 2025 02:10:34 +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=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 7D10D27BBE2 for ; Mon, 3 Mar 2025 02:10:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tovGE-0003IZ-6W; Sun, 02 Mar 2025 21:10:26 -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 1tovFt-00030J-Kj for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:06 -0500 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 1tovFt-00014M-7q for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=rq1mhPKcsPTsFzSpCJLKafTQtL8K6vZFIug55BP6V1w=; b=fYEBTxw7dnmCShYi9MR+16PmZKEL3sCdsijGPmLvYI4JNwyQa5/kBvL2XjOBFKzuAzusQN+ifuvugR+E5AXlnfiyuJBLeGvufZJVGjiz/pVJ+nEdaB0dxgdq8yAjcXzdmuiwmDtrUkLjOm6uRK7aOKZbl5mLGYyJwlbnO0CgJbj9mWIK77f2+YXfpNm5qYVRogP1XmitIplXQ3yYvnC3qclei+VBE1hQQjlxAcziUyjO3eONne7+EnfZ7CDKAOdlcHxDD/JkHSM5L7+QNphptjt/ooJsmZhR6hIlYHYHTV+9ECtkJ/wwbiX+Qg8usPk8YIiazhJ8kT7LZa87K+0Axw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tovFs-0007f3-WD for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76699] [PATCH 4/5] Use a development channel instead of guix.scm Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Mar 2025 02:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76699 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76699@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 76699-submit@debbugs.gnu.org id=B76699.174096779429348 (code B ref 76699); Mon, 03 Mar 2025 02:10:04 +0000 Received: (at 76699) by debbugs.gnu.org; 3 Mar 2025 02:09:54 +0000 Received: from localhost ([127.0.0.1]:40751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tovFg-0007d5-VF for submit@debbugs.gnu.org; Sun, 02 Mar 2025 21:09:54 -0500 Received: from 6.mo560.mail-out.ovh.net ([87.98.165.38]:35271) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tovFW-0007bN-JP for 76699@debbugs.gnu.org; Sun, 02 Mar 2025 21:09:45 -0500 Received: from director11.ghost.mail-out.ovh.net (unknown [10.108.2.97]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4Z5j1c4zZJz1Vh0 for <76699@debbugs.gnu.org>; Mon, 3 Mar 2025 02:09:40 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-9vblb (unknown [10.110.96.237]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 143661FDDB; Mon, 3 Mar 2025 02:09:39 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-5b5ff79f4f-9vblb with ESMTPSA id fxSWJWMPxWd6YAcAkrx+OQ (envelope-from ); Mon, 03 Mar 2025 02:09:39 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G0015523aaf8-a601-434d-a087-22ec13bad09a, 3FD0527DE2CE9D3C35B0E9483E243F320C79A24B) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Mon, 3 Mar 2025 03:09:19 +0100 Message-ID: <20250303020932.4194-4-ngraves@ngraves.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250303020932.4194-1-ngraves@ngraves.fr> References: <20250303020932.4194-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 1109011410058011362 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeljeekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkefgudeuheevuefggfdthfevffdvuddvfeeuueeuudeuffdvveduieejveeiffffnecuffhomhgrihhnpehstghmrdhnvgigthdpghhnuhdrohhrghenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggedpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejieeileelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=rq1mhPKcsPTsFzSpCJLKafTQtL8K6vZFIug55BP6V1w=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1740967780; v=1; b=IuIyGatKXyi1UoMxNRS2s5Ukw3vLqLLxissgw8ayUMRHIcGvpIwIAEUAGeLMM1+tMO34J8/M FIBfRUEdMSaFG2573skAEh69At3DuSjdV4mUsGe0dfstQFEkmRKH2FrRGLOPP8kEDjRrdXH+t5O MxrkxGUIU8qi3wO6AJKcHLZ4IZfvQL0EzqQJZ+WYkHcpnMOhV19JPkLemVYbNiBcdssUtfBkn2m 2RgLAiasipvyEIPQNIXecLlja8Z3RY3lRw+fPLasqLjiz8cW8Ow46Vho6go325/hWbsR5tkLnFZ lOONhi8xal16WCzG28be4tKule3XxITgliB8IluYUAH+A== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves 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 --- .guix-channel | 3 + guix.scm => channel/emacs-guix-channel.scm | 69 ++++++-------- channel/emacs-guix-channel.scm.next | 104 +++++++++++++++++++++ 3 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 .guix-channel rename guix.scm => channel/emacs-guix-channel.scm (50%) create mode 100644 channel/emacs-guix-channel.scm.next diff --git a/.guix-channel b/.guix-channel new file mode 100644 index 0000000..bb2ac66 --- /dev/null +++ b/.guix-channel @@ -0,0 +1,3 @@ +(channel + (version 0) + (directory "channel")) diff --git a/guix.scm b/channel/emacs-guix-channel.scm similarity index 50% rename from guix.scm rename to channel/emacs-guix-channel.scm index d35b0ba..ea8a6e7 100644 --- a/guix.scm +++ b/channel/emacs-guix-channel.scm @@ -2,6 +2,7 @@ ;; Copyright © 2017 Alex Kost ;; Copyright © 2019 Oleg Pykhalov +;; Copyright © 2025 Nicolas Graves ;; This file is part of Emacs-Guix. @@ -21,72 +22,62 @@ ;;; Commentary: ;; This file contains Guix package for development version of -;; Emacs-Guix. To build or install, run: +;; Emacs-Guix. To build it, you need guile-git in your profile. +;; Then, in the parent directory, run or install: ;; -;; guix build --file=guix.scm -;; guix package --install-from-file=guix.scm +;; guix build -L channel emacs-guix-devel +;; guix install -L channel emacs-guix-devel ;; The main purpose of this file though is to make a development ;; environment for building Emacs-Guix: ;; -;; guix environment --pure --load=guix.scm +;; guix shell -L channel -D --pure emacs-guix-devel ;; ./autogen.sh ;; ./configure ;; make ;;; Code: +(define-module (emacs-guix-channel)) + (use-modules + (git) (ice-9 popen) (ice-9 rdelim) (guix build utils) (guix gexp) (guix git-download) (guix packages) + (guix utils) (gnu packages autotools) (gnu packages emacs) (gnu packages emacs-xyz) + (gnu packages guile-xyz) (gnu packages pkg-config) (gnu packages texinfo)) -(define %source-dir (dirname (current-filename))) - -(define (git-output . args) - "Execute 'git ARGS ...' command and return its output without trailing -newspace." - (with-directory-excursion %source-dir - (let* ((port (apply open-pipe* OPEN_READ "git" args)) - (output (read-string port))) - (close-pipe port) - (string-trim-right output #\newline)))) - -(define (current-commit) - (git-output "log" "-n" "1" "--pretty=format:%H")) - -(define emacs-guix-devel - (let ((commit (current-commit))) +(define-public emacs-guix/devel + (let* ((source-dir (dirname (dirname (current-filename)))) + (repo (repository-open source-dir)) + (commit (oid->string (object-id (revparse-single repo "HEAD"))))) (package (inherit emacs-guix) - (version (string-append (package-version emacs-guix) - "-" (string-take commit 7))) - (source (local-file %source-dir + (name "emacs-guix-devel") + (version (string-append + (string-drop-right (package-version emacs-guix) 7) + (string-take commit 7))) + (source (local-file source-dir #:recursive? #t - #:select? (git-predicate %source-dir))) + #:select? (git-predicate source-dir))) (arguments - (append (package-arguments emacs-guix) - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'autogen - (lambda _ (zero? (system* "sh" "autogen.sh")))))))) - (native-inputs - `(("pkg-config" ,pkg-config) - ;; 'emacs-minimal' does not find Emacs packages (this is for - ;; "guix environment"). - ("emacs" ,emacs-no-x) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("texinfo" ,texinfo)))))) - -emacs-guix-devel + (substitute-keyword-arguments (package-arguments emacs-guix) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'autogen + (lambda _ (zero? (system* "sh" "autogen.sh")))))))) + (propagated-inputs + (modify-inputs (package-propagated-inputs emacs-guix) + (replace "emacs-dash" emacs-llama) + (replace "emacs-magit-popup" emacs-transient)))))) ;;; guix.scm ends here diff --git a/channel/emacs-guix-channel.scm.next b/channel/emacs-guix-channel.scm.next new file mode 100644 index 0000000..58a2a44 --- /dev/null +++ b/channel/emacs-guix-channel.scm.next @@ -0,0 +1,104 @@ +;;; guix.scm --- Guix package for Emacs-Guix + +;; Copyright © 2017 Alex Kost +;; Copyright © 2019 Oleg Pykhalov +;; Copyright © 2025 Nicolas Graves + +;; This file is part of Emacs-Guix. + +;; Emacs-Guix is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; Emacs-Guix is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Emacs-Guix. If not, see . + +;;; Commentary: + +;; This file contains Guix package for development version of +;; Emacs-Guix. To build or install, run: +;; +;; guix build --file=guix.scm +;; guix package --install-from-file=guix.scm + +;; The main purpose of this file though is to make a development +;; environment for building Emacs-Guix: +;; +;; guix environment --pure --load=guix.scm +;; ./autogen.sh +;; ./configure +;; make + +;;; Code: + +(define-module (emacs-guix-channel)) + +(use-modules + (git) + (ice-9 match) + (ice-9 popen) + (ice-9 rdelim) + (guix build utils) + (guix gexp) + (guix git-download) + (guix packages) + (guix profiles) + (gnu packages autotools) + (gnu packages emacs) + (gnu packages emacs-xyz) + (rde packages emacs-xyz) + (gnu packages guile) + (gnu packages guile-xyz) + (rde packages guile-xyz) + (gnu packages package-management) + (gnu packages pkg-config) + (gnu packages terminals) + (gnu packages texinfo)) + +(define guix-with-guile-next + ((package-input-rewriting/spec `(("guile" . ,(const guile-next)))) guix)) + +(define emacs-guix/devel + (let* ((source-dir (dirname (dirname (current-filename)))) + (repo (repository-open source-dir)) + (commit (oid->string + (object-id (revparse-single repo "HEAD"))))) + (package + (inherit emacs-guix) + (name "emacs-guix-arei") + (version (string-append + (string-drop-right (package-version emacs-guix) 7) + (string-take commit 7))) + (source (local-file source-dir + #:recursive? #t + #:select? (git-predicate source-dir))) + ;; (arguments + ;; (append (package-arguments emacs-guix) + ;; '(#:phases + ;; (modify-phases %standard-phases + ;; (add-after 'unpack 'autogen + ;; (lambda _ (zero? (system* "sh" "autogen.sh")))))))) + (inputs + (modify-inputs (package-inputs emacs-guix) + (replace "guile" guile-next) + (append guile-ares-rs-latest) + (append foot))) + (propagated-inputs + (modify-inputs (package-propagated-inputs emacs-guix) + (append emacs-arei-latest)))))) + +(match (cdr (command-line)) + (("build" . rest) emacs-guix/devel) + ;; (("shell" "-D" . rest) ) + ;; (("shell" . rest) (specifications->manifest (list "emacs-guix/devel"))) + (otherwise (package->development-manifest emacs-guix/devel) + ;; (error (format #f "Unable to handle ~a!" otherwise)) + )) + +;;; guix.scm ends here