GNU bug report logs - #78560
[PATCH 1/4] gnu: Add samurai.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 23 May 2025 06:35:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78560 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to code <at> greghogan.com, guix-patches <at> gnu.org:
bug#78560; Package guix-patches. (Fri, 23 May 2025 06:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to code <at> greghogan.com, guix-patches <at> gnu.org. (Fri, 23 May 2025 06:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 1/4] gnu: Add samurai.
Date: Fri, 23 May 2025 15:34:11 +0900
* gnu/packages/ninja.scm (samurai): New variable.

Change-Id: I5be4fd7e5100adfd24370a1ce8d7377a6b45df3b
---
 gnu/packages/ninja.scm | 43 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/ninja.scm b/gnu/packages/ninja.scm
index 42c9309b82..7b517b9837 100644
--- a/gnu/packages/ninja.scm
+++ b/gnu/packages/ninja.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Marius Bakke <mbakke <at> fastmail.com>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,11 +22,14 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages ninja)
-  #:use-module ((guix licenses) #:select (asl2.0))
+  #:use-module ((guix licenses) #:select (asl2.0 expat))
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages python))
 
 (define-public ninja
@@ -75,3 +79,40 @@ (define-public ninja
 files generated by a higher-level build system, and it is designed to run
 builds as fast as possible.")
     (license asl2.0)))
+
+(define-public samurai
+  (package
+    (name "samurai")
+    (version "1.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/michaelforney/samurai")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "04iw18hgkm72yrl83a2xh1jc47w9rilpb95kwick0j37b4q3gxj4"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f                  ;no test suite
+           #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                                (string-append "PREFIX=" #$output))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'patch-/bin/sh
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (substitute* "build.c"
+                              (("/bin/sh")
+                               (search-input-file inputs "bin/sh")))))
+                        (delete 'configure))))
+    (inputs (list bash-minimal))
+    (home-page "https://github.com/michaelforney/samurai")
+    (synopsis "Ninja-compatible build tool written in C")
+    (description "@code{samurai} is a ninja-compatible build tool written in
+C99 with a focus on simplicity, speed, and portability.  It is
+feature-complete and supports most of the same options as ninja.  This package
+provides the command @command{samu}.  For a @command{ninja} command
+replacement, use the @code{samu-as-ninja-wrapper} package.")
+    (license (list asl2.0               ;for the most part
+                   expat))))            ;htab.h, htab.c and tree.c
+

base-commit: cf84898b4baea91f9f1139bf8af1529e2d63a45a
-- 
2.49.0





Information forwarded to code <at> greghogan.com, guix-patches <at> gnu.org:
bug#78560; Package guix-patches. (Fri, 23 May 2025 06:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 78560 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78560 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 2/4] gnu: Add samu-as-ninja-wrapper.
Date: Fri, 23 May 2025 15:38:25 +0900
* gnu/packages/ninja.scm (samu-as-ninja-wrapper): New variable.

Change-Id: I8227fc23ebb2bf9cdc9a6729be9f00ff10b196ca
---
 gnu/packages/ninja.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/ninja.scm b/gnu/packages/ninja.scm
index 7b517b9837..398c4be10f 100644
--- a/gnu/packages/ninja.scm
+++ b/gnu/packages/ninja.scm
@@ -27,6 +27,7 @@ (define-module (gnu packages ninja)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages bash)
@@ -116,3 +117,21 @@ (define-public samurai
     (license (list asl2.0               ;for the most part
                    expat))))            ;htab.h, htab.c and tree.c
 
+(define-public samu-as-ninja-wrapper
+  (package/inherit samurai
+    (name "samu-as-ninja-wrapper")
+    (build-system trivial-build-system)
+    (arguments
+     (list #:builder
+           (with-imported-modules '((guix build utils))
+             #~(begin
+                 (use-modules (guix build utils))
+                 (let ((bindir (string-append #$output "/bin"))
+                       (samu (string-append #$(this-package-input "samurai")
+                                            "/bin/samu")))
+                   (mkdir-p bindir)
+                   (symlink samu (string-append bindir "/ninja")))))))
+    (inputs (list samurai))
+    (description "This package provides the @command{ninja} command,
+implemented as a symbolic link to the @command{samu} command of @code{samurai}
+package.")))
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78560; Package guix-patches. (Fri, 23 May 2025 06:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 78560 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78560 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 4/4] gnu: Add muon-as-meson-wrapper.
Date: Fri, 23 May 2025 15:38:27 +0900
* gnu/packages/build-tools.scm (muon-as-meson-wrapper): New variable.

Change-Id: I13d9a71e0be896e47115379415b88f0969e207a5
---
 gnu/packages/build-tools.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 58bad94ff8..f008656a8b 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -43,6 +43,7 @@ (define-module (gnu packages build-tools)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system guile)
+  #:use-module (guix build-system trivial)
   #:use-module (guix modules)
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
@@ -416,6 +417,25 @@ (define-public muon
 with minimal dependencies.")
     (license license:gpl3)))            ;for the combined work
 
+(define-public muon-as-meson-wrapper
+  (package/inherit muon
+    (name "muon-as-meson-wrapper")
+    (build-system trivial-build-system)
+    (arguments
+     (list #:builder
+           (with-imported-modules '((guix build utils))
+             #~(begin
+                 (use-modules (guix build utils))
+                 (let ((bindir (string-append #$output "/bin"))
+                       (samu (string-append #$(this-package-input "muon")
+                                            "/bin/muon")))
+                   (mkdir-p bindir)
+                   (symlink samu (string-append bindir "/meson")))))))
+    (inputs (list muon))
+    (description "This package provides the @command{meson} command,
+implemented as a symbolic link to the @command{muon} command of @code{muon}
+package.")))
+
 (define-public premake4
   (package
     (name "premake")
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78560; Package guix-patches. (Fri, 23 May 2025 06:39:03 GMT) Full text and rfc822 format available.

Message #14 received at 78560 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 78560 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 3/4] gnu: Add muon.
Date: Fri, 23 May 2025 15:38:26 +0900
* gnu/packages/build-tools.scm (muon): New variable.

Change-Id: I482fdbf5196ec6b23232b85febfa34ffb43fe912
---
 gnu/packages/build-tools.scm | 42 ++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 1335989bb2..58bad94ff8 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -374,6 +374,48 @@ (define-public meson-python
     (description "Meson-python is a PEP 517 build backend for Meson projects.")
     (license license:expat)))
 
+(define-public muon
+  (package
+    (name "muon")
+    (version "0.4.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/muon-build/muon")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "137rrsp5r31pv5sdccfcnaic0sbd9j88qqy8d1mqvvrdmyl74dy5"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f                  ;to avoid extra dependencies
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'bootstrap
+                 (lambda _
+                   (setenv "CC" "gcc")
+                   (setenv "CFLAGS" "-DBOOTSTRAP_NO_SAMU")
+                   (invoke "sh" "bootstrap.sh" "build")))
+               (replace 'configure
+                 (lambda _
+                   (invoke "build/muon-bootstrap" "setup" "-Dprefix=/"
+                           "build")))
+               (replace 'build
+                 (lambda _
+                   (invoke "samu" "-C" "build")))
+               (replace 'install
+                 (lambda _
+                   (setenv "DESTDIR" #$output)
+                   (invoke "build/muon" "-C" "build" "install"))))))
+    (native-inputs (list samurai))
+    (inputs (list pkgconf))
+    (home-page "https://muon.build/")
+    (synopsis "Meson build system alternative implementation in C99")
+    (description "Muon is an implementation of the meson build system in c99
+with minimal dependencies.")
+    (license license:gpl3)))            ;for the combined work
+
 (define-public premake4
   (package
     (name "premake")
-- 
2.49.0





This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.