summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Licht <jlicht@fsfe.org>2020-10-23 22:55:41 +0200
committerJelle Licht <jlicht@fsfe.org>2020-12-04 12:49:02 +0100
commitfab4463d504517ae750d12f8341cac6ce29debe6 (patch)
tree7cc27a86f98dc2244d9da836e65f59ab10c3a597
parentc5033937023e27aa4affdb5ee911a1e45fe273df (diff)
gnu: node: Add node-llparse-frontend-bootstrap.
* gnu/packages/node.scm (node-llparse-frontend-bootstrap): New package.
-rw-r--r--gnu/packages/node.scm62
1 files changed, 62 insertions, 0 deletions
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 0f47df1fc5..99c73f3415 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -427,6 +427,68 @@ modelled after @code{Node.js} core's debugging technique. It works in
"This package builds graphs for consumption by @code{llparse}.")
(license license:expat)))
+(define-public node-llparse-frontend-bootstrap
+ (package
+ (name "node-llparse-frontend")
+ (version "3.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/indutny/llparse-frontend.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1rm9g4ifyip30svm5cgnf0gx7d45jgh4mpf2hkd092xhngmfvicc"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Fix incorrect import semantics
+ ;; https://github.com/evanw/esbuild/issues/477
+ (substitute* (list "src/frontend.ts"
+ "src/code/field-value.ts"
+ "src/container/index.ts"
+ "src/container/wrap.ts"
+ "src/node/sequence.ts"
+ "src/node/single.ts"
+ "src/node/table-lookup.ts"
+ "src/trie/index.ts")
+ (("\\* as assert") "assert")
+ (("\\* as debugAPI") "debugAPI"))
+ #t))))
+ (build-system node-build-system)
+ (arguments
+ `(#:node ,node-bootstrap
+ #:tests? #f
+ #:phases
+ (modify-phases
+ %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((esbuild (string-append
+ (assoc-ref inputs "esbuild")
+ "/bin/esbuild")))
+ (invoke esbuild
+ "--platform=node"
+ "--external:debug"
+ "--external:llparse-builder"
+ "--outfile=lib/frontend.js"
+ "--bundle"
+ "src/frontend.ts")))))))
+ (inputs
+ `(("node-debug" ,node-debug-bootstrap)
+ ("node-llparse-builder" ,node-llparse-builder-bootstrap)))
+ (native-inputs
+ `(("esbuild" ,esbuild)))
+ (home-page
+ "https://github.com/indutny/llparse-frontend#readme")
+ (properties '((hidden? . #t)))
+ (synopsis "Frontend for @code{llparse} compiler")
+ (description "This package is a frontend for the @code{llparse}
+compiler.")
+ (license license:expat)))
+
(define-public libnode
(package
(inherit node)