GNU bug report logs - #67019
[PATCH 00/16] gnu: Add KaTeX, lessc, and flow-remove-types.

Previous Next

Package: guix-patches;

Reported by: Philip McGrath <philip <at> philipmcgrath.com>

Date: Thu, 9 Nov 2023 16:09:02 UTC

Severity: normal

Tags: patch

Full log


Message #119 received at 67019 <at> debbugs.gnu.org (full text, mbox):

From: Philip McGrath <philip <at> philipmcgrath.com>
To: 67019 <at> debbugs.gnu.org
Cc: Philip McGrath <philip <at> philipmcgrath.com>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: [PATCH v2 10/16] gnu: Add node-flow-parser.
Date: Thu, 16 Nov 2023 14:15:48 -0500
* gnu/packages/web.scm (node-flow-parser): New variable.
(ocaml-flow-parser)[description]: Mention it.
---
 gnu/packages/web.scm | 45 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b222c2ae40..b8646e9d0d 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -2030,9 +2030,52 @@ (define-public ocaml-flow-parser
     (synopsis "Parser for the Flow JavaScript type system")
     (description "Flow is a gradual type system for JavaScript.  This package
 provides the Flow parser, which is an OCaml library that can also be compiled
-to JavaScript.")
+to JavaScript.  To use the compiled parser with Node.js or NPM, see the Guix
+package @code{node-flow-parser}.")
     (license license:expat)))
 
+(define-public node-flow-parser
+  (package
+    (inherit ocaml-flow-parser)
+    (name "node-flow-parser")
+    (properties '())
+    (outputs '("out"))
+    (propagated-inputs '())
+    (native-inputs '())
+    (inputs (list `(,ocaml-flow-parser "js")))
+    (build-system node-build-system)
+    (arguments
+     (list
+      #:tests? #f ; need unpackaged dependencies
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'delete-workspace-file
+            (lambda args
+              ;; this workspace file causes NPM to try to install dependencies
+              ;; of other packages developed in this source repository
+              (delete-file "package.json")))
+          (add-after 'delete-workspace-file 'chdir
+            (lambda args
+              (chdir "packages/flow-parser")))
+          (add-after 'chdir 'unpack-generated-js
+            (lambda* (#:key inputs #:allow-other-keys)
+              (install-file
+               (search-input-file inputs
+                                  "share/javascript/flow/flow_parser.js")
+               ".")
+              (delete-file "Makefile")))
+          (add-after 'patch-dependencies 'delete-dependencies
+            (lambda args
+              (delete-dependencies
+               '("ast-types"
+                 "colors"
+                 "esprima-fb"
+                 "minimist")))))))
+    (synopsis "Parser for the Flow JavaScript type system")
+    (description "Flow is a gradual type system for JavaScript.  This package
+provides the Flow parser in its compiled-to-JavaScript form for use with
+Node.js and NPM.")))
+
 (define-public tinyproxy
   (package
     (name "tinyproxy")
-- 
2.41.0





This bug report was last modified 1 year and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.