summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-10-30 23:45:22 +0100
committerAndreas Enge <andreas@enge.fr>2026-02-07 12:28:19 +0100
commitf03ffef29925e8e04f5ec37b0a9eb6921157e563 (patch)
tree367108f157e79d6339f874d606308809d079b668 /gnu
parent121bcd069905087e00d7452f26a6c4088e8d5bfa (diff)
gnu: meson: Use a custom build-system.
This allows us to decouple meson and all its dependents from the pyproject-build-system, and avoid a lot of rebuilds (rusts, llvm...). * gnu/packages/build-tools.scm (meson) [build-system]: Replace pyproject-build-system with a patched gnu-build-system. [arguments]<#:phases>: Adapt accordindly. [native-inputs]: Replace python-setuptools by python-setuptools-bootstrap. Change-Id: Ieb4b007847d567aad04734a62cfc6c07e2bb2f96 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/build-tools.scm47
1 files changed, 30 insertions, 17 deletions
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 660bef2651..81c52bc17c 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -378,24 +378,37 @@ files and generates build instructions for the Ninja build system.")
(sha256
(base32
"13a9pj7d2mxgv5gbd78di4pb4w722vjis0vmk38m1vdm95v2f9yd"))))
- (build-system pyproject-build-system)
+ (build-system gnu-build-system)
(arguments
- (list #:tests? #f ;disabled to avoid extra dependencies
- #:phases
- #~(modify-phases %standard-phases
- ;; Meson calls the various executables in out/bin through the
- ;; Python interpreter, so we cannot use the shell wrapper.
- (replace 'wrap
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (substitute* (search-input-file outputs "bin/meson")
- (("import sys" all)
- (string-append
- all "\n"
- "sys.path.insert(0, '"
- (site-packages inputs outputs)
- "')"))))))))
- (native-inputs (list python-setuptools))
- (inputs (list python ninja))
+ (list
+ #:tests? #f ;disabled to avoid extra dependencies
+ ;; Essentially a lighter copy of the former python-build-system.
+ ;; Using it rather than pyproject-build-system allows to edit the latter
+ ;; without a C++ world rebuild.
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'bootstrap)
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (invoke "python" "./setup.py" "build")))
+ (replace 'install
+ (lambda _
+ (invoke "python" "./setup.py" "install"
+ (string-append "--prefix=" #$output) "--no-compile")
+ (invoke "python" "-m" "compileall"
+ "--invalidation-mode=unchecked-hash" #$output)))
+ ;; Meson calls the various executables in out/bin through the
+ ;; Python interpreter, so we cannot use the shell wrapper.
+ (add-after 'install 'wrap
+ (lambda _
+ (let* ((mdist (car (find-files #$output "^mdist\\.py$")))
+ (site (dirname (dirname mdist))))
+ (substitute* (string-append #$output "/bin/meson")
+ (("import sys" all)
+ (format #f "~a~%sys.path.insert(0, ~s)" all site)))))))))
+ (native-inputs (list python-setuptools-bootstrap))
+ (inputs (list python-wrapper ninja))
(home-page "https://mesonbuild.com/")
(synopsis "Build system designed to be fast and user-friendly")
(description