[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#77131] [PATCH 08/51] gnu: Add makem-minimal.
From: |
Nicolas Graves |
Subject: |
[bug#77131] [PATCH 08/51] gnu: Add makem-minimal. |
Date: |
Thu, 20 Mar 2025 11:08:16 +0100 |
* 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 <ngraves@ngraves.fr>
+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
+
--
2.48.1
- [bug#77131] [PATCH 12/51] gnu: emacs-notmuch: Disable tests., (continued)
- [bug#77131] [PATCH 12/51] gnu: emacs-notmuch: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 17/51] gnu: emacs-git-email: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 13/51] gnu: emacs-orgit: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 22/51] gnu: emacs-notmuch-maildir: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 16/51] gnu: emacs-lsp-metals: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 25/51] gnu: emacs-lsp-ui: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 21/51] gnu: emacs-bbdb-vcard: Skip failing tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 05/51] gnu: emacs-pcre2el: Update to 1.12-0.b4d846d., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 09/51] gnu: emacs-org-noter: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 07/51] gnu: Add makel., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 08/51] gnu: Add makem-minimal.,
Nicolas Graves <=
- [bug#77131] [PATCH 14/51] gnu: emacs-flycheck-grammalecte: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 23/51] gnu: emacs-notmuch-addr: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 26/51] gnu: emacs-mustache: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 20/51] gnu: emacs-semi-epg: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 28/51] gnu: emacs-ripgrep: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 19/51] gnu: emacs-spamfilter-el: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 18/51] gnu: emacs-ol-notmuch: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 15/51] gnu: emacs-persp-mode: Fix tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 27/51] gnu: emacs-lsp-treemacs: Disable tests., Nicolas Graves, 2025/03/20
- [bug#77131] [PATCH 29/51] gnu: emacs-paren-face: Fix tests., Nicolas Graves, 2025/03/20