Subject: [bug#78560] [PATCH 3/4] gnu: Add muon.

From: Maxim Cournoyer <[email-masked]>
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