diff options
Diffstat (limited to 'guix/build-system')
-rw-r--r-- | guix/build-system/copy.scm | 3 | ||||
-rw-r--r-- | guix/build-system/gnu.scm | 4 | ||||
-rw-r--r-- | guix/build-system/go.scm | 1 | ||||
-rw-r--r-- | guix/build-system/linux-module.scm | 4 | ||||
-rw-r--r-- | guix/build-system/meson.scm | 1 | ||||
-rw-r--r-- | guix/build-system/ocaml.scm | 27 | ||||
-rw-r--r-- | guix/build-system/pyproject.scm | 147 | ||||
-rw-r--r-- | guix/build-system/python.scm | 3 | ||||
-rw-r--r-- | guix/build-system/qt.scm | 2 | ||||
-rw-r--r-- | guix/build-system/r.scm | 2 | ||||
-rw-r--r-- | guix/build-system/scons.scm | 4 |
11 files changed, 193 insertions, 5 deletions
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm index bf7fcaedba..e15dc9f616 100644 --- a/guix/build-system/copy.scm +++ b/guix/build-system/copy.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2021, 2022 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; ;;; This file is part of GNU Guix. ;;; @@ -94,6 +95,7 @@ %standard-phases)) (system (%current-system)) (target #f) + (substitutable? #t) (imported-modules %copy-build-system-modules) (modules '((guix build copy-build-system) (guix build utils)))) @@ -130,6 +132,7 @@ (gexp->derivation name builder #:system system #:target #f + #:substitutable? substitutable? #:guile-for-build guile))) (define copy-build-system diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 8054f9893a..e37785010b 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -541,7 +541,9 @@ platform." (map search-path-specification->sexp native-search-paths)) - #:phases #$phases + #:phases #$(if (pair? phases) + (sexp->gexp phases) + phases) #:locale #$locale #:bootstrap-scripts #$bootstrap-scripts #:configure-flags #$configure-flags diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 4b3b67b08f..0a9761aac7 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -38,6 +38,7 @@ go-build-system go-pseudo-version? + go-target go-version->git-ref)) ;; Commentary: diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm index 94a293da13..e46195b53c 100644 --- a/guix/build-system/linux-module.scm +++ b/guix/build-system/linux-module.scm @@ -66,7 +66,7 @@ (replace 'build (lambda _ (invoke "make" "modules_prepare"))) - (delete 'strip) ; faster + (delete 'strip) ;faster (replace 'install (lambda* (#:key inputs #:allow-other-keys) (let ((out-lib-build (string-append #$output "/lib/modules/build"))) @@ -210,6 +210,7 @@ (tests? #f) (phases '%standard-phases) (system (%current-system)) + (source-directory ".") (substitutable? #t) (imported-modules %linux-module-build-system-modules) @@ -229,6 +230,7 @@ (linux-module-build #:name #$name #:source #+source + #:source-directory #$source-directory #:system #$system #:target #$target #:arch #$(system->arch (or target system)) diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index ba3ffa6b1c..0948ad92b5 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -55,6 +55,7 @@ for TRIPLET." ((target-x86-64? triplet) "x86_64") ((target-arm32? triplet) "arm") ((target-aarch64? triplet) "aarch64") + ((target-mips64el? triplet) "mips64") ((target-powerpc? triplet) (if (target-64bit? triplet) "ppc64" diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index 67bb718e12..5f4308a46e 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -32,6 +32,8 @@ strip-ocaml4.07-variant package-with-ocaml4.09 strip-ocaml4.09-variant + package-with-ocaml5.0 + strip-ocaml5.0-variant default-findlib default-ocaml lower @@ -111,6 +113,18 @@ (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.09-dune))) +(define (default-ocaml5.0) + (let ((ocaml (resolve-interface '(gnu packages ocaml)))) + (module-ref ocaml 'ocaml-5.0))) + +(define (default-ocaml5.0-findlib) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml5.0-findlib))) + +(define (default-ocaml5.0-dune) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml5.0-dune))) + (define* (package-with-explicit-ocaml ocaml findlib dune old-prefix new-prefix #:key variant-property) "Return a procedure of one argument, P. The procedure creates a package @@ -199,6 +213,19 @@ pre-defined variants." (inherit p) (properties (alist-delete 'ocaml4.09-variant (package-properties p))))) +(define package-with-ocaml5.0 + (package-with-explicit-ocaml (delay (default-ocaml5.0)) + (delay (default-ocaml5.0-findlib)) + (delay (default-ocaml5.0-dune)) + "ocaml-" "ocaml5.0-" + #:variant-property 'ocaml5.0-variant)) + +(define (strip-ocaml5.0-variant p) + "Remove the 'ocaml5.0-variant' property from P." + (package + (inherit p) + (properties (alist-delete 'ocaml5.0-variant (package-properties p))))) + (define* (lower name #:key source inputs native-inputs outputs system target (ocaml (default-ocaml)) diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm new file mode 100644 index 0000000000..8f3b562ca3 --- /dev/null +++ b/guix/build-system/pyproject.scm @@ -0,0 +1,147 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net> +;;; Copyright © 2022 Marius Bakke <marius@gnu.org> +;;; +;;; 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 pyproject) + #:use-module ((gnu packages) #:select (search-auxiliary-file)) + #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix memoization) + #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix build-system python) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (%pyproject-build-system-modules + default-python + pyproject-build + pyproject-build-system)) + +;; Commentary: +;; +;; Standard build procedure for Python packages using 'pyproject.toml'. +;; This is implemented as an extension of 'python-build-system'. +;; +;; Code: + +(define %pyproject-build-system-modules + ;; Build-side modules imported by default. + `((guix build pyproject-build-system) + (guix build json) + ,@%python-build-system-modules)) + +(define (default-python) + "Return the default Python package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((python (resolve-interface '(gnu packages python)))) + (module-ref python 'python-toolchain))) + +(define sanity-check.py + ;; TODO: Merge with sanity-check.py in the next rebuild cycle. + (search-auxiliary-file "python/sanity-check-next.py")) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (python (default-python)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:target #:python #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("python" ,python) + ("sanity-check.py" ,(local-file sanity-check.py)) + ,@native-inputs)) + (outputs (append outputs '(wheel))) + (build pyproject-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (pyproject-build name inputs + #:key source + (tests? #t) + (configure-flags ''()) + (build-backend #f) + (test-backend #f) + (test-flags ''()) + (phases '%standard-phases) + (outputs '("out" "wheel")) + (search-paths '()) + (system (%current-system)) + (guile #f) + (imported-modules %pyproject-build-system-modules) + (modules '((guix build pyproject-build-system) + (guix build utils)))) + "Build SOURCE using PYTHON, and with INPUTS." + (define build + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + #$(with-build-variables inputs outputs + #~(pyproject-build + #:name #$name + #:source #+source + #:configure-flags #$configure-flags + #:system #$system + #:build-backend #$build-backend + #:test-backend #$test-backend + #:test-flags #$test-flags + #:tests? #$tests? + #:phases #$(if (pair? phases) + (sexp->gexp phases) + phases) + #:outputs %outputs + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:inputs %build-inputs))))) + + + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name build + #:system system + #:graft? #f ;consistent with 'gnu-build' + #:target #f + #:guile-for-build guile))) + +(define pyproject-build-system + (build-system + (name 'pyproject) + (description "The PEP517-compliant Python build system") + (lower lower))) + +;;; pyproject.scm ends here diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index efade6f74b..c8f04b2298 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2021 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013-2017, 2021-2022 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net> @@ -212,6 +212,7 @@ provides a 'setup.py' file as its build system." system #:graft? #f))) (gexp->derivation name build #:system system + #:graft? #f ;consistent with 'gnu-build' #:target #f #:guile-for-build guile))) diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm index ba5c84347a..25fd18f8a8 100644 --- a/guix/build-system/qt.scm +++ b/guix/build-system/qt.scm @@ -180,6 +180,7 @@ provides a 'CMakeLists.txt' file as its build system." (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) (gexp->derivation name builder + #:graft? #f ;consistent with 'gnu-build' #:system system #:guile-for-build guile))) @@ -266,6 +267,7 @@ build system." (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) (gexp->derivation name builder + #:graft? #f ;consistent with 'gnu-build' #:system system #:guile-for-build guile))) diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index 620822b870..9b360ae581 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -61,7 +61,7 @@ release corresponding to NAME and VERSION." "/src/contrib/" name "_" version ".tar.gz") ;; TODO: use %bioconductor-version from (guix import cran) - (string-append "https://bioconductor.org/packages/3.15" + (string-append "https://bioconductor.org/packages/3.16" type-url-part "/src/contrib/" name "_" version ".tar.gz")))) diff --git a/guix/build-system/scons.scm b/guix/build-system/scons.scm index e38213e8e0..7a02fa8a0f 100644 --- a/guix/build-system/scons.scm +++ b/guix/build-system/scons.scm @@ -100,7 +100,9 @@ provides a 'SConstruct' file as its build system." #$(with-build-variables inputs outputs #~(scons-build #:name #$name #:source #+source - #:scons-flags #$(sexp->gexp scons-flags) + #:scons-flags #$(if (pair? scons-flags) + (sexp->gexp scons-flags) + scons-flags) #:system #$system #:build-targets #$build-targets #:test-target #$test-target |