2017-09-13 14:37:39 +02:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
|
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
|
2019-03-17 16:32:24 +01:00
|
|
|
|
;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
|
2021-07-14 13:13:07 +02:00
|
|
|
|
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
|
2017-09-13 14:37:39 +02:00
|
|
|
|
;;;
|
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (guix build-system meson)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:use-module (guix gexp)
|
2017-09-13 14:37:39 +02:00
|
|
|
|
#:use-module (guix utils)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:use-module (guix store)
|
|
|
|
|
#:use-module (guix monads)
|
2017-09-13 14:37:39 +02:00
|
|
|
|
#:use-module (guix search-paths)
|
|
|
|
|
#:use-module (guix build-system)
|
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
|
#:use-module (guix build-system glib-or-gtk)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:export (%meson-build-system-modules
|
2021-07-14 13:13:07 +02:00
|
|
|
|
meson-build-system
|
|
|
|
|
make-cross-file))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
|
|
|
|
;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; Standard build procedure for packages using Meson. This is implemented as an
|
|
|
|
|
;; extension of `gnu-build-system', with the option to turn on the glib/gtk
|
|
|
|
|
;; phases from `glib-or-gtk-build-system'.
|
|
|
|
|
;;
|
|
|
|
|
;; Code:
|
|
|
|
|
|
2021-07-14 13:13:07 +02:00
|
|
|
|
(define (make-machine-alist triplet)
|
|
|
|
|
"Make an association list describing what should go into
|
|
|
|
|
the ‘host_machine’ section of the cross file when cross-compiling
|
|
|
|
|
for TRIPLET."
|
|
|
|
|
`((system . ,(cond ((target-hurd? triplet) "gnu")
|
|
|
|
|
((target-linux? triplet) "linux")
|
|
|
|
|
((target-mingw? triplet) "windows")
|
|
|
|
|
(#t (error "meson: unknown operating system"))))
|
|
|
|
|
(cpu_family . ,(cond ((target-x86-32? triplet) "x86")
|
|
|
|
|
((target-x86-64? triplet) "x86_64")
|
|
|
|
|
((target-arm32? triplet) "arm")
|
|
|
|
|
((target-aarch64? triplet) "aarch64")
|
|
|
|
|
((target-powerpc? triplet)
|
|
|
|
|
(if (target-64bit? triplet)
|
|
|
|
|
"ppc64"
|
|
|
|
|
"ppc"))
|
|
|
|
|
(#t (error "meson: unknown architecture"))))
|
|
|
|
|
(cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686
|
|
|
|
|
(substring triplet 0 4))
|
|
|
|
|
((target-x86-64? triplet) "x86_64")
|
|
|
|
|
((target-aarch64? triplet) "armv8-a")
|
|
|
|
|
((target-arm32? triplet) "armv7")
|
|
|
|
|
;; According to #mesonbuild on OFTC, there does not appear
|
|
|
|
|
;; to be an official-ish list of CPU types recognised by
|
|
|
|
|
;; Meson, the "cpu" field is not used by Meson itself and
|
|
|
|
|
;; most software doesn't look at this field, except perhaps
|
|
|
|
|
;; for selecting optimisations, so set it to something
|
|
|
|
|
;; arbitrary.
|
|
|
|
|
(#t "strawberries")))
|
|
|
|
|
(endian . ,(cond ((string-prefix? "powerpc64le-" triplet) "little")
|
|
|
|
|
((string-prefix? "mips64el-" triplet) "little")
|
|
|
|
|
((target-x86-32? triplet) "little")
|
|
|
|
|
((target-x86-64? triplet) "little")
|
|
|
|
|
;; At least in Guix. Aarch64 and 32-bit arm
|
|
|
|
|
;; have a big-endian mode as well.
|
|
|
|
|
((target-arm? triplet) "little")
|
|
|
|
|
(#t (error "meson: unknown architecture"))))))
|
|
|
|
|
|
|
|
|
|
(define (make-binaries-alist triplet)
|
|
|
|
|
"Make an associatoin list describing what should go into
|
|
|
|
|
the ‘binaries’ section of the cross file when cross-compiling for
|
|
|
|
|
TRIPLET."
|
|
|
|
|
`((c . ,(cc-for-target triplet))
|
|
|
|
|
(cpp . ,(cxx-for-target triplet))
|
|
|
|
|
(pkgconfig . ,(pkg-config-for-target triplet))
|
|
|
|
|
(objcopy . ,(string-append triplet "-objcopy"))
|
|
|
|
|
(ar . ,(string-append triplet "-ar"))
|
|
|
|
|
(ld . ,(string-append triplet "-ld"))
|
|
|
|
|
(strip . ,(string-append triplet "-strip"))))
|
|
|
|
|
|
|
|
|
|
(define (make-cross-file triplet)
|
|
|
|
|
(computed-file "cross-file"
|
|
|
|
|
(with-imported-modules '((guix build meson-configuration))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build meson-configuration))
|
|
|
|
|
(call-with-output-file #$output
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(write-section-header port "host_machine")
|
|
|
|
|
(write-assignments port '#$(make-machine-alist triplet))
|
|
|
|
|
(write-section-header port "binaries")
|
|
|
|
|
(write-assignments port '#$(make-binaries-alist triplet))))))))
|
|
|
|
|
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(define %meson-build-system-modules
|
|
|
|
|
;; Build-side modules imported by default.
|
|
|
|
|
`((guix build meson-build-system)
|
|
|
|
|
;; The modules from glib-or-gtk contains the modules from gnu-build-system,
|
|
|
|
|
;; so there is no need to import that too.
|
|
|
|
|
,@%glib-or-gtk-build-system-modules))
|
|
|
|
|
|
|
|
|
|
(define (default-ninja)
|
|
|
|
|
"Return the default ninja package."
|
|
|
|
|
;; Lazily resolve the binding to avoid a circular dependency.
|
|
|
|
|
(let ((module (resolve-interface '(gnu packages ninja))))
|
|
|
|
|
(module-ref module 'ninja)))
|
|
|
|
|
|
|
|
|
|
(define (default-meson)
|
|
|
|
|
"Return the default meson package."
|
|
|
|
|
;; Lazily resolve the binding to avoid a circular dependency.
|
|
|
|
|
(let ((module (resolve-interface '(gnu packages build-tools))))
|
2021-01-28 18:46:49 +01:00
|
|
|
|
(module-ref module 'meson)))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
|
|
|
|
(define* (lower name
|
|
|
|
|
#:key source inputs native-inputs outputs system target
|
|
|
|
|
(meson (default-meson))
|
|
|
|
|
(ninja (default-ninja))
|
2017-09-26 16:19:24 +02:00
|
|
|
|
(glib-or-gtk? #f)
|
2017-09-13 14:37:39 +02:00
|
|
|
|
#:allow-other-keys
|
|
|
|
|
#:rest arguments)
|
|
|
|
|
"Return a bag for NAME."
|
|
|
|
|
(define private-keywords
|
2021-07-14 13:13:07 +02:00
|
|
|
|
`(#:meson #:ninja #:inputs #:native-inputs #:outputs
|
|
|
|
|
,@(if target
|
|
|
|
|
'()
|
|
|
|
|
'(#:target))))
|
|
|
|
|
|
|
|
|
|
(bag
|
|
|
|
|
(name name)
|
|
|
|
|
(system system) (target target)
|
|
|
|
|
(build-inputs `(("meson" ,meson)
|
|
|
|
|
("ninja" ,ninja)
|
|
|
|
|
,@native-inputs
|
|
|
|
|
,@(if target '() inputs)
|
|
|
|
|
;; Keep the standard inputs of 'gnu-build-system'.
|
|
|
|
|
,@(if target
|
|
|
|
|
(standard-cross-packages target 'host)
|
|
|
|
|
'())
|
|
|
|
|
,@(standard-packages)))
|
|
|
|
|
(host-inputs `(,@(if source
|
|
|
|
|
`(("source" ,source))
|
|
|
|
|
'())
|
|
|
|
|
,@(if target inputs '())))
|
|
|
|
|
;; Keep the standard inputs of 'gnu-buid-system'.
|
|
|
|
|
(target-inputs (if target
|
|
|
|
|
(standard-cross-packages target 'target)
|
|
|
|
|
'()))
|
|
|
|
|
(outputs outputs)
|
|
|
|
|
(build (if target meson-cross-build meson-build))
|
|
|
|
|
(arguments (strip-keyword-arguments private-keywords arguments))))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
(define* (meson-build name inputs
|
|
|
|
|
#:key
|
|
|
|
|
guile source
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(configure-flags ''())
|
|
|
|
|
(search-paths '())
|
2019-07-07 19:14:04 +02:00
|
|
|
|
(build-type "debugoptimized")
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(tests? #t)
|
2021-11-03 17:07:22 +01:00
|
|
|
|
(test-options ''())
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(glib-or-gtk? #f)
|
|
|
|
|
(parallel-build? #t)
|
|
|
|
|
(parallel-tests? #f)
|
|
|
|
|
(validate-runpath? #t)
|
|
|
|
|
(patch-shebangs? #t)
|
|
|
|
|
(strip-binaries? #t)
|
|
|
|
|
(strip-flags ''("--strip-debug"))
|
|
|
|
|
(strip-directories ''("lib" "lib64" "libexec"
|
|
|
|
|
"bin" "sbin"))
|
|
|
|
|
(elf-directories ''("lib" "lib64" "libexec"
|
|
|
|
|
"bin" "sbin"))
|
2021-02-28 21:30:50 +01:00
|
|
|
|
(phases '%standard-phases)
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(system (%current-system))
|
|
|
|
|
(imported-modules %meson-build-system-modules)
|
|
|
|
|
(modules '((guix build meson-build-system)
|
2019-03-17 16:32:24 +01:00
|
|
|
|
(guix build utils)))
|
|
|
|
|
allowed-references
|
|
|
|
|
disallowed-references)
|
2017-09-13 14:37:39 +02:00
|
|
|
|
"Build SOURCE using MESON, and with INPUTS, assuming that SOURCE
|
|
|
|
|
has a 'meson.build' file."
|
|
|
|
|
(define builder
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
(with-imported-modules imported-modules
|
|
|
|
|
#~(begin
|
2021-02-28 21:30:50 +01:00
|
|
|
|
(use-modules #$@(sexp->gexp modules))
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
|
|
|
|
|
(define build-phases
|
2021-02-28 21:30:50 +01:00
|
|
|
|
#$(let ((phases (if (pair? phases) (sexp->gexp phases) phases)))
|
|
|
|
|
(if glib-or-gtk?
|
|
|
|
|
phases
|
|
|
|
|
#~(modify-phases #$phases
|
|
|
|
|
(delete 'glib-or-gtk-compile-schemas)
|
|
|
|
|
(delete 'glib-or-gtk-wrap)))))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#$(with-build-variables inputs outputs
|
|
|
|
|
#~(meson-build #:source #+source
|
|
|
|
|
#:system #$system
|
|
|
|
|
#:outputs %outputs
|
|
|
|
|
#:inputs %build-inputs
|
2021-02-28 21:30:50 +01:00
|
|
|
|
#:search-paths '#$(sexp->gexp
|
|
|
|
|
(map search-path-specification->sexp
|
|
|
|
|
search-paths))
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:phases build-phases
|
2021-08-24 11:03:25 +02:00
|
|
|
|
#:configure-flags
|
|
|
|
|
#$(if (pair? configure-flags)
|
|
|
|
|
(sexp->gexp configure-flags)
|
|
|
|
|
configure-flags)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:build-type #$build-type
|
|
|
|
|
#:tests? #$tests?
|
2021-11-03 17:07:22 +01:00
|
|
|
|
#:test-options #$(sexp->gexp test-options)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:parallel-build? #$parallel-build?
|
|
|
|
|
#:parallel-tests? #$parallel-tests?
|
|
|
|
|
#:validate-runpath? #$validate-runpath?
|
|
|
|
|
#:patch-shebangs? #$patch-shebangs?
|
|
|
|
|
#:strip-binaries? #$strip-binaries?
|
2021-02-28 21:30:50 +01:00
|
|
|
|
#:strip-flags #$(sexp->gexp strip-flags)
|
|
|
|
|
#:strip-directories #$(sexp->gexp strip-directories)
|
|
|
|
|
#:elf-directories #$(sexp->gexp elf-directories))))))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
|
|
|
|
system #:graft? #f)))
|
|
|
|
|
(gexp->derivation name builder
|
|
|
|
|
#:system system
|
|
|
|
|
#:target #f
|
gexp: Leave grafting as is when lowering allowed/disallowed references.
Fixes <https://issues.guix.gnu.org/50676>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.
Commit a779363b6aa581e88eda21f9f35530962d54ac25 was partially incorrect:
references passed to #:allowed-references or #:references-graphs *can*
be lowered as references to grafted elements. This is for example the
case when doing:
(computed-file "partition.img" exp
#:options `(#:references-graphs ,inputs))
Here INPUTS must be lowered as a reference to suitably grafted elements.
Failing to do that, the reference graph will not match the actual
INPUTS.
However, when building a package, those references must indeed refer
only to ungrafted packages. This commit preserves that by having build
systems pass #:graft? #f.
* guix/gexp.scm (lower-reference-graphs, lower-references): Remove uses
of 'without-grafting'. This reverts
a779363b6aa581e88eda21f9f35530962d54ac25.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build):
Pass #:graft? #f.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build)
(glib-or-gtk-cross-build): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise.
* guix/build-system/trivial.scm (trivial-build, trivial-cross-build):
Likewise.
* tests/gexp.scm ("lower-object, computed-file + grafts"): New test.
* tests/packages.scm ("trivial with #:allowed-references + grafts"): New
test.
2021-09-24 23:00:11 +02:00
|
|
|
|
#:graft? #f
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 19:26:39 +01:00
|
|
|
|
#:substitutable? substitutable?
|
|
|
|
|
#:allowed-references allowed-references
|
|
|
|
|
#:disallowed-references disallowed-references
|
|
|
|
|
#:guile-for-build guile)))
|
2017-09-13 14:37:39 +02:00
|
|
|
|
|
2021-07-14 13:13:07 +02:00
|
|
|
|
(define* (meson-cross-build name
|
|
|
|
|
#:key
|
|
|
|
|
target
|
|
|
|
|
build-inputs host-inputs target-inputs
|
|
|
|
|
guile source
|
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(configure-flags ''())
|
|
|
|
|
(search-paths '())
|
|
|
|
|
(native-search-paths '())
|
|
|
|
|
|
|
|
|
|
(build-type "debugoptimized")
|
|
|
|
|
(tests? #f)
|
2021-11-03 17:07:22 +01:00
|
|
|
|
(test-options ''())
|
2021-07-14 13:13:07 +02:00
|
|
|
|
(glib-or-gtk? #f)
|
|
|
|
|
(parallel-build? #t)
|
|
|
|
|
(parallel-tests? #f)
|
|
|
|
|
(validate-runpath? #t)
|
|
|
|
|
(patch-shebangs? #t)
|
|
|
|
|
(strip-binaries? #t)
|
|
|
|
|
(strip-flags ''("--strip-debug"))
|
|
|
|
|
(strip-directories ''("lib" "lib64" "libexec"
|
|
|
|
|
"bin" "sbin"))
|
|
|
|
|
(elf-directories ''("lib" "lib64" "libexec"
|
|
|
|
|
"bin" "sbin"))
|
|
|
|
|
;; See 'gnu-cross-build' for why this needs to be
|
|
|
|
|
;; disabled when cross-compiling.
|
|
|
|
|
(make-dynamic-linker-cache? #f)
|
|
|
|
|
(phases '%standard-phases)
|
|
|
|
|
(system (%current-system))
|
|
|
|
|
(imported-modules %meson-build-system-modules)
|
|
|
|
|
(modules '((guix build meson-build-system)
|
|
|
|
|
(guix build utils)))
|
|
|
|
|
allowed-references
|
|
|
|
|
disallowed-references)
|
|
|
|
|
"Cross-build SOURCE for TARGET using MESON, and with INPUTS, assuming that
|
|
|
|
|
SOURCE has a 'meson.build' file."
|
|
|
|
|
(define cross-file
|
|
|
|
|
(make-cross-file target))
|
|
|
|
|
(define inputs
|
|
|
|
|
(if (null? target-inputs)
|
|
|
|
|
(input-tuples->gexp host-inputs)
|
|
|
|
|
#~(append #$(input-tuples->gexp host-inputs)
|
2021-11-03 17:07:22 +01:00
|
|
|
|
#+(input-tuples->gexp target-inputs))))
|
2021-07-14 13:13:07 +02:00
|
|
|
|
(define builder
|
|
|
|
|
(with-imported-modules imported-modules
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules #$@(sexp->gexp modules))
|
|
|
|
|
|
2021-12-20 14:37:40 +01:00
|
|
|
|
(define %build-host-inputs
|
|
|
|
|
#+(input-tuples->gexp build-inputs))
|
|
|
|
|
|
|
|
|
|
(define %build-target-inputs
|
|
|
|
|
(append #$(input-tuples->gexp host-inputs)
|
|
|
|
|
#+(input-tuples->gexp target-inputs)))
|
|
|
|
|
|
|
|
|
|
(define %build-inputs
|
|
|
|
|
(append %build-host-inputs %build-target-inputs))
|
|
|
|
|
|
|
|
|
|
(define %outputs
|
|
|
|
|
#$(outputs->gexp outputs))
|
|
|
|
|
|
2021-07-14 13:13:07 +02:00
|
|
|
|
(define build-phases
|
|
|
|
|
#$(let ((phases (if (pair? phases) (sexp->gexp phases) phases)))
|
|
|
|
|
(if glib-or-gtk?
|
|
|
|
|
phases
|
|
|
|
|
#~(modify-phases #$phases
|
|
|
|
|
(delete 'glib-or-gtk-compile-schemas)
|
|
|
|
|
(delete 'glib-or-gtk-wrap)))))
|
|
|
|
|
|
|
|
|
|
;; Do not use 'with-build-variables', as there should be
|
|
|
|
|
;; no reason to use %build-inputs and friends.
|
|
|
|
|
(meson-build #:source #+source
|
|
|
|
|
#:system #$system
|
|
|
|
|
#:build #$(nix-system->gnu-triplet system)
|
|
|
|
|
#:target #$target
|
|
|
|
|
#:outputs #$(outputs->gexp outputs)
|
|
|
|
|
#:inputs #$inputs
|
|
|
|
|
#:native-inputs #+(input-tuples->gexp build-inputs)
|
|
|
|
|
#:search-paths '#$(sexp->gexp
|
|
|
|
|
(map search-path-specification->sexp
|
2021-11-03 17:07:22 +01:00
|
|
|
|
search-paths))
|
2021-07-14 13:13:07 +02:00
|
|
|
|
#:native-search-paths '#$(sexp->gexp
|
|
|
|
|
(map search-path-specification->sexp
|
|
|
|
|
native-search-paths))
|
|
|
|
|
#:phases build-phases
|
|
|
|
|
#:make-dynamic-linker-cache? #$make-dynamic-linker-cache?
|
|
|
|
|
#:configure-flags `("--cross-file" #+cross-file
|
2021-08-24 11:03:25 +02:00
|
|
|
|
,@#$(if (pair? configure-flags)
|
|
|
|
|
(sexp->gexp configure-flags)
|
|
|
|
|
configure-flags))
|
2021-07-14 13:13:07 +02:00
|
|
|
|
#:build-type #$build-type
|
|
|
|
|
#:tests? #$tests?
|
2021-11-03 17:07:22 +01:00
|
|
|
|
#:test-options #$(sexp->gexp test-options)
|
2021-07-14 13:13:07 +02:00
|
|
|
|
#:parallel-build? #$parallel-build?
|
|
|
|
|
#:parallel-tests? #$parallel-tests?
|
|
|
|
|
#:validate-runpath? #$validate-runpath?
|
|
|
|
|
#:patch-shebangs? #$patch-shebangs?
|
|
|
|
|
#:strip-binaries? #$strip-binaries?
|
|
|
|
|
#:strip-flags #$(sexp->gexp strip-flags)
|
|
|
|
|
#:strip-directories #$(sexp->gexp strip-directories)
|
|
|
|
|
#:elf-directories #$(sexp->gexp elf-directories)))))
|
|
|
|
|
|
|
|
|
|
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
|
|
|
|
system #:graft? #f)))
|
|
|
|
|
(gexp->derivation name builder
|
|
|
|
|
#:system system
|
|
|
|
|
#:target target
|
gexp: Leave grafting as is when lowering allowed/disallowed references.
Fixes <https://issues.guix.gnu.org/50676>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.
Commit a779363b6aa581e88eda21f9f35530962d54ac25 was partially incorrect:
references passed to #:allowed-references or #:references-graphs *can*
be lowered as references to grafted elements. This is for example the
case when doing:
(computed-file "partition.img" exp
#:options `(#:references-graphs ,inputs))
Here INPUTS must be lowered as a reference to suitably grafted elements.
Failing to do that, the reference graph will not match the actual
INPUTS.
However, when building a package, those references must indeed refer
only to ungrafted packages. This commit preserves that by having build
systems pass #:graft? #f.
* guix/gexp.scm (lower-reference-graphs, lower-references): Remove uses
of 'without-grafting'. This reverts
a779363b6aa581e88eda21f9f35530962d54ac25.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build):
Pass #:graft? #f.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build)
(glib-or-gtk-cross-build): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise.
* guix/build-system/trivial.scm (trivial-build, trivial-cross-build):
Likewise.
* tests/gexp.scm ("lower-object, computed-file + grafts"): New test.
* tests/packages.scm ("trivial with #:allowed-references + grafts"): New
test.
2021-09-24 23:00:11 +02:00
|
|
|
|
#:graft? #f
|
2021-07-14 13:13:07 +02:00
|
|
|
|
#:substitutable? substitutable?
|
|
|
|
|
#:allowed-references allowed-references
|
|
|
|
|
#:disallowed-references disallowed-references
|
|
|
|
|
#:guile-for-build guile)))
|
|
|
|
|
|
2017-09-13 14:37:39 +02:00
|
|
|
|
(define meson-build-system
|
|
|
|
|
(build-system
|
|
|
|
|
(name 'meson)
|
|
|
|
|
(description "The standard Meson build system")
|
|
|
|
|
(lower lower)))
|
|
|
|
|
|
|
|
|
|
;;; meson.scm ends here
|