summaryrefslogtreecommitdiff
path: root/guix/build-system
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
commitfcc39864dba82e14895afbe841091091366c96bc (patch)
tree6e0f05495fd6512051224dc85fd3ab495cbf1a24 /guix/build-system
parent76fc36d0a7215979bb74c05840f5a4de4ab5ea93 (diff)
parent44f9432705d04c069a8acf9e37e3ad856ac0bf82 (diff)
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm
Diffstat (limited to 'guix/build-system')
-rw-r--r--guix/build-system/go.scm24
-rw-r--r--guix/build-system/node.scm21
2 files changed, 23 insertions, 22 deletions
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 392f2d9b7b..100d1db4b6 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -34,6 +34,7 @@
go-build
go-build-system
+ go-pseudo-version?
go-version->git-ref))
;; Commentary:
@@ -43,17 +44,19 @@
;;
;; Code:
-(define %go-version-rx
+(define %go-pseudo-version-rx
+ ;; Match only the end of the version string; this is so that matching the
+ ;; more complex leading semantic version pattern is not required.
(make-regexp (string-append
- "(v?[0-9]\\.[0-9]\\.[0-9])" ;"v" prefix can be omitted in version prefix
- "(-|-pre\\.0\\.|-0\\.)" ;separator
- "([0-9]{14})-" ;timestamp
- "([0-9A-Fa-f]{12})"))) ;commit hash
+ "([0-9]{14}-)" ;timestamp
+ "([0-9A-Fa-f]{12})" ;commit hash
+ "(\\+incompatible)?$"))) ;optional +incompatible tag
(define (go-version->git-ref version)
"Parse VERSION, a \"pseudo-version\" as defined at
<https://golang.org/ref/mod#pseudo-versions>, and extract the commit hash from
-it, defaulting to full VERSION if a pseudo-version pattern is not recognized."
+it, defaulting to full VERSION (stripped from the \"+incompatible\" suffix if
+present) if a pseudo-version pattern is not recognized."
;; A module version like v1.2.3 is introduced by tagging a revision in the
;; underlying source repository. Untagged revisions can be referred to
;; using a "pseudo-version" like v0.0.0-yyyymmddhhmmss-abcdefabcdef, where
@@ -68,11 +71,16 @@ it, defaulting to full VERSION if a pseudo-version pattern is not recognized."
(if (string-suffix? "+incompatible" version)
(string-drop-right version 13)
version))
- (match (regexp-exec %go-version-rx version)))
+ (match (regexp-exec %go-pseudo-version-rx version)))
(if match
- (match:substring match 4)
+ (match:substring match 2)
version)))
+(define (go-pseudo-version? version)
+ "True if VERSION is a Go pseudo-version, i.e., a version string made of a
+commit hash and its date rather than a proper release tag."
+ (regexp-exec %go-pseudo-version-rx version))
+
(define %go-build-system-modules
;; Build-side modules imported and used by default.
`((guix build go-build-system)
diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm
index 73a6f152dd..ae799d1f4e 100644
--- a/guix/build-system/node.scm
+++ b/guix/build-system/node.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
+;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -18,7 +19,6 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix build-system node)
- #:use-module (guix store)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix gexp)
@@ -27,28 +27,21 @@
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
#:use-module (ice-9 match)
- #:export (npm-meta-uri
- %node-build-system-modules
+ #:export (%node-build-system-modules
node-build
node-build-system))
-(define (npm-meta-uri name)
- "Return a URI string for the metadata of node module NAME found in the npm
-registry."
- (string-append "https://registry.npmjs.org/" name))
-
(define %node-build-system-modules
;; Build-side modules imported by default.
`((guix build node-build-system)
(guix build json)
- (guix build union)
- ,@%gnu-build-system-modules)) ;; TODO: Might be not needed
+ ,@%gnu-build-system-modules))
(define (default-node)
"Return the default Node package."
;; Lazily resolve the binding to avoid a circular dependency.
(let ((node (resolve-interface '(gnu packages node))))
- (module-ref node 'node)))
+ (module-ref node 'node-lts)))
(define* (lower name
#:key source inputs native-inputs outputs system target
@@ -80,6 +73,7 @@ registry."
#:key
source
(npm-flags ''())
+ (test-target "test")
(tests? #t)
(phases '%standard-phases)
(outputs '("out"))
@@ -88,8 +82,6 @@ registry."
(guile #f)
(imported-modules %node-build-system-modules)
(modules '((guix build node-build-system)
- (guix build json)
- (guix build union)
(guix build utils))))
"Build SOURCE using NODE and INPUTS."
(define builder
@@ -100,6 +92,7 @@ registry."
#:source #+source
#:system #$system
#:npm-flags #$npm-flags
+ #:test-target #$test-target
#:tests? #$tests?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
@@ -117,5 +110,5 @@ registry."
(define node-build-system
(build-system
(name 'node)
- (description "The standard Node build system")
+ (description "The Node build system")
(lower lower)))