summaryrefslogtreecommitdiff
path: root/guix/build-system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-12-09 22:06:53 +0100
committerLudovic Courtès <ludo@gnu.org>2023-12-09 22:32:08 +0100
commit190eff1d201a099542cc1d3406bcc1eda6a980da (patch)
tree3fe324ef1a9087dd5706c455073378251cdae5bd /guix/build-system
parent5cf6c96ad9ffafccf180ec2d44c740b6999c02ac (diff)
parent61f2d84e75c340c2ba528d392f522c51b8843f34 (diff)
Merge branch 'master' into core-updates
Change-Id: Iea8f10db98256f1c6cfac8bfcc82e2d44695ef3d
Diffstat (limited to 'guix/build-system')
-rw-r--r--guix/build-system/android-ndk.scm1
-rw-r--r--guix/build-system/ant.scm3
-rw-r--r--guix/build-system/clojure.scm4
-rw-r--r--guix/build-system/dub.scm1
-rw-r--r--guix/build-system/go.scm11
-rw-r--r--guix/build-system/guile.scm8
-rw-r--r--guix/build-system/meson.scm2
-rw-r--r--guix/build-system/minify.scm12
-rw-r--r--guix/build-system/r.scm2
-rw-r--r--guix/build-system/vim.scm170
-rw-r--r--guix/build-system/zig.scm124
11 files changed, 322 insertions, 16 deletions
diff --git a/guix/build-system/android-ndk.scm b/guix/build-system/android-ndk.scm
index 23e14c7801..b8cd56b871 100644
--- a/guix/build-system/android-ndk.scm
+++ b/guix/build-system/android-ndk.scm
@@ -31,7 +31,6 @@
(define %android-ndk-build-system-modules
;; Build-side modules imported by default.
`((guix build android-ndk-build-system)
- (guix build syscalls)
,@%default-gnu-imported-modules))
(define* (android-ndk-build name inputs
diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm
index c8beea010c..9816cc061c 100644
--- a/guix/build-system/ant.scm
+++ b/guix/build-system/ant.scm
@@ -43,7 +43,6 @@
(guix build maven plugin)
(guix build maven pom)
(guix build java-utils)
- (guix build syscalls)
,@%default-gnu-imported-modules))
(define (default-jdk)
@@ -104,6 +103,7 @@
(build-target "jar")
(jar-name #f)
(main-class #f)
+ (use-java-modules? #f)
(test-include (list "**/*Test.java"))
(test-exclude (list "**/Abstract*.java"))
(source-dir "src")
@@ -132,6 +132,7 @@
#:build-target #$build-target
#:jar-name #$jar-name
#:main-class #$main-class
+ #:use-java-modules? #$use-java-modules?
#:test-include (list #$@test-include)
#:test-exclude (list #$@test-exclude)
#:source-dir #$source-dir
diff --git a/guix/build-system/clojure.scm b/guix/build-system/clojure.scm
index fb897356bc..037fcaf21d 100644
--- a/guix/build-system/clojure.scm
+++ b/guix/build-system/clojure.scm
@@ -83,8 +83,8 @@
#:clojure #:jdk #:zip)))
(if target
- (error "No cross-compilation for clojure-build-system yet: LOWER"
- target) ; FIXME
+ #f ; FIXME: No cross-compilation for
+ ; clojure-build-system yet
(bag (name name)
(system system)
(host-inputs `(,@(if source
diff --git a/guix/build-system/dub.scm b/guix/build-system/dub.scm
index d53acd96e5..831a34af0d 100644
--- a/guix/build-system/dub.scm
+++ b/guix/build-system/dub.scm
@@ -59,7 +59,6 @@
(define %dub-build-system-modules
;; Build-side modules imported by default.
`((guix build dub-build-system)
- (guix build syscalls)
,@%default-gnu-imported-modules))
(define* (dub-build name inputs
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index b1d589e342..3883fac786 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -3,7 +3,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;;
;;; This file is part of GNU Guix.
@@ -114,12 +114,19 @@ commit hash and its date rather than a proper release tag."
(let ((go (resolve-interface '(gnu packages golang))))
(module-ref go 'go)))
+(define (default-gccgo)
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((gcc (resolve-interface '(gnu packages gcc))))
+ (module-ref gcc 'gccgo-12)))
+
(define (make-go-std)
(module-ref (resolve-interface '(gnu packages golang)) 'make-go-std))
(define* (lower name
#:key source inputs native-inputs outputs system target
- (go (default-go))
+ (go (if (supported-package? (default-go))
+ (default-go)
+ (default-gccgo)))
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
diff --git a/guix/build-system/guile.scm b/guix/build-system/guile.scm
index 7ac232bfca..0974fb5042 100644
--- a/guix/build-system/guile.scm
+++ b/guix/build-system/guile.scm
@@ -88,7 +88,8 @@
(compile-flags %compile-flags)
(imported-modules %guile-build-system-modules)
(modules '((guix build guile-build-system)
- (guix build utils))))
+ (guix build utils)))
+ (substitutable? #t))
"Build SOURCE using Guile taken from the native inputs, and with INPUTS."
(define builder
(with-imported-modules imported-modules
@@ -114,6 +115,7 @@
#:system system
#:target #f
#:graft? #f
+ #:substitutable? substitutable?
#:guile-for-build guile)))
(define* (guile-cross-build name
@@ -133,7 +135,8 @@
(compile-flags %compile-flags)
(imported-modules %guile-build-system-modules)
(modules '((guix build guile-build-system)
- (guix build utils))))
+ (guix build utils)))
+ (substitutable? #t))
(define builder
(with-imported-modules imported-modules
#~(begin
@@ -173,6 +176,7 @@
#:system system
#:target target
#:graft? #f
+ #:substitutable? substitutable?
#:guile-for-build guile)))
(define guile-build-system
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index 7c617bffb0..2d14016b94 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -182,6 +182,7 @@ TRIPLET."
(imported-modules %meson-build-system-modules)
(modules '((guix build meson-build-system)
(guix build utils)))
+ (substitutable? #t)
allowed-references
disallowed-references)
"Build SOURCE using MESON, and with INPUTS, assuming that SOURCE
@@ -266,6 +267,7 @@ has a 'meson.build' file."
(imported-modules %meson-build-system-modules)
(modules '((guix build meson-build-system)
(guix build utils)))
+ (substitutable? #t)
allowed-references
disallowed-references)
"Cross-build SOURCE for TARGET using MESON, and with INPUTS, assuming that
diff --git a/guix/build-system/minify.scm b/guix/build-system/minify.scm
index 21c17d1eb1..98c6e75980 100644
--- a/guix/build-system/minify.scm
+++ b/guix/build-system/minify.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2018, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -41,15 +41,15 @@
`((guix build minify-build-system)
,@%default-gnu-imported-modules))
-(define (default-uglify-js)
+(define (default-esbuild)
"Return the default package to minify JavaScript source files."
;; Lazily resolve the binding to avoid a circular dependency.
- (let ((mod (resolve-interface '(gnu packages uglifyjs))))
- (module-ref mod 'uglifyjs)))
+ (let ((mod (resolve-interface '(gnu packages web))))
+ (module-ref mod 'esbuild)))
(define* (lower name
#:key source inputs native-inputs outputs system
- (uglify-js (default-uglify-js))
+ (esbuild (default-esbuild))
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
@@ -64,7 +64,7 @@
'())
,@inputs
,@(standard-packages)))
- (build-inputs `(("uglify-js" ,uglify-js)
+ (build-inputs `(("esbuild" ,esbuild)
,@native-inputs))
(outputs outputs)
(build minify-build)
diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm
index 93acb6ab49..0e6c1d8577 100644
--- a/guix/build-system/r.scm
+++ b/guix/build-system/r.scm
@@ -60,7 +60,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.17"
+ (string-append "https://bioconductor.org/packages/3.18"
type-url-part
"/src/contrib/"
name "_" version ".tar.gz"))))
diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
new file mode 100644
index 0000000000..dddf7ea14b
--- /dev/null
+++ b/guix/build-system/vim.scm
@@ -0,0 +1,170 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Jonathan Scoresby <me@jonscoresby.com>
+;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
+;;;
+;;; 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 vim)
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (guix gexp)
+ #:use-module (guix monads)
+ #:use-module (guix packages)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system copy)
+ #:use-module (guix build-system gnu)
+ #:export (%vim-build-system-modules vim-build vim-build-system))
+
+;; Commentary:
+;;
+;; Standard package installer for vim and neovim plugins.
+;; This is implemented as an extension of the `copy-build-system'
+;; and takes advantage of vim and neovim's built-in package manager.
+;; It extends the installation procedure from the copy-build-system
+;; to put files in the correct place and then generates help tags.
+;;
+;; Code:
+
+(define %vim-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build vim-build-system)
+ ,@%copy-build-system-modules))
+
+(define (default-vim)
+ "Return the default Vim package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((vim (resolve-interface '(gnu packages vim))))
+ (module-ref vim 'vim)))
+
+(define (default-neovim)
+ "Return the default Neovim package."
+ (let ((vim (resolve-interface '(gnu packages vim))))
+ (module-ref vim 'neovim)))
+
+(define* (lower name
+ #:key source
+ inputs
+ native-inputs
+ outputs
+ system
+ target
+ (vim? #f)
+ (neovim? #f)
+ (plugin-name name)
+ (vim (default-vim))
+ (neovim (default-neovim))
+ #:allow-other-keys #:rest arguments)
+ "Return a bag for NAME."
+ (let* ((private-keywords '(#:target #:vim #:neovim #:inputs #:native-inputs))
+ (vim? (or (string-prefix? "vim-" name)
+ vim?))
+ (neovim? (or (string-prefix? "neovim-" name)
+ neovim?))
+ (vim-inputs (append (if vim?
+ `(("vim" ,vim))
+ '())
+ (if neovim?
+ `(("neovim" ,neovim))
+ '())))
+ (vim-arguments (append arguments
+ `(#:vim? ,vim?
+ #:neovim? ,neovim?))))
+ (bag (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '()) ,@inputs
+
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (build-inputs `(,@vim-inputs ,@native-inputs))
+ (outputs outputs)
+ (build vim-build)
+ (arguments (strip-keyword-arguments private-keywords vim-arguments)))))
+
+(define* (vim-build name inputs
+ #:key guile
+ source
+ (vim? #f)
+ (neovim? #f)
+ (mode "start")
+ (plugin-name name)
+ (install-plan ''())
+ (phases '(@ (guix build vim-build-system) %standard-phases))
+ (outputs '("out"))
+ (out-of-source? #t)
+ (tests? #t)
+ (validate-runpath? #t)
+ (patch-shebangs? #t)
+ (strip-binaries? #t)
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
+ (search-paths '())
+ (system (%current-system))
+ (substitutable? #t)
+ (imported-modules %vim-build-system-modules)
+ (modules '((guix build vim-build-system)
+ (guix build utils))))
+
+ (define build
+ (with-imported-modules imported-modules
+ #~(begin
+ (use-modules #$@modules)
+ #$(with-build-variables inputs outputs
+ #~(vim-build #:name #$name
+ #:vim? #$vim?
+ #:neovim? #$neovim?
+ #:mode #$mode
+ #:plugin-name #$plugin-name
+ #:install-plan #$(if (pair? install-plan)
+ (sexp->gexp install-plan)
+ install-plan)
+ #:source #+source
+ #:system #$system
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
+ #:outputs %outputs
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:inputs %build-inputs
+ #:out-of-source? #$out-of-source?
+ #:tests? #$tests?
+ #:validate-runpath? #$validate-runpath?
+ #:patch-shebangs? #$patch-shebangs?
+ #:strip-binaries? #$strip-binaries?
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories)))))
+
+ (mlet %store-monad
+ ((guile (package->derivation (or guile (default-guile))
+ system #:graft? #f)))
+ (gexp->derivation name
+ build
+ #:system system
+ #:target #f
+ #:graft? #f
+ #:substitutable? substitutable?
+ #:guile-for-build guile)))
+
+(define vim-build-system
+ (build-system (name 'vim)
+ (description "The standard Vim build system")
+ (lower lower)))
+
+;;; vim.scm ends here
diff --git a/guix/build-system/zig.scm b/guix/build-system/zig.scm
new file mode 100644
index 0000000000..41751f9116
--- /dev/null
+++ b/guix/build-system/zig.scm
@@ -0,0 +1,124 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2023 Ekaitz Zarraga <ekaitz@elenq.tech>
+;;;
+;;; 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 zig)
+ #:use-module (guix search-paths)
+ #:use-module (guix store)
+ #:use-module (guix utils)
+ #:use-module (guix gexp)
+ #:use-module (guix monads)
+ #:use-module (guix packages)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-26)
+ #:export (zig-build-system))
+
+
+(define (default-zig)
+ "Return the default zig package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((zig (resolve-interface '(gnu packages zig))))
+ (module-ref zig 'zig)))
+
+(define %zig-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build zig-build-system)
+ (guix build syscalls)
+ ,@%default-gnu-imported-modules))
+
+(define* (zig-build name inputs
+ #:key
+ source
+ (tests? #t)
+ (test-target #f)
+ (zig-build-flags ''())
+ (zig-test-flags ''())
+ (zig-release-type #f)
+ (phases '%standard-phases)
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %zig-build-system-modules)
+ (modules '((guix build zig-build-system)
+ (guix build utils))))
+ "Build SOURCE using Zig, and with INPUTS."
+ (define builder
+ (with-imported-modules imported-modules
+ #~(begin
+ (use-modules #$@(sexp->gexp modules))
+ (zig-build #:name #$name
+ #:source #+source
+ #:system #$system
+ #:test-target #$test-target
+ #:zig-build-flags #$zig-build-flags
+ #:zig-test-flags #$zig-test-flags
+ #:zig-release-type #$zig-release-type
+ #:tests? #$tests?
+ #:phases #$phases
+ #:outputs #$(outputs->gexp outputs)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:inputs #$(input-tuples->gexp inputs)))))
+
+ (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
+ system #:graft? #f)))
+ (gexp->derivation name builder
+ #:system system
+ #:guile-for-build guile)))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ (zig (default-zig))
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+
+ (define private-keywords
+ '(#:target #:zig #:inputs #:native-inputs #:outputs))
+
+ ;; TODO: support cross-compilation
+ ;; It's as simple as adding some build flags to `zig-build-flags`
+ ;; -Dtarget=aarch64-linux-musl, for example.
+ (and (not target)
+ (bag
+ (name name)
+ (system system)
+ (target target)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+
+ ;; Keep the standard inputs of 'gnu-build-system'
+ ;; TODO: do we need this?
+ ,@(standard-packages)))
+ (build-inputs `(("zig" ,zig)
+ ,@native-inputs))
+ (outputs outputs)
+ (build zig-build)
+ (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define zig-build-system
+ (build-system
+ (name 'zig)
+ (description
+ "Zig build system, to build Zig packages")
+ (lower lower)))