[PATCH 0/6] Add wally-cli

OpenSubmitted by Martin Becze.
Details
5 participants
  • Nicolò Balzarotti
  • divoplade
  • Maxime Devos
  • Martin Becze
  • pukkamustard
Owner
unassigned
Severity
normal
M
M
Martin Becze wrote on 14 Apr 2021 12:14
(address . guix-patches@gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414101413.5743-1-mjbecze@riseup.net
This patch set adds wally-cli.


Martin Becze (6):
gnu: Add go-gopkg-in-cheggaaa-pb-v1.
gnu: Added go-github-com-logrusorgru-aurora.
gnu: Added go-github-com-caarlos0-spin.
gnu: Added go-github-com-marcinbor85-gohex.
gnu: Added go-github-com-google-gousb.
gnu: Added wally-cli.

gnu/packages/flashing-tools.scm | 32 +++++++++
gnu/packages/golang.scm | 112 +++++++++++++++++++++++++++++++-
2 files changed, 143 insertions(+), 1 deletion(-)

--
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 1/6] gnu: Add go-gopkg-in-cheggaaa-pb-v1.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-1-mjbecze@riseup.net
* gnu/packages/golang.scm (go-gopkg-in-cheggaaa-pb-v1): New variable.
---
gnu/packages/golang.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 6502740220..da61c4b8f2 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
-;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2020, 2021 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
@@ -6419,6 +6419,23 @@ inspired by the causal messaging system in the Pony programming language.")
 the terminal.")
     (license license:bsd-3)))
 
+(define-public go-gopkg-in-cheggaaa-pb-v1
+  (package
+    (inherit go-github-com-cheggaaa-pb)
+    (name "go-gopkg-in-cheggaaa-pb-v1")
+    (version "1.0.28")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gopkg.in/cheggaaa/pb.v1.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "13a66cqbpdif804qj12z9ad8r24va9q41gfk71qbc4zg1wsxs3rh"))))
+    (arguments
+     '(#:import-path "gopkg.in/cheggaaa/pb.v1"))))
+
 (define-public go-github-com-gologme-log
   ;; this is the same as v1.2.0, only the LICENSE file changed
   (let ((commit "720ba0b3ccf0a91bc6018c9967a2479f93f56a55"))
-- 
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 2/6] gnu: Added go-github-com-logrusorgru-aurora.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-2-mjbecze@riseup.net
* gnu/packages/golang.scm (go-github-com-logrusorgru-aurora): New variable.
---
gnu/packages/golang.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index da61c4b8f2..3c9698f887 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6735,6 +6735,28 @@ compressed streams in Go.")
     (home-page "https://github.com/ulikunitz/xz")
     (license license:bsd-3)))
 
+(define-public go-github-com-logrusorgru-aurora
+  (package
+    (name "go-github-com-logrusorgru-aurora")
+    (version "3.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/logrusorgru/aurora.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "0z7cgj8gl69271d0ag4f4yjbsvbrnfibc96cs01spqf5krv2rzjc"))
+       (file-name (git-file-name name version))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/logrusorgru/aurora"))
+    (home-page "https://github.com/logrusorgru/aurora")
+    (synopsis "Ultimate ANSI colors for Golang")
+    (description "This package provides ANSI colors for Golang.  The package
+supports Printf/Sprintf etc.")
+    (license license:unlicense)))
+
 (define-public go-github-com-songmu-gitconfig
   (package
     (name "go-github-com-songmu-gitconfig")
-- 
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 3/6] gnu: Added go-github-com-caarlos0-spin.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-3-mjbecze@riseup.net
* gnu/packages/golang.scm (go-github-com-caarlos0-spin): New variable.
---
gnu/packages/golang.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 3c9698f887..05bec7ea3c 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6757,6 +6757,27 @@ compressed streams in Go.")
 supports Printf/Sprintf etc.")
     (license license:unlicense)))
 
+(define-public go-github-com-caarlos0-spin
+  (package
+    (name "go-github-com-caarlos0-spin")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/caarlos0-graveyard/spin.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1pnijds4145j8nsxvq8203r2sg2pbk7x8prkdg2ilghhrzqj6vyc"))
+       (file-name (git-file-name name version))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/caarlos0/spin"))
+    (home-page "https://github.com/caarlos0-graveyard/spin")
+    (synopsis "Simple spinner for cli apps")
+    (description "A very simple spinner for cli golang apps.")
+    (license license:expat)))
+
 (define-public go-github-com-songmu-gitconfig
   (package
     (name "go-github-com-songmu-gitconfig")
-- 
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 4/6] gnu: Added go-github-com-marcinbor85-gohex.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-4-mjbecze@riseup.net
* gnu/packages/golang.scm (go-github-com-marcinbor85-gohex): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 05bec7ea3c..b218f3fa4a 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6778,6 +6778,29 @@ supports Printf/Sprintf etc.")
     (description "A very simple spinner for cli golang apps.")
     (license license:expat)))
 
+(define-public go-github-com-marcinbor85-gohex
+  (let ((commit "baab2527a9a2a4abb3dc06baabedfa5e0268b8d8")
+        (revision "1"))
+    (package
+      (name "go-github-com-marcinbor85-gohex")
+      (version (git-version "0.0.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/marcinbor85/gohex")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "06v4cc6ld6vvxd4xm9k6l49lhcd9ncq7xfx35mj5b9r96ih49fiz"))
+                (file-name (git-file-name name version))))
+      (build-system go-build-system)
+      (arguments
+       '(#:import-path "github.com/marcinbor85/gohex"))
+      (home-page "https://godoc.org/github.com/marcinbor85/gohex")
+      (synopsis "Parse Intel hex files")
+      (description "A Go library for parsing Intel HEX files.")
+      (license license:expat))))
+
 (define-public go-github-com-songmu-gitconfig
   (package
     (name "go-github-com-songmu-gitconfig")
-- 
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 5/6] gnu: Added go-github-com-google-gousb.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-5-mjbecze@riseup.net
* gnu/packages/golang.scm (go-github-com-google-gousb): New variable.
---
gnu/packages/golang.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b218f3fa4a..4643859424 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages libusb)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -4660,6 +4661,32 @@ GitHub API v3.")
 create or replace a file or symbolic link.")
     (license license:asl2.0)))
 
+(define-public go-github-com-google-gousb
+  (package
+    (name "go-github-com-google-gousb")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/google/gousb.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "1aki6hk009sicrf7gxy5nkjmj4j7lsy0by4kjgd9bwq8ragfyv5x"))
+       (file-name (git-file-name name version))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/google/gousb"))
+    (propagated-inputs
+     `(("pkg-config" ,pkg-config)
+       ("libusb" ,libusb)))
+    (home-page "https://github.com/google/gousb")
+    (synopsis "Wrapping for libusb")
+    (description "The gousb package is an attempt at wrapping the libusb
+library into a Go-like binding.")
+    (license license:asl2.0)))
+
 (define-public go-golang.org-x-sync-errgroup
   (let ((commit "cd5d95a43a6e21273425c7ae415d3df9ea832eeb")
         (revision "0"))
-- 
2.31.1
M
M
Martin Becze wrote on 14 Apr 2021 12:20
[PATCH 6/6] gnu: Added wally-cli.
(address . 47769@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20210414102010.6100-6-mjbecze@riseup.net
* gnu/packages/flashing-tools.scm (wally-cli): New variable.
---
gnu/packages/flashing-tools.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index 4b597dca50..baf9af8715 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Martin Becze <mjbecze@riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,6 +33,7 @@
   #:use-module (gnu packages)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system go)
   #:use-module (guix build-system python)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages admin)
@@ -44,6 +46,7 @@
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages golang)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages libusb)
@@ -517,3 +520,32 @@ Unifinished Extensible Firmware Interface (UEFI) images.")
 manipulating EPROM load files.  It reads and writes numerous EPROM file
 formats, and can perform many different manipulations.")
     (license license:gpl3+)))
+
+(define-public wally-cli
+  (package
+    (name "wally-cli")
+    (version "2.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/zsa/wally-cli.git")
+             (commit (string-append version "-linux"))))
+       (sha256
+        (base32
+         "0xz3z18bbnf736ngjj6jhnp3p2j55m5jhnb2xl6l5hybracfyhm7"))
+       (file-name (git-file-name name version))))
+    (build-system go-build-system)
+    (arguments
+     '(#:tests? #f                      ; tests fail on the linter
+       #:import-path "github.com/zsa/wally-cli"))
+    (native-inputs
+     `(("go-gopkg-in-cheggaaa-pb-v1" ,go-gopkg-in-cheggaaa-pb-v1)
+       ("go-github-com-google-gousb" ,go-github-com-google-gousb)
+       ("go-github-com-marcinbor85-gohex" ,go-github-com-marcinbor85-gohex)
+       ("go-github-com-caarlos0-spin" ,go-github-com-caarlos0-spin)
+       ("go-github-com-logrusorgru-aurora" ,go-github-com-logrusorgru-aurora)))
+    (home-page "https://ergodox-ez.com/pages/wally")
+    (synopsis "Flashing tool for ZSA keyboards")
+    (description "This tool is for flashing custom layouts to ZSA keyboards.")
+    (license license:expat)))
-- 
2.31.1
M
M
Maxime Devos wrote on 14 Apr 2021 23:28
aa4c88b595a3ddbe272c5fed8e86444ac9d621a5.camel@telenet.be
On Wed, 2021-04-14 at 05:20 -0500, Martin Becze wrote:
Toggle quote (19 lines)
> [...]
> +(define-public wally-cli
> + (package
> + (name "wally-cli")
> + (version "2.0.0")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/zsa/wally-cli.git")
> + (commit (string-append version "-linux"))))
> + (sha256
> + (base32
> + "0xz3z18bbnf736ngjj6jhnp3p2j55m5jhnb2xl6l5hybracfyhm7"))
> + (file-name (git-file-name name version))))
> + (build-system go-build-system)
> + (arguments
> + '(#:tests? #f ; tests fail on the linter

Does upstream know about the failing tests?
Also, consider disabling *only* the known failing tests.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHdejhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kV2APsHjNbvNVTbnnMF0++JBRUfwX94
zjru3GvQpgXA1rH3RAD9FIJmtppTcEptWwiPuNZ2JNDN64KP+s0nfp3eTGoEvgI=
=QFAq
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 14 Apr 2021 23:31
Re: [bug#47769] [PATCH 5/6] gnu: Added go-github-com-google-gousb.
fce2be2309a7677bfad305ed9ed5379e2b9fee21.camel@telenet.be
On Wed, 2021-04-14 at 05:20 -0500, Martin Becze wrote:
Toggle quote (21 lines)
> +(define-public go-github-com-google-gousb
> + (package
> + (name "go-github-com-google-gousb")
> + (version "2.1.0")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/google/gousb.git")
> + (commit (string-append "v" version))))
> + (sha256
> + (base32
> + "1aki6hk009sicrf7gxy5nkjmj4j7lsy0by4kjgd9bwq8ragfyv5x"))
> + (file-name (git-file-name name version))))
> + (build-system go-build-system)
> + (arguments
> + '(#:import-path "github.com/google/gousb"))
> + (propagated-inputs
> + `(("pkg-config" ,pkg-config)
> + ("libusb" ,libusb)))

Most likely, "pkg-config" should be in native-inputs.

I believe there's a linter that checks whether packages should
be in native-inputs, but I'm not sure if pkg-config is detected.
Consider running ./pre-inst-env guix lint go-github-com-google-gousb.

Also, why is "libusb" in "propagated-inputs" and not in "inputs"?
"inputs" is usually preferred over "propagated-inputs", but there
are valid reasons to use "propagated-inputs" instead.

Greetings,
Maime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHdfMxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hrUAQCdZk8Kmk0TEX/t58Y16icXXEj8
wSD8Gc4gKVKPUaH4aQEAr8whO5HZkKEHxHjfJ0ObFG6pSFlfIMaG4CQx0+l7sQo=
=Jcn8
-----END PGP SIGNATURE-----


N
N
Nicolò Balzarotti wrote on 14 Apr 2021 23:55
Re: [bug#47769] [PATCH 3/6] gnu: Added go-github-com-caarlos0-spin.
(name . Martin Becze)(address . mjbecze@riseup.net)
8735vsv8dr.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
Hi! I had the wally-cli patch floating around, but did not submit it
because of this package

Martin Becze <mjbecze@riseup.net> writes:

Toggle quote (5 lines)
> * gnu/packages/golang.scm (go-github-com-caarlos0-spin): New variable.
> ---
> + (license license:expat)))
> +

I cannot find the license in the repo, I opened an issue with no
response

How do you know it's expat?
N
N
Nicolò Balzarotti wrote on 15 Apr 2021 00:02
Re: [bug#47769] [PATCH 6/6] gnu: Added wally-cli.
87y2dktthf.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (23 lines)
> On Wed, 2021-04-14 at 05:20 -0500, Martin Becze wrote:
>> [...]
>> +(define-public wally-cli
>> + (package
>> + (name "wally-cli")
>> + (version "2.0.0")
>> + (source
>> + (origin
>> + (method git-fetch)
>> + (uri (git-reference
>> + (url "https://github.com/zsa/wally-cli.git")
>> + (commit (string-append version "-linux"))))
>> + (sha256
>> + (base32
>> + "0xz3z18bbnf736ngjj6jhnp3p2j55m5jhnb2xl6l5hybracfyhm7"))
>> + (file-name (git-file-name name version))))
>> + (build-system go-build-system)
>> + (arguments
>> + '(#:tests? #f ; tests fail on the linter
>
> Does upstream know about the failing tests?
> Also, consider disabling *only* the known failing tests.

@Martin
I had a patch floating around using this commit:
0cf3dd904c5d67278d04182debb310c370754da6
where I commented that this fixed the tests.
Could you check? Maybe we can ask upstream if they can tag a new
version.

Thanks, Nicolò
M
M
Martin Becze wrote on 15 Apr 2021 14:59
Re: [bug#47769] [PATCH 3/6] gnu: Added go-github-com-caarlos0-spin.
b5f3173c-f55d-58bc-c64d-91fff690a993@riseup.net
uff go catch. I think I put that in there for a place holder and forgot
about it. Not sure what to do here. B/c the code looks pretty abandoned.

On 4/14/21 4:55 PM, Nicolò Balzarotti wrote:
Toggle quote (17 lines)
>
> Hi! I had the wally-cli patch floating around, but did not submit it
> because of this package
>
> Martin Becze <mjbecze@riseup.net> writes:
>
>> * gnu/packages/golang.scm (go-github-com-caarlos0-spin): New variable.
>> ---
>> + (license license:expat)))
>> +
>
> I cannot find the license in the repo, I opened an issue with no
> response
> https://github.com/caarlos0-graveyard/spin/issues/8
>
> How do you know it's expat?
>
M
M
Martin Becze wrote on 15 Apr 2021 15:11
Re: [bug#47769] [PATCH 6/6] gnu: Added wally-cli.
a6e3997b-ce81-3d75-a23c-230847c2cb90@riseup.net
Just checked and it works! +1. Nicolo, is your patch on this list?

On 4/14/21 5:02 PM, Nicolò Balzarotti wrote:
Toggle quote (34 lines)
> Maxime Devos <maximedevos@telenet.be> writes:
>
>> On Wed, 2021-04-14 at 05:20 -0500, Martin Becze wrote:
>>> [...]
>>> +(define-public wally-cli
>>> + (package
>>> + (name "wally-cli")
>>> + (version "2.0.0")
>>> + (source
>>> + (origin
>>> + (method git-fetch)
>>> + (uri (git-reference
>>> + (url "https://github.com/zsa/wally-cli.git")
>>> + (commit (string-append version "-linux"))))
>>> + (sha256
>>> + (base32
>>> + "0xz3z18bbnf736ngjj6jhnp3p2j55m5jhnb2xl6l5hybracfyhm7"))
>>> + (file-name (git-file-name name version))))
>>> + (build-system go-build-system)
>>> + (arguments
>>> + '(#:tests? #f ; tests fail on the linter
>>
>> Does upstream know about the failing tests?
>> Also, consider disabling *only* the known failing tests.
>
> @Martin
> I had a patch floating around using this commit:
> 0cf3dd904c5d67278d04182debb310c370754da6
> where I commented that this fixed the tests.
> Could you check? Maybe we can ask upstream if they can tag a new
> version.
>
> Thanks, Nicolò
>
N
N
Nicolò Balzarotti wrote on 15 Apr 2021 15:44
87tuo7u0ft.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
Martin Becze <mjbecze@riseup.net> writes:

Toggle quote (2 lines)
> Just checked and it works! +1. Nicolo, is your patch on this list?
>
Nope, I was waiting for carlos0 to answer to my licensing issue.
N
N
Nicolò Balzarotti wrote on 15 Apr 2021 16:57
Re: [bug#47769] [PATCH 3/6] gnu: Added go-github-com-caarlos0-spin.
87r1jbtx34.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
Martin Becze <mjbecze@riseup.net> writes:

Toggle quote (2 lines)
> uff go catch. I think I put that in there for a place holder and forgot
> about it. Not sure what to do here. B/c the code looks pretty abandoned.
I told upstream about the problem here[fn:1] let's see

P
P
pukkamustard wrote on 3 May 2021 14:38
Re: [bug#45558] [PATCH] Add js_of_ocaml
(name . divoplade)(address . d@divoplade.fr)
86im3z9gdd.fsf@posteo.net
Hi divoplade,

divoplade <d@divoplade.fr> writes:

Toggle quote (2 lines)
> I finally got js_of_ocaml packaged.

Thank you!

Toggle quote (2 lines)
> 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).

Toggle quote (2 lines)
> , 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:
- 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)
From ef943e9e01e979a3de7c84d88d5f8d3d6535da9a Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Wed, 30 Dec 2020 19:06:57 +0100
Subject: [PATCH 1/6] gnu: Add ocaml-graphics.

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

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

Toggle diff (36 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index c390a8bce9..4727b294d9 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6900,3 +6900,29 @@ Both interfaces give the user total control over the blocking behavior of
 their application, with the unbuffered interface enabling zero-copy IO.
 Parsers are backtracking by default and support unbounded lookahead.")
     (license license:bsd-3)))
+
+(define-public ocaml-graphics
+  (package
+    (name "ocaml-graphics")
+    (version "5.1.1")
+    (home-page "https://github.com/ocaml/graphics")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url home-page)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "14w07ydji2nbdk366nfp2pzs9484xp9vqv63n345id13v48z8bfi"))))
+    (build-system dune-build-system)
+    (propagated-inputs
+     `(("libx11" ,libx11)))
+    (synopsis "The OCaml graphics library")
+    (description
+     "The graphics library provides a set of portable drawing primitives.
+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+)))
-- 
2.31.1
From 96f9bb75aa9a401f353619d112e414eab2745db1 Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamustard@posteo.net>
Date: Mon, 3 May 2021 22:49:23 +0200
Subject: [PATCH 2/6] gnu: Add ocaml-variantslib.

* gnu/packages/ocaml.scm (ocaml-variantslib): New variable.
(ocaml4.07-variantslib): Inherit from ocaml-variantslib.
---
gnu/packages/ocaml.scm | 52 ++++++++++++++++++++++++------------------
1 file changed, 30 insertions(+), 22 deletions(-)

Toggle diff (90 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 4727b294d9..e40bc78db2 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5137,37 +5137,45 @@ of a record and create new record values.")
               "12948pzxrl360lybm9fzyvplgcl87zjbn4m3sk1aw75zk85p1388"))
      (properties `((upstream-name . "fieldslib"))))))
 
-(define-public ocaml4.07-variantslib
+(define-public ocaml-variantslib
   (package
-    (name "ocaml4.07-variantslib")
-    (version "0.11.0")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://ocaml.janestreet.com/ocaml-core/v"
-                                  (version-major+minor version)
-                                  "/files/variantslib-v" version ".tar.gz"))
-              (sha256
-               (base32
-                "1hsdwmkslvk4cznqr4lyyiy7vvk5spil226k0z2in26fxq6y0hf3"))))
+    (name "ocaml-variantslib")
+    (version "0.14.0")
+    (source
+     (janestreet-origin "variantslib" version
+              "11zp27gh282dx9ifbhcp6i7fkc97fvk8amaj58mf1g1hwklc0lm3"))
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f
-       #:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
+     `(#:tests? #f))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
-    (properties `((upstream-name . "variantslib")))
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
+       ("ocaml-ppxlib" ,ocaml-ppxlib)))
+    (properties `((upstream-name . "variantslib")
+                  (ocaml4.07-variant . ,(delay ocaml4.07-variantslib))))
     (home-page "https://github.com/janestreet/variantslib")
     (synopsis "OCaml variants as first class values")
     (description "The Core suite of libraries is an alternative to OCaml's
 standard library.")
     (license license:asl2.0)))
 
+(define-public ocaml4.07-variantslib
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-variantslib)
+     (name "ocaml-variantslib")
+     (version "0.11.0")
+     (source (origin
+               (method url-fetch)
+               (uri (string-append "https://ocaml.janestreet.com/ocaml-core/v"
+                                   (version-major+minor version)
+                                   "/files/variantslib-v" version ".tar.gz"))
+               (sha256
+                (base32
+                 "1hsdwmkslvk4cznqr4lyyiy7vvk5spil226k0z2in26fxq6y0hf3"))))
+     (properties `((upstream-name . "variantslib"))))))
+
 (define-public ocaml-ppx-fields-conv
   (package
     (name "ocaml-ppx-fields-conv")
@@ -5268,7 +5276,7 @@ definitions.")
     (build-system dune-build-system)
     (propagated-inputs
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-variantslib" ,ocaml4.07-variantslib)
+       ("ocaml-variantslib" ,(package-with-ocaml4.07 ocaml-variantslib))
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
        ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
@@ -6312,7 +6320,7 @@ standard library that was developed by Jane Street.")
         ("ocaml-splittable-random" ,ocaml4.07-splittable-random)
         ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-typerep" ,ocaml4.07-typerep)
-        ("ocaml-variantslib" ,ocaml4.07-variantslib)
+        ("ocaml-variantslib" ,(package-with-ocaml4.07 ocaml-variantslib))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
     (properties `((upstream-name . "core_kernel")))
-- 
2.31.1
From 4753a6bf81c13af58a866782c8b63bbf035c9bd3 Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamustard@posteo.net>
Date: Mon, 3 May 2021 22:42:10 +0200
Subject: [PATCH 3/6] gnu: Add ocaml-ppx-variants-conv.

* gnu/packages/ocaml.scm (ocaml-ppx-variants-conv): New variable.
(ocaml4.07-ppx-variants-conv): Inherit from ocaml-ppx-variants-conv.
---
gnu/packages/ocaml.scm | 65 ++++++++++++++++++++++++++----------------
1 file changed, 40 insertions(+), 25 deletions(-)

Toggle diff (110 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index e40bc78db2..019bfea9f9 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5260,32 +5260,29 @@ definitions.")
                  "0pqwnqy1xp309wvdcaax4lg02yk64lq2w03mbgfvf6ps5ry4gis9"))))
      (properties `((upstream-name . "ppx_sexp_conv"))))))
 
-(define-public ocaml4.07-ppx-variants-conv
+(define-public ocaml-ppx-variants-conv
   (package
-    (name "ocaml4.07-ppx-variants-conv")
-    (version "0.11.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/janestreet/ppx_variants_conv")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd"))))
+    (name "ocaml-ppx-variants-conv")
+    (version "0.14.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janestreet/ppx_variants_conv")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0q6a43zrwqzdz7aja0k44a2llyjjj5xzi2kigwhsnww3g0r5ig84"))))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-variantslib" ,(package-with-ocaml4.07 ocaml-variantslib))
-       ("ocaml-migrate-parsetree"
-        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
-    (arguments
-     `(#:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-variantslib" ,ocaml-variantslib)
+       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
+       ("ocaml-ppxlib" ,ocaml-ppxlib)))
     (properties
-     `((upstream-name . "ppx_variants_conv")))
+     `((upstream-name . "ppx_variants_conv")
+       (ocaml4.07-variant . ,(delay ocaml4.07-ppx-variants-conv))))
     (home-page
      "https://github.com/janestreet/ppx_variants_conv")
     (synopsis "Generation of accessor and iteration functions for OCaml variant types")
@@ -5294,6 +5291,24 @@ definitions.")
 variant types.")
     (license license:asl2.0)))
 
+(define-public ocaml4.07-ppx-variants-conv
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-ppx-variants-conv)
+     (name "ocaml-ppx-variants-conv")
+     (version "0.11.1")
+     (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/janestreet/ppx_variants_conv")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd"))))
+    (properties `((upstream-name . "ppx_variants_conv"))))))
+
 (define-public ocaml-ppx-custom-printf
   (package
     (name "ocaml-ppx-custom-printf")
@@ -5352,7 +5367,7 @@ string conversion.")
         ("ocaml-ppx-custom-printf" ,(package-with-ocaml4.07 ocaml-ppx-custom-printf))
         ("ocaml-ppx-fields-conv" ,(package-with-ocaml4.07 ocaml-ppx-fields-conv))
         ("ocaml-ppx-sexp-conv" ,(package-with-ocaml4.07 ocaml-ppx-sexp-conv))
-        ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
+        ("ocaml-ppx-variants-conv" ,(package-with-ocaml4.07 ocaml-ppx-variants-conv))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
     (arguments
@@ -5888,7 +5903,7 @@ useful errors on failure.")
         ("ocaml-ppx-here" ,(package-with-ocaml4.07 ocaml-ppx-here))
         ("ocaml-ppx-inline-test" ,(package-with-ocaml4.07 ocaml-ppx-inline-test))
         ("ocaml-ppx-sexp-conv" ,(package-with-ocaml4.07 ocaml-ppx-sexp-conv))
-        ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
+        ("ocaml-ppx-variants-conv" ,(package-with-ocaml4.07 ocaml-ppx-variants-conv))
         ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
@@ -6088,7 +6103,7 @@ functions from type definitions.")
         ("ocaml-ppx-sexp-message" ,ocaml4.07-ppx-sexp-message)
         ("ocaml-ppx-sexp-value" ,ocaml4.07-ppx-sexp-value)
         ("ocaml-ppx-typerep-conv" ,ocaml4.07-ppx-typerep-conv)
-        ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
+        ("ocaml-ppx-variants-conv" ,(package-with-ocaml4.07 ocaml-ppx-variants-conv))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
         ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
-- 
2.31.1
From 332c6ce5b26127f2f324a46489e4c01181de2e57 Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamustard@posteo.net>
Date: Mon, 3 May 2021 22:32:27 +0200
Subject: [PATCH 4/6] gnu: Add ocaml-ppx-expect.

* gnu/packages/ocaml.scm (ocaml-ppx-expect): New variable.
(ocaml4.07-ppx-expect): Inherit from ocaml-ppx-expect.
---
gnu/packages/ocaml.scm | 83 +++++++++++++++++++++++++-----------------
1 file changed, 49 insertions(+), 34 deletions(-)

Toggle diff (127 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 019bfea9f9..c4a024c850 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -3791,7 +3791,7 @@ library is currently designed for Unicode Standard 3.2.")
      `(("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
        ("ocaml-camomile" ,(package-with-ocaml4.07 ocaml-camomile))))
     (native-inputs
-     `(("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)))
+     `(("ocaml-ppx-expect" ,(package-with-ocaml4.07 ocaml-ppx-expect))))
     (properties
      `((upstream-name . "charInfo_width")))
     (home-page "https://bitbucket.org/zandoye/charinfo_width/")
@@ -5876,40 +5876,31 @@ useful errors on failure.")
         ("ocaml-ppxlib" ,ocaml-ppxlib)))
      (properties `((upstream-name . "ppx_assert"))))))
 
-(define-public ocaml4.07-ppx-expect
+(define-public ocaml-ppx-expect
   (package
-    (name "ocaml4.07-ppx-expect")
-    (version "0.12.0")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_expect")
-                     (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q"))))
+    (name "ocaml-ppx-expect")
+    (version "0.14.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janestreet/ppx_expect")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0vbbnjrzpyk5p0js21lafr6fcp2wqka89p1876rdf472cmg0l7fv"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-assert" ,(package-with-ocaml4.07 ocaml4.07-ppx-assert))
-        ("ocaml-ppx-compare" ,(package-with-ocaml4.07 ocaml-ppx-compare))
-        ("ocaml-ppx-custom-printf" ,(package-with-ocaml4.07 ocaml-ppx-custom-printf))
-        ("ocaml-ppx-fields-conv" ,(package-with-ocaml4.07 ocaml-ppx-fields-conv))
-        ("ocaml-ppx-here" ,(package-with-ocaml4.07 ocaml-ppx-here))
-        ("ocaml-ppx-inline-test" ,(package-with-ocaml4.07 ocaml-ppx-inline-test))
-        ("ocaml-ppx-sexp-conv" ,(package-with-ocaml4.07 ocaml-ppx-sexp-conv))
-        ("ocaml-ppx-variants-conv" ,(package-with-ocaml4.07 ocaml-ppx-variants-conv))
-        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))
-        ("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))))
-    (properties `((upstream-name . "ppx_expect")))
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-ppx-here" ,ocaml-ppx-here)
+       ("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
+       ("ocaml-stdio" ,ocaml-stdio)
+       ("ocaml-ppxlib" ,ocaml-ppxlib)
+       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
+       ("ocaml-re" ,ocaml-re)))
+    (properties `((upstream-name . "ppx_expect")
+                  (ocaml4.07-variant . ,(delay ocaml4.07-ppx-expect))))
     (home-page "https://github.com/janestreet/ppx_expect")
     (synopsis "Cram like framework for OCaml")
     (description "Expect-test is a framework for writing tests in OCaml, similar
@@ -5919,6 +5910,30 @@ output-generating code, interleaved with @code{%expect} extension expressions
 to denote the expected output.")
     (license license:asl2.0)))
 
+(define-public ocaml4.07-ppx-expect
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-ppx-expect)
+     (version "0.12.0")
+     (source
+      (janestreet-origin "ppx_expect" version
+                         "1zpci8c49yn2ixchmwjx1kf9pwybv3dnn4l2dgnd6m36qnkralfk"))
+     (propagated-inputs
+      `(("ocaml-base" ,ocaml-base)
+        ("ocaml-ppx-assert" ,ocaml-ppx-assert)
+        ("ocaml-ppx-compare" ,ocaml-ppx-compare)
+        ("ocaml-ppx-custom-printf" ,ocaml-ppx-custom-printf)
+        ("ocaml-ppx-fields-conv" ,ocaml-ppx-fields-conv)
+        ("ocaml-ppx-here" ,ocaml-ppx-here)
+        ("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
+        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
+        ("ocaml-ppx-variants-conv" ,ocaml-ppx-variants-conv)
+        ("ocaml-stdio" ,ocaml-stdio)
+        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
+        ("ocaml-ppxlib" ,ocaml-ppxlib)
+        ("ocaml-re" ,ocaml-re)))
+     (properties `((upstream-name . "ppx_expect"))))))
+
 (define-public ocaml-ppx-js-style
   (package
     (name "ocaml-ppx-js-style")
@@ -6091,7 +6106,7 @@ functions from type definitions.")
         ("ocaml-ppx-bench" ,ocaml4.07-ppx-bench)
         ("ocaml-ppx-bin-prot" ,ocaml4.07-ppx-bin-prot)
         ("ocaml-ppx-custom-printf" ,(package-with-ocaml4.07 ocaml-ppx-custom-printf))
-        ("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)
+        ("ocaml-ppx-expect" ,(package-with-ocaml4.07 ocaml-ppx-expect))
         ("ocaml-ppx-fail" ,ocaml4.07-ppx-fail)
         ("ocaml-ppx-fields-conv" ,(package-with-ocaml4.07 ocaml-ppx-fields-conv))
         ("ocaml-ppx-here" ,(package-with-ocaml4.07 ocaml-ppx-here))
@@ -6236,7 +6251,7 @@ Configurator allows one to:
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (native-inputs
-     `(("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)))
+     `(("ocaml-ppx-expect" ,(package-with-ocaml4.07 ocaml-ppx-expect))))
     (home-page "https://github.com/janestreet/spawn")
     (synopsis "Spawning sub-processes")
     (description
-- 
2.31.1
From ac57c989bb2dab51e45561c3faeed8ef5a52cb3a Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamustard@posteo.net>
Date: Tue, 4 May 2021 07:58:43 +0200
Subject: [PATCH 5/6] gnu: ocaml-num: Update to 1.4.

* gnu/packages/ocaml.scm (ocaml-num): Update to 1.4.
---
gnu/packages/ocaml.scm | 31 +++----------------------------
1 file changed, 3 insertions(+), 28 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index c4a024c850..349124c99e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -958,7 +958,7 @@ written in Objective Caml.")
 (define-public ocaml-num
   (package
     (name "ocaml-num")
-    (version "1.1")
+    (version "1.4")
     (source
      (origin
        (method git-fetch)
@@ -967,33 +967,8 @@ written in Objective Caml.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0a4mhxgs5hi81d227aygjx35696314swas0vzy3ig809jb7zq4h0"))))
-    (build-system ocaml-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'fix-makefile
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; This package supposes we install to the same directory as
-             ;; the ocaml package.
-             (substitute* "src/META"
-               (("\"\\^\"") (string-append "\"" (assoc-ref outputs "out")
-                                           "/lib/ocaml/site-lib\"")))
-             (substitute* "src/Makefile"
-               (("\\) \\$\\(STDLIBDIR\\)")
-                (string-append ") " (assoc-ref outputs "out")
-                               "/lib/ocaml/site-lib")))
-             #t))
-         (add-after 'install 'fix-stubslib
-           (lambda* (#:key outputs #:allow-other-keys)
-             (format #t "~a~%" (find-files "." ".*.so"))
-             (let ((stubdir (string-append (assoc-ref outputs "out")
-                                           "/lib/ocaml/site-lib/stublibs")))
-               (delete-file stubdir)
-               (mkdir-p stubdir)
-               (install-file "src/dllnums.so" stubdir))
-             #t)))))
+        (base32 "1vzdnvpj5dbj3ifx03v25pj2jj1ccav072v4d29pk1czdba2lzfc"))))
+    (build-system dune-build-system)
     (home-page "https://github.com/ocaml/num")
     (synopsis "Arbitrary-precision integer and rational arithmetic")
     (description "OCaml-Num contains the legacy Num library for
-- 
2.31.1
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(+)

Toggle diff (58 lines)
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
Best regards,
pukkamustard
D
D
divoplade wrote on 4 May 2021 11:10
(name . pukkamustard)(address . pukkamustard@posteo.net)
d119a73d318ec0bc0de19ca05ac9343253eb9adf.camel@divoplade.fr
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 :
Toggle quote (4 lines)
> 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.
?