summaryrefslogtreecommitdiff
path: root/guix/build-system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-09-07 11:04:44 +0200
committerLudovic Courtès <ludo@gnu.org>2021-09-07 14:19:08 +0200
commitd9dfbf886ddbb92dfdaa118bb9765e78aad5c53a (patch)
tree2732020de20a38c09b66a60b0cb36022799f7c2e /guix/build-system
parentb949f34f31a045eb0fb242b81a223178fb6994d3 (diff)
parent49922efb11da0f0e9d4f5979d081de5ea8c99d25 (diff)
Merge branch 'master' into core-updates-frozen
Diffstat (limited to 'guix/build-system')
-rw-r--r--guix/build-system/chicken.scm10
-rw-r--r--guix/build-system/dune.scm3
-rw-r--r--guix/build-system/minetest.scm99
3 files changed, 111 insertions, 1 deletions
diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index c6978266fc..07666d1321 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 raingloom <raingloom@riseup.net>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,7 +30,14 @@
#:use-module (ice-9 match)
#:export (%chicken-build-system-modules
chicken-build
- chicken-build-system))
+ chicken-build-system
+ egg-uri))
+
+(define* (egg-uri name version #:optional (extension ".tar.gz"))
+ "Return a URI string for the CHICKEN egg corresponding to NAME and VERSION.
+EXTENSION is the file name extension, such as '.tar.gz'."
+ (string-append "https://code.call-cc.org/egg-tarballs/5/"
+ name "/" name "-" version extension))
(define %chicken-build-system-modules
;; Build-side modules imported and used by default.
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 8c33e096f5..303b5f76c6 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 pukkamustard <pukkamustard@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -90,6 +91,7 @@
(out-of-source? #t)
(jbuild? #f)
(package #f)
+ (profile "release")
(tests? #t)
(test-flags ''())
(test-target "test")
@@ -129,6 +131,7 @@ provides a 'setup.ml' file as its build system."
#:out-of-source? #$out-of-source?
#:jbuild? #$jbuild?
#:package #$package
+ #:profile #$profile
#:tests? #$tests?
#:test-target #$test-target
#:install-target #$install-target
diff --git a/guix/build-system/minetest.scm b/guix/build-system/minetest.scm
new file mode 100644
index 0000000000..1fae3a47e9
--- /dev/null
+++ b/guix/build-system/minetest.scm
@@ -0,0 +1,99 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;;
+;;; 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 minetest)
+ #:use-module (guix build-system copy)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system)
+ #:use-module (guix utils)
+ #:export (minetest-mod-build-system))
+
+;;
+;; Build procedure for minetest mods. This is implemented as an extension
+;; of ‘copy-build-system’.
+;;
+;; Code:
+
+;; Lazily resolve the bindings to avoid circular dependencies.
+(define (default-optipng)
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (module-ref (resolve-interface '(gnu packages image)) 'optipng))
+
+(define (default-minetest)
+ (module-ref (resolve-interface '(gnu packages minetest)) 'minetest))
+
+(define (default-xvfb-run)
+ (module-ref (resolve-interface '(gnu packages xorg)) 'xvfb-run))
+
+(define %minetest-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build minetest-build-system)
+ ,@%copy-build-system-modules))
+
+(define %default-modules
+ ;; Modules in scope in the build-side environment.
+ '((guix build gnu-build-system)
+ (guix build minetest-build-system)
+ (guix build utils)))
+
+(define (standard-minetest-packages)
+ "Return the list of (NAME PACKAGE OUTPUT) or (NAME PACKAGE) tuples of
+standard packages used as implicit inputs of the Minetest build system."
+ `(("xvfb-run" ,(default-xvfb-run))
+ ("optipng" ,(default-optipng))
+ ("minetest" ,(default-minetest))
+ ,@(filter (lambda (input)
+ (member (car input)
+ '("libc" "tar" "gzip" "bzip2" "xz" "locales")))
+ (standard-packages))))
+
+(define* (lower-mod name #:key (implicit-inputs? #t) #:allow-other-keys
+ #:rest arguments)
+ (define lower (build-system-lower gnu-build-system))
+ (apply lower
+ name
+ (substitute-keyword-arguments arguments
+ ;; minetest-mod-build-system adds implicit inputs by itself,
+ ;; so don't let gnu-build-system add its own implicit inputs
+ ;; as well.
+ ((#:implicit-inputs? implicit-inputs? #t)
+ #f)
+ ((#:implicit-cross-inputs? implicit-cross-inputs? #t)
+ #f)
+ ((#:imported-modules imported-modules %minetest-build-system-modules)
+ imported-modules)
+ ((#:modules modules %default-modules)
+ modules)
+ ((#:phases phases '%standard-phases)
+ phases)
+ ;; Ensure nothing sneaks into the closure.
+ ((#:allowed-references allowed-references '())
+ allowed-references)
+ ;; Add the implicit inputs.
+ ((#:native-inputs native-inputs '())
+ (if implicit-inputs?
+ (append native-inputs (standard-minetest-packages))
+ native-inputs)))))
+
+(define minetest-mod-build-system
+ (build-system
+ (name 'minetest-mod)
+ (description "The build system for minetest mods")
+ (lower lower-mod)))
+
+;;; minetest.scm ends here