From patchwork Thu Mar 20 10:08:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 40484 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 6B04127BBE9; Thu, 20 Mar 2025 10:11:50 +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=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 53ABE27BBE2 for ; Thu, 20 Mar 2025 10:11:48 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tvCrF-0005tG-OX; Thu, 20 Mar 2025 06:10:37 -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 1tvCqo-0005gK-1n for guix-patches@gnu.org; Thu, 20 Mar 2025 06:10:12 -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 1tvCqn-0001Hy-B9 for guix-patches@gnu.org; Thu, 20 Mar 2025 06:10:09 -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:References:In-Reply-To:Date:From:To:Subject; bh=vI4Y/b0EV0Z9XRQ50hAgcJsvyzZ3qaORahvqCL5aziA=; b=l8Dyc6dKq7UztsSeIgVSMou0ECxfNvOAOskkZRCHvreikd7WTv1b6GkYhqfXBmSjS71Oa6/u6GigQWzHjTXwXUg+f+fat5brfzl8URTaaU76VNOroSJ9snBKhYAdi61YcQc1QwfcMyzmrXcmo7GylJmCIPKNl9kKXcanm8FsNIj2WJIRIQm3USwTSxqTjxQcCrFQPheY6Nkm8O+KVFMGw5UzCxX6Afc2FyysY8+iuk9Nh1tn6B44ynFEOlYxRdYhkWF8MM/teIgBReNCrHd/mlK/2PaPihDxCHqfMALeKHbmW26cfDPMgWoBOhZG2TgPbam+C3WGbh1PD4+r56jj6A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tvCqn-0002ND-4r for guix-patches@gnu.org; Thu, 20 Mar 2025 06:10:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77131] [PATCH 08/51] gnu: Add makem-minimal. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Mar 2025 10:10:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77131 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77131@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 77131-submit@debbugs.gnu.org id=B77131.17424653778589 (code B ref 77131); Thu, 20 Mar 2025 10:10:09 +0000 Received: (at 77131) by debbugs.gnu.org; 20 Mar 2025 10:09:37 +0000 Received: from localhost ([127.0.0.1]:55310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tvCqG-0002EN-Dk for submit@debbugs.gnu.org; Thu, 20 Mar 2025 06:09:36 -0400 Received: from 6.mo563.mail-out.ovh.net ([46.105.55.200]:50537) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tvCpw-0002AT-Lr for 77131@debbugs.gnu.org; Thu, 20 Mar 2025 06:09:20 -0400 Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net [79.137.60.37]) by mo563.mail-out.ovh.net (Postfix) with ESMTPS id 4ZJLs748qCz1dPK; Thu, 20 Mar 2025 10:09:15 +0000 (UTC) Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net. [127.0.0.1]) by director4.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <77131@debbugs.gnu.org>; Thu, 20 Mar 2025 10:09:15 +0000 (UTC) Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.164.135]) by director4.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4ZJLs73Sw2zy6S; Thu, 20 Mar 2025 10:09:15 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.5]) by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 213A3BA3D98; Thu, 20 Mar 2025 10:09:15 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-105G00631c4e689-16d1-466f-8769-e661fe535f5e, 4F160D40D8CAC2A3A770F4A5EC3EDE71EC7A5460) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Thu, 20 Mar 2025 11:08:16 +0100 Message-ID: <20250320100907.20485-8-ngraves@ngraves.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250320100907.20485-1-ngraves@ngraves.fr> References: <20250320100907.20485-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 16810530036706304738 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeejleefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepudetudfgtedtvdelvefgfeevvdeffedvtdeiffegkeetudeufedtiedtieduhfefnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpmhgrkhgvmhdrshhhnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedufeduseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdfovfetjfhoshhtpehmohehieefmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=vI4Y/b0EV0Z9XRQ50hAgcJsvyzZ3qaORahvqCL5aziA=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1742465355; v=1; b=QVj/EH0T8C/qsEtEP8q1WicCNwmLvwFYnw4DizVGA6s7UV91aN0/mh7okbSMU16fZnr9Op1Q 9LSWOlu762pyrz0c0rFw8dRyn6WbbuLKW0SazdHPpvQ9IICBDt1clX5m2JbTgB6Iobul/rHaiGv Hsm3WqA50GTHln11xcrpGCUM73FTEBKqf7JeoufOzIbJwNv5C3JNPGA+Xt9F1M/xA9IowJYFqqG N4/X5VBq/JG77xLQa+v1VSi8wXBuhsPrOL8xuknkJgWEV9EqyiDk6Ke6/o/U85hoGe1ySZ/sf+D fTJ5aZ072PkysPX/bUXyGNwm94U12mI/wWCpviN9JIjPQ== 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 * gnu/packages/emacs-build.scm (makem-minimal): New variable. --- gnu/local.mk | 1 + gnu/packages/emacs-build.scm | 59 +++++++++++++++++ gnu/packages/patches/makem-replace-git.patch | 66 ++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 gnu/packages/patches/makem-replace-git.patch diff --git a/gnu/local.mk b/gnu/local.mk index 417cbf080d..21d58b9bef 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1827,6 +1827,7 @@ dist_patch_DATA = \ %D%/packages/patches/mailutils-variable-lookup.patch \ %D%/packages/patches/mandoc-support-zstd-compression.patch \ %D%/packages/patches/make-impure-dirs.patch \ + %D%/packages/patches/makem-replace-git.patch \ %D%/packages/patches/mariadb-rocksdb-atomic-linking.patch \ %D%/packages/patches/mathjax-disable-webpack.patch \ %D%/packages/patches/mathjax-no-a11y.patch \ diff --git a/gnu/packages/emacs-build.scm b/gnu/packages/emacs-build.scm index aa917cc0ac..bc7c9ca708 100644 --- a/gnu/packages/emacs-build.scm +++ b/gnu/packages/emacs-build.scm @@ -521,3 +521,62 @@ (define-public makel (description "This package provides a makefile to help checking Emacs packages.") (license license:gpl3+)))) + +;; This is an alternative version patches for internal Guix tests. +;; The user-facing version is in emacs-xyz.scm +(define-public makem-minimal + (package + (name "makem") + (version "0.7.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/alphapapa/makem.sh") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1xqwfxkxgpcm3k2m2shwkwrm4asl59ik8867c3k1iwfj8xzfp089")) + (modules '((guix build utils))) + (snippet #~(begin + (delete-file-recursively "images"))))) + (build-system emacs-build-system) + (arguments + (let ((patch (local-file + (car (search-patches "makem-replace-git.patch"))))) + (list + #:tests? #f + #:modules + '((guix build emacs-build-system) + (guix build utils) + (guix build emacs-utils) + (srfi srfi-26)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-file + (lambda* (#:key inputs #:allow-other-keys) + (invoke (search-input-file inputs "bin/patch") + "--force" "--no-backup-if-mismatch" + "-p1" "--input" #$patch))) + (add-after 'install 'install-bin + (lambda _ + (let ((bin (string-append #$output "/bin"))) + (mkdir-p bin) + (install-file "makem.sh" bin)))) + (add-after 'install-bin 'wrap-script + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/makem.sh") + `("PATH" ":" prefix + ,(map dirname + (map (cut search-input-file inputs <>) + (list "bin/find" + "bin/grep" + "bin/sed"))))))))))) + (native-inputs (list patch)) + (inputs + (list coreutils-minimal grep sed util-linux)) ; for getopt + (home-page "https://github.com/alphapapa/makem.sh") + (synopsis "Makefile-like script to help checking Emacs packages") + (description "This package provides a Makefile-like script and a transient +menu for linting and testing Emacs packages.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/makem-replace-git.patch b/gnu/packages/patches/makem-replace-git.patch new file mode 100644 index 0000000000..eced0618e3 --- /dev/null +++ b/gnu/packages/patches/makem-replace-git.patch @@ -0,0 +1,66 @@ +From 5396f4d6312b24eac79da2f70279df773443fd10 Mon Sep 17 00:00:00 2001 +From: Nicolas Graves +Date: Wed, 19 Mar 2025 13:02:47 +0100 +Subject: [PATCH] Replace git. + +--- + makem.sh | 34 +++++----------------------------- + 1 file changed, 5 insertions(+), 29 deletions(-) + +diff --git a/makem.sh b/makem.sh +index fd81e0f..4ec9577 100755 +--- a/makem.sh ++++ b/makem.sh +@@ -385,34 +385,13 @@ function byte-compile-file { + + # ** Files + +-function submodules { +- # Echo a list of submodules's paths relative to the repo root. +- # TODO: Parse with bash regexp instead of cut. +- git submodule status | awk '{print $2}' +-} +- +-function project-root { +- # Echo the root of the project (or superproject, if running from +- # within a submodule). +- root_dir=$(git rev-parse --show-superproject-working-tree) +- [[ $root_dir ]] || root_dir=$(git rev-parse --show-toplevel) +- [[ $root_dir ]] || error "Can't find repo root." +- +- echo "$root_dir" +-} +- + function files-project { + # Echo a list of files in project; or with $1, files in it +- # matching that pattern with "git ls-files". Excludes submodules. +- [[ $1 ]] && pattern="/$1" || pattern="." +- +- local excludes +- for submodule in $(submodules) +- do +- excludes+=(":!:$submodule") +- done +- +- git ls-files -- "$pattern" "${excludes[@]}" ++ # matching that pattern with "find". ++ if [[ $1 ]] ++ then find . -type f -name "$1" | sed 's|^\./||' ++ else find . -type f | sed 's|^\./||' ++ fi + } + + function dirs-project { +@@ -1223,9 +1202,6 @@ paths_temp+=("$package_initialize_file") + + trap cleanup EXIT INT TERM + +-# Change to project root directory first. +-cd "$(project-root)" +- + # Discover project files. + files_project_feature=($(files-project-feature)) + files_project_test=($(files-project-test)) +-- +2.48.1 +