diff mbox series

[bug#45558] Add js_of_ocaml

Message ID 86im3z9gdd.fsf@posteo.net
State Accepted
Headers show
Series [bug#45558] Add js_of_ocaml | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

pukkamustard May 3, 2021, 12:38 p.m. UTC
Hi divoplade,

divoplade <d@divoplade.fr> writes:

> I finally got js_of_ocaml packaged.

Thank you!

> I'm not sure I did everything correctly (especially indentation

There do seem to be some indentation issues. Have you seen the 
section "Formatting Code" in the Guix manual? There is also a 
little script in the guix repository that will automatically 
indent a package definition.

Also your commit logs don't seem to be exactly in the required 
format. For example: "gnu: add ocaml-ppxlib" should be "gnu: Add 
ocaml-ppxlib.". Check the section "Submitting Patches" in the Guix 
manual and also the commit history for examples.

There are also some things that the linter discovers. For example 
you can omit the ".git" suffix for GitHub sources or that 
pkg-config is not needed in ocaml-graphics. You can run `git lint 
PACKAGE` too see what the linter has to say (and maybe should do 
that for modified package definitions).

> , but also how to make non-4.07 packages

This looks ok.

I submitted a series of patches that does this for many OCaml 
packages including the ones included in your series 
(https://issues.guix.gnu.org/47768). I'm sorry I should have 
included your work in my patch series instead of duplicating.

Maybe a small difference is that the patches in #47769 include a 
more recent version of ocaml-ppxlib (and the required version of 
ocaml-migrate-parsetree).

I have updated your patches for ocaml-graphics and js_of_ocaml so 
that they can be applied on #47769. Some changes in the attached 
patches:

ocaml-graphics:
- Use version 5.1.1 instead of 5.1.0 (5.1.1 was released after you 
  submitted the patches)
- Remove unnecessary inputs
- Change git-reference url to homepage (GitHub without the ".git" 
  suffix)
- Minor changes to description too make linter happy

ocaml-js-of-ocaml:
- Set home-page to https://ocsigen.org/js_of_ocaml/
- Use version 3.9.0 instead of 3.8.0 (again released after you 
  submitted the patches)
- Enable source maps by including ocaml-yojson as input
- Enable tests (this requires ocaml-ppx-expect, 
  ocaml-ppx-variants-conv, ocaml-variantslib and an updated 
  version of ocaml-num)
Best regards,
pukkamustard

Comments

divoplade May 4, 2021, 9:10 a.m. UTC | #1
Hello,

Thank you for the interest in this issue. I realize I opened it at a
rather inconvenient time, so I guess it ended up on the bottom of the
pile for quite some time.

Le lundi 03 mai 2021 à 12:38 +0000, pukkamustard a écrit :
> I submitted a series of patches that does this for many OCaml 
> packages including the ones included in your series 
> (https://issues.guix.gnu.org/47768).

The situation is quite complex to me, please bear with me. If I
understand correctly, you pushed a lot of ocaml updates last month,
making some of the changes I made in december somewhat obsolete. Right?

So, now, I should your modified 5 patches in this issue on top of the
37 patches in the other issue to get js-of-ocaml. Is it correct?

At this rate, if it is possible, maybe you could just append these 5 to
the other issue, it would be easier to track.

What do you think?

I didn’t detect indentation problems by running ./etc/indent-code.el;
even if other packages in the module have some indentation problems.
pukkamustard May 10, 2021, 5:18 a.m. UTC | #2
Hi divoplade,

divoplade <d@divoplade.fr> writes:

[...]

> So, now, I should your modified 5 patches in this issue on top 
> of the
> 37 patches in the other issue to get js-of-ocaml. Is it correct?
>
> At this rate, if it is possible, maybe you could just append 
> these 5 to
> the other issue, it would be easier to track.
>
> What do you think?
 
Yeah, that makes sense. I just submitted a V2 of #47768 
(https://issues.guix.gnu.org/47768) that includes your patches for 
js_of_ocaml, merging the issues.

Closing this issue in favor of #47769.

-pukkamustard
diff mbox series

Patch

From 7a19c648423b31d2322a86dc762dd01e39c417c0 Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Wed, 30 Dec 2020 19:08:57 +0100
Subject: [PATCH 6/6] gnu: Add ocaml-js-of-ocaml.

* gnu/packages/ocaml.scm (ocaml-js-of-ocaml): New variable.

Co-Authored-By: pukkamustard <pukkamustard@posteo.net>
---
 gnu/packages/ocaml.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 349124c99e..24d9e814fa 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -61,6 +61,7 @@ 
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages node)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -6939,3 +6940,43 @@  Drawing takes place in a separate window that is created when
 Graphics.open_graph is called.  This library used to be distributed with OCaml
 up to OCaml 4.08.")
     (license license:lgpl2.1+)))
+
+(define-public ocaml-js-of-ocaml
+  (package
+    (name "ocaml-js-of-ocaml")
+    (version "3.9.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ocsigen/js_of_ocaml")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00hdjaj94j3nc6f6wbbpx59h4yc79siphs34i1hry11r56paaqyk"))))
+    (build-system dune-build-system)
+    (arguments `(#:test-target "."))
+    (propagated-inputs
+     `(("ocaml-ppxlib" ,ocaml-ppxlib)
+       ("ocaml-uchar" ,ocaml-uchar)
+       ("ocaml-menhir" ,ocaml-menhir)
+       ("ocaml-reactivedata" ,ocaml-reactivedata)
+       ("ocaml-cmdliner" ,ocaml-cmdliner)
+       ("ocaml-lwt" ,ocaml-lwt)
+       ("ocaml-tyxml" ,ocaml-tyxml)
+       ("ocaml-re" ,ocaml-re)
+       ("ocaml-uutf" ,ocaml-uutf)
+       ("ocaml-graphics" ,ocaml-graphics)
+       ("ocaml-yojson" ,ocaml-yojson)))
+    (native-inputs
+     ;; for tests
+     `(("node" ,node)
+       ("ocaml-ppx-expect" ,ocaml-ppx-expect)
+       ("ocaml-num" ,ocaml-num)))
+    (properties `((upstream-name . "js_of_ocaml")))
+    (home-page "https://ocsigen.org/js_of_ocaml/")
+    (synopsis "Compiler from OCaml bytecode to Javascript")
+    (description "Js_of_ocaml is a compiler from OCaml bytecode to JavaScript.
+It makes it possible to run pure OCaml programs in JavaScript environment like
+browsers and Node.js.")
+    (license license:lgpl2.1+)))
-- 
2.31.1