From patchwork Thu Nov 16 19:15:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56528 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E31FE27BBEA; Thu, 16 Nov 2023 19:18:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEACC27BBE2 for ; Thu, 16 Nov 2023 19:18:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hsO-0004QL-8c; Thu, 16 Nov 2023 14:18:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3hsL-0004N6-Lw for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3hsL-0004es-Bp for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hsK-0003pE-Qp for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:18:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67019 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67019@debbugs.gnu.org Cc: Philip McGrath , Liliana Marie Prikler Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.170016223214570 (code B ref 67019); Thu, 16 Nov 2023 19:18:04 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:17:12 +0000 Received: from localhost ([127.0.0.1]:44603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hrS-0003mp-Pm for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:17:11 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr5-0003ig-H6 for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:48 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 962815C0203; Thu, 16 Nov 2023 14:16:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 16 Nov 2023 14:16:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1700162202; x=1700248602; bh=PC89oKSYEC 0KHXt4QpB5Xv9CWn1muRIJ/dTa4CLnbLk=; b=m8WznaUdxkHgbV71irWDRQ5ZFf GVKW+6CNhb23CyPWU9VS1ABXSEigBb8SpLXVjouabk9RFLwpXEKF4Qv2ZPdQdyBs xRHEkpmbZc3PfEEUyekNO92rqyiXLMLnZPeT+U61ByrQInb/BmOBwC7mE+JY+DRm 7aQDictBfC5rZYTICrQ/YY71RTZm+ofS2V9DbGlFTO/v+9MfWCqzEVkX9YehfDPl aYcBa6j7rM9E9BHR8OuROC7mkAShZsisDvmAJHxfcxZ4KfhEAAgm4KjVkU2UCi0S 083+fgBtXJOuxeh/WTBdseg7PRqgRGUgXhelPLKCnEyjRGkRCslBJyUB/pmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1700162202; x= 1700248602; bh=PC89oKSYEC0KHXt4QpB5Xv9CWn1muRIJ/dTa4CLnbLk=; b=g /kyusBKqflNHyGPEd5U4toSC8qhHdWVW55oIDCtaL1tMe+ufPspdqADT26umHatz 1dy/r0BgzXi3bgrX5OJregL9DRnTy637b3GS5/l2QC5aIwithFkRECX18Qe0E5mX ZweQWgE/bBwrDYbOxVKHt4kNCZBzHQ/8pGGQFghEOjrEVsFFjHwVt45SNnpDm5sq ToetmNv+DwoXBFW52k6OhcJsTtCj2W3tm0zn0p9Gwrc2fMAd+eXtTwOak7FbXVNJ tpkZAnIQmx9zQY8X3MyH+vUgBol4UzLGRe78tvS3DfJbm6PYzuNpVq8VwO2D8+m1 RF0ZAeSFyoe1XbIcGFISg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepvdekuefhtefhiedvkeegtdeljeehvdfhheefteef heduveelgeelleetvddvjeffnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpfhhloh ifrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:41 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:47 -0500 Message-ID: <9e31af33a03e3581f3c124b6b53241a34c31e42e.1700161584.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/web.scm (ocaml-flow-parser): New variable. --- gnu/packages/web.scm | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 9efc6ebc9d..b222c2ae40 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -96,6 +96,7 @@ (define-module (gnu packages web) #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) + #:use-module (guix build-system dune) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) #:use-module (guix build-system go) @@ -173,6 +174,7 @@ (define-module (gnu packages web) #:use-module (gnu packages node) #:use-module (gnu packages node-xyz) #:use-module (gnu packages nss) + #:use-module (gnu packages ocaml) #:use-module (gnu packages openldap) #:use-module (gnu packages openstack) #:use-module (gnu packages package-management) @@ -1938,6 +1940,99 @@ (define-public esbuild and other data, for distribution on the web.") (license license:expat))) +(define-public ocaml-flow-parser + (package + (name "ocaml-flow-parser") + (version "0.159.0") + (outputs '("out" "js")) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/facebook/flow") + (commit (string-append "v" version)))) + (sha256 + (base32 "1i9svf641s24nj4w6y9vvglzg29h0lr4n9a6mvwrn9psy9x1lril")) + (file-name (git-file-name "flow" version)))) + (build-system dune-build-system) + (propagated-inputs (list ocaml-base + ocaml-core-kernel + ocaml-dtoa + ocaml-sedlex + ocaml-wtf8)) + (native-inputs (list js-of-ocaml + ocamlbuild + ocaml-findlib + ocaml-ounit2 + ocaml-ppx-deriving + ocaml-ppx-gen-rec + ocaml-visitors)) + (arguments + (list + #:tests? #f ; tests need lwt_ppx + #:package "flow_parser" + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'chdir + (lambda args + (chdir "src/parser"))) + (add-before 'build 'patch-source + (lambda args + ;; Avoid errors with newer OCaml: + ;; "Error (warning 16 [unerasable-optional-argument]):" + ;; " this optional argument cannot be erased." + ;; "Error (warning 69 [unused-field]):" + ;; " mutable record field buf is never mutated." + ;; "Error (warning 70 [missing-mli]): Cannot find interface file." + (substitute* "_tags" + (("<\\*\\.ml\\*>: warn[(]-39[)]") + "<*.ml*>: warn(-16-39-70)")) + (substitute* "../../_tags" + (("<\\*\\*/\\*.ml\\*>: ") + "<**/*.ml*>: warn(-69), ")) + ;; Deprecation of Js.Unsafe.variable, Js.Error, Js.raise_js_error + (substitute* "flow_parser_js.ml" + (("Js\\.Unsafe\\.variable") + "Js.Unsafe.pure_js_expr")) + (substitute* "flow_parser_dot_js.ml" + (("Js\\.Error") + "Js_of_ocaml.Js_error.Exn") + (("Js\\.raise_js_error") + "Js_of_ocaml.Js_error.raise_")))) + (replace 'build + (lambda args + (invoke "make" + (string-append "CC=" #$(cc-for-target)) + "build-parser"))) + (add-after 'build 'build-js + (lambda args + (invoke "make" + (string-append "CC=" #$(cc-for-target)) + "js"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "make" + (string-append "CC=" #$(cc-for-target)) + "test-ocaml")))) + (replace 'install + (lambda args + (invoke "make" + (string-append "CC=" #$(cc-for-target)) + "ocamlfind-install"))) + (add-after 'install 'install-js + (lambda args + (install-file "flow_parser.js" + (string-append #$output:js + "/share/javascript/flow"))))))) + (properties `((upstream-name . "flow_parser"))) + (home-page "https://flow.org") + (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.") + (license license:expat))) + (define-public tinyproxy (package (name "tinyproxy")