unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45133] Add ocaml reactiveData
@ 2020-12-09 14:58 divoplade
  2020-12-09 15:40 ` Julien Lepiller
  0 siblings, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-09 14:58 UTC (permalink / raw)
  To: 45133

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Dear guix,

I want to have js_of_ocaml into guix. Here is a dependency of it,
reactiveData. It is a simple package, but the build system changed from
ocaml-build-system to dune-build-system between the last release and
now, so I think we should use the latest commit.

Best regards,

divoplade

[-- Attachment #2: 0001-gnu-add-ocaml-reactiveData.patch --]
[-- Type: text/x-patch, Size: 1967 bytes --]

From ca8deeb67a83c33cf16488b048224ccd76393791 Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Wed, 9 Dec 2020 15:45:04 +0100
Subject: [PATCH] gnu: add ocaml-reactiveData

	* ocaml.scm (ocaml-reactiveData): add ocaml-reactiveData
---
 gnu/packages/ocaml.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2bfda7307e..c394a1d263 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5859,3 +5859,38 @@ LablGL), gnomecanvas, gnomeui, gtksourceview, gtkspell, libglade (and it can
 generate OCaml code from .glade files), libpanel, librsvg and quartz.")
     ;; Version 2 only, with linking exception.
     (license license:lgpl2.0)))
+
+(define ocaml-reactiveData
+  (package
+   (name "ocaml-reactiveData")
+   (version "0.2.2")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+	   (url "https://github.com/ocsigen/reactiveData")
+	   (commit "aaf9ab6d64ff8ac7cde55b9148e2470406b2fa13")))
+     (sha256
+      (base32
+       "1b8a6dhv9i3k23g3k1x4n74dpp4bsifr4j7ks4v4ar6hkdj5vsa5"))))
+   (build-system dune-build-system)
+   (arguments
+    `(#:test-target "."
+      #:phases
+      (modify-phases
+       %standard-phases
+       (add-before 'build 'fix-deprecated
+		   (lambda _
+		     (substitute*
+		      "src/reactiveData.ml"
+		      (("Pervasives.compare") "compare"))
+		     #t)))))
+   (propagated-inputs
+    `(("ocaml-react" ,ocaml-react)))
+   (home-page
+    "https://github.com/ocsigen/reactiveData")
+   (synopsis
+    "Declarative events and signals for OCaml")
+   (description
+    "React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values : declarative events and signals. React doesn't define any primitive event or signal, it lets the client chooses the concrete timeline.")
+   (license license:lgpl2.1+)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 14:58 [bug#45133] Add ocaml reactiveData divoplade
@ 2020-12-09 15:40 ` Julien Lepiller
  2020-12-09 17:03   ` divoplade
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Lepiller @ 2020-12-09 15:40 UTC (permalink / raw)
  To: divoplade, 45133

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

There's no reason not to use the latest release. Could you scnd an updated patch for the latest release, with a comment saying future versions will use dune?

There seem to be some whitespace issues with your patch. Tabs?

Le 9 décembre 2020 09:58:35 GMT-05:00, divoplade <d@divoplade.fr> a écrit :
>Dear guix,
>
>I want to have js_of_ocaml into guix. Here is a dependency of it,
>reactiveData. It is a simple package, but the build system changed from
>ocaml-build-system to dune-build-system between the last release and
>now, so I think we should use the latest commit.
>
>Best regards,
>
>divoplade

[-- Attachment #2: Type: text/html, Size: 882 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 15:40 ` Julien Lepiller
@ 2020-12-09 17:03   ` divoplade
  2020-12-09 17:59     ` zimoun
  0 siblings, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-09 17:03 UTC (permalink / raw)
  To: Julien Lepiller, 45133

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]

Hello,

Le mercredi 09 décembre 2020 à 10:40 -0500, Julien Lepiller a écrit :
> There's no reason not to use the latest release. Could you scnd an
> updated patch for the latest release, with a comment saying future
> versions will use dune?
> 
> There seem to be some whitespace issues with your patch. Tabs?

You should be more pleased by this version. There are a lot of build
files, and no install command. So, I provided mine, which seems to
work, but I don't know what files should be installed. I bet on:

- .a, for the native code;
- .cma, for the ocaml bytecode;
- .cmi, for the interface;
- .cmxa for the ocaml native code;
- .cmxs for the plugins;
- .cmx if the compiler wants to inline code.

What do you think?

[-- Attachment #2: 0001-gnu-add-ocaml-reactiveData.patch --]
[-- Type: text/x-patch, Size: 2294 bytes --]

From f0c1d3e95bb4d348fe863dfd1286e65dce7eb3a2 Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Wed, 9 Dec 2020 15:45:04 +0100
Subject: [PATCH] gnu: add ocaml-reactiveData

	* ocaml.scm (ocaml-reactiveData): add ocaml-reactiveData
---
 gnu/packages/ocaml.scm | 45 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2bfda7307e..e3fcbe236f 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5859,3 +5859,48 @@ LablGL), gnomecanvas, gnomeui, gtksourceview, gtkspell, libglade (and it can
 generate OCaml code from .glade files), libpanel, librsvg and quartz.")
     ;; Version 2 only, with linking exception.
     (license license:lgpl2.0)))
+
+(define ocaml-reactiveData
+  ;; Future releases will use dune.
+  (package
+    (name "ocaml-reactiveData")
+    (version "0.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz")
+       (sha256
+        (base32
+         "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng"))
+       (snippet
+        `(begin
+	   (let ((makefile (open-file "Makefile" "a")))
+	     (display "
+install:
+\tocamlfind install reactiveData pkg/META _build/src/reactiveData.{a,cma,cmi,cmx,cmxa,cmxs}
+" makefile)
+	     (close-port makefile))
+	   #t))))
+    (arguments
+     `(#:phases
+       (modify-phases
+           %standard-phases
+         (delete 'configure)
+         (add-before 'build 'fix-deprecated
+	   (lambda _
+	     (substitute*
+		 "src/reactiveData.ml"
+	       (("Pervasives.compare") "compare"))
+	     #t)))))
+    (build-system ocaml-build-system)
+    (native-inputs
+     `(("ocamlbuild" ,ocamlbuild)))
+    (propagated-inputs
+     `(("ocaml-react" ,ocaml-react)))
+    (home-page
+     "https://github.com/ocsigen/reactiveData")
+    (synopsis
+     "Declarative events and signals for OCaml")
+    (description
+     "React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values : declarative events and signals. React doesn't define any primitive event or signal, it lets the client chooses the concrete timeline.")
+    (license license:lgpl2.1+)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 17:03   ` divoplade
@ 2020-12-09 17:59     ` zimoun
  2020-12-09 18:05       ` divoplade
  0 siblings, 1 reply; 15+ messages in thread
From: zimoun @ 2020-12-09 17:59 UTC (permalink / raw)
  To: divoplade; +Cc: Julien Lepiller, 45133

[-- Attachment #1: Type: text/plain, Size: 2409 bytes --]

Hi,

On Wed, 09 Dec 2020 at 18:03, divoplade <d@divoplade.fr> wrote:
> Le mercredi 09 dcembre 2020  10:40 -0500, Julien Lepiller a crit :

>> There's no reason not to use the latest release. Could you scnd an
>> updated patch for the latest release, with a comment saying future
>> versions will use dune?
>> 
>> There seem to be some whitespace issues with your patch. Tabs?
>
> You should be more pleased by this version. There are a lot of build

Still tabs issues.

> files, and no install command. So, I provided mine, which seems to
> work, but I don't know what files should be installed. I bet on:
>
> - .a, for the native code;
> - .cma, for the ocaml bytecode;
> - .cmi, for the interface;
> - .cmxa for the ocaml native code;
> - .cmxs for the plugins;
> - .cmx if the compiler wants to inline code.

Maybe the .ml, .mli, .cmt and .cmti should also go in site-lib.


> +(define ocaml-reactiveData

define-public ocaml-reativedata I guess

> +  ;; Future releases will use dune.
> +  (package
> +    (name "ocaml-reactiveData")

       (name "ocaml-reactivedata")

> +    (version "0.2.2")
> +    (source
> +     (origin
> +       (method url-fetch)

Why not git-fetch?  From my point of view, it is better than url-fetch.

> +       (uri "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz")
> +       (sha256
> +        (base32
> +         "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng"))
> +       (snippet
> +        `(begin
> +	   (let ((makefile (open-file "Makefile" "a")))
> +	     (display "
> +install:
> +\tocamlfind install reactiveData pkg/META _build/src/reactiveData.{a,cma,cmi,cmx,cmxa,cmxs}
> +" makefile)

I have not look into the details but since there is an opam file and a
topkg.ml file, I am confused why usual OCaml build dance does not work
here.

> +	     (close-port makefile))

[...]

> +    (home-page
> +     "https://github.com/ocsigen/reactiveData")

Same line.

> +    (synopsis
> +     "Declarative events and signals for OCaml")

Idem.

> +    (description
> +     "React is an OCaml module for functional reactive programming
> (FRP). It provides support to program with time varying values :
> declarative events and signals. React doesn't define any primitive
> event or signal, it lets the client chooses the concrete timeline.")

Indent.

> +    (license license:lgpl2.1+)))

Attached, a version with the comments. :-)

All the best,
simon


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: my.patch --]
[-- Type: text/x-diff, Size: 2944 bytes --]

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index d23bd9108d..dee31730bf 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5866,47 +5866,47 @@ generate OCaml code from .glade files), libpanel, librsvg and quartz.")
     ;; Version 2 only, with linking exception.
     (license license:lgpl2.0)))
 
-(define ocaml-reactiveData
+(define-public ocaml-reactivedata
   ;; Future releases will use dune.
   (package
-    (name "ocaml-reactiveData")
+    (name "ocaml-reactivedata")
     (version "0.2.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz")
-       (sha256
-        (base32
-         "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng"))
-       (snippet
-        `(begin
-	   (let ((makefile (open-file "Makefile" "a")))
-	     (display "
+    (source (origin
+              (method url-fetch)
+              (uri "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz")
+              (sha256
+               (base32
+                "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng"))
+              (snippet
+               `(begin
+                  (let ((makefile (open-file "Makefile" "a")))
+                    (display "
 install:
 \tocamlfind install reactiveData pkg/META _build/src/reactiveData.{a,cma,cmi,cmx,cmxa,cmxs}
 " makefile)
-	     (close-port makefile))
-	   #t))))
+                    (close-port makefile))
+                  #t))))
     (arguments
      `(#:phases
        (modify-phases
            %standard-phases
          (delete 'configure)
          (add-before 'build 'fix-deprecated
-	   (lambda _
-	     (substitute*
-		 "src/reactiveData.ml"
-	       (("Pervasives.compare") "compare"))
-	     #t)))))
+           (lambda _
+             (substitute*
+                 "src/reactiveData.ml"
+               (("Pervasives.compare") "compare"))
+             #t)))))
     (build-system ocaml-build-system)
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)))
     (propagated-inputs
      `(("ocaml-react" ,ocaml-react)))
-    (home-page
-     "https://github.com/ocsigen/reactiveData")
-    (synopsis
-     "Declarative events and signals for OCaml")
+    (home-page "https://github.com/ocsigen/reactiveData")
+    (synopsis "Declarative events and signals for OCaml")
     (description
-     "React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values : declarative events and signals. React doesn't define any primitive event or signal, it lets the client chooses the concrete timeline.")
+     "React is an OCaml module for functional reactive programming (FRP). It
+provides support to program with time varying values : declarative events and
+signals. React doesn't define any primitive event or signal, it lets the
+client chooses the concrete timeline.")
     (license license:lgpl2.1+)))

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 17:59     ` zimoun
@ 2020-12-09 18:05       ` divoplade
  2020-12-09 18:35         ` zimoun
  0 siblings, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-09 18:05 UTC (permalink / raw)
  To: zimoun; +Cc: Julien Lepiller, 45133

Le mercredi 09 décembre 2020 à 18:59 +0100, zimoun a écrit :
> I have not look into the details but since there is an opam file and
> a
> topkg.ml file, I am confused why usual OCaml build dance does not
> work
> here.

I'm not sure that's the reason, but the ocaml build dance runs make
install, and there's no install target in the Makefile, and the opam
file does not need to have an install target because it installs
everything. I think.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 18:05       ` divoplade
@ 2020-12-09 18:35         ` zimoun
  2020-12-09 19:12           ` Julien Lepiller
  0 siblings, 1 reply; 15+ messages in thread
From: zimoun @ 2020-12-09 18:35 UTC (permalink / raw)
  To: divoplade; +Cc: Julien Lepiller, 45133

On Wed, 9 Dec 2020 at 19:05, divoplade <d@divoplade.fr> wrote:

> I'm not sure that's the reason, but the ocaml build dance runs make
> install, and there's no install target in the Makefile, and the opam
> file does not need to have an install target because it installs
> everything. I think.

I do not know, I have not looked at the details, but for example:

  tar -jtvf $(guix build ocaml-uutf -S)

does not even show a Makefile and the Guix package looks like:

--8<---------------cut here---------------start------------->8---
    (build-system ocaml-build-system)
    (arguments
     `(#:tests? #f
       #:build-flags (list "build")
       #:phases
       (modify-phases %standard-phases
         (delete 'configure))))
    (native-inputs
     `(("ocamlbuild" ,ocamlbuild)
       ("opam" ,opam)
       ("topkg" ,ocaml-topkg)))
--8<---------------cut here---------------end--------------->8---

That's why I find it weird to have to patch the reactiveData Makefile
to be able to install it.  I am probably wrong and Julien will correct
me with their insight. :-)


All the best,
simon




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 18:35         ` zimoun
@ 2020-12-09 19:12           ` Julien Lepiller
  2020-12-10 12:41             ` zimoun
  2020-12-10 12:42             ` divoplade
  0 siblings, 2 replies; 15+ messages in thread
From: Julien Lepiller @ 2020-12-09 19:12 UTC (permalink / raw)
  To: zimoun, divoplade; +Cc: 45133

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

The ocaml-build-system will use the Makefile if it exists, otherwise it runs opam-install -i --prefix=out --libdir=out/lib/ocaml/site-lib

You need opam as an input.

Le 9 décembre 2020 13:35:57 GMT-05:00, zimoun <zimon.toutoune@gmail.com> a écrit :
>On Wed, 9 Dec 2020 at 19:05, divoplade <d@divoplade.fr> wrote:
>
>> I'm not sure that's the reason, but the ocaml build dance runs make
>> install, and there's no install target in the Makefile, and the opam
>> file does not need to have an install target because it installs
>> everything. I think.
>
>I do not know, I have not looked at the details, but for example:
>
>  tar -jtvf $(guix build ocaml-uutf -S)
>
>does not even show a Makefile and the Guix package looks like:
>
>--8<---------------cut here---------------start------------->8---
>    (build-system ocaml-build-system)
>    (arguments
>     `(#:tests? #f
>       #:build-flags (list "build")
>       #:phases
>       (modify-phases %standard-phases
>         (delete 'configure))))
>    (native-inputs
>     `(("ocamlbuild" ,ocamlbuild)
>       ("opam" ,opam)
>       ("topkg" ,ocaml-topkg)))
>--8<---------------cut here---------------end--------------->8---
>
>That's why I find it weird to have to patch the reactiveData Makefile
>to be able to install it.  I am probably wrong and Julien will correct
>me with their insight. :-)
>
>
>All the best,
>simon

[-- Attachment #2: Type: text/html, Size: 1845 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 19:12           ` Julien Lepiller
@ 2020-12-10 12:41             ` zimoun
  2020-12-10 12:49               ` divoplade
  2020-12-10 12:42             ` divoplade
  1 sibling, 1 reply; 15+ messages in thread
From: zimoun @ 2020-12-10 12:41 UTC (permalink / raw)
  To: Julien Lepiller, divoplade; +Cc: 45133

Hi,

On Wed, 09 Dec 2020 at 14:12, Julien Lepiller <julien@lepiller.eu> wrote:
> The ocaml-build-system will use the Makefile if it exists, otherwise
> it runs opam-install -i --prefix=out --libdir=out/lib/ocaml/site-lib

Therefore, instead of patching the Makefile, why not simple try to
remove it see what happens? :-)


All the best,
simon




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-09 19:12           ` Julien Lepiller
  2020-12-10 12:41             ` zimoun
@ 2020-12-10 12:42             ` divoplade
  2020-12-10 13:53               ` Julien Lepiller
  1 sibling, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-10 12:42 UTC (permalink / raw)
  To: Julien Lepiller, zimoun; +Cc: 45133

Hello,

Le mercredi 09 décembre 2020 à 14:12 -0500, Julien Lepiller a écrit :
> The ocaml-build-system will use the Makefile if it exists, 

The Makefile exists, but it is only partial (no install command).

> otherwise it runs opam-install -i --prefix=out --
> libdir=out/lib/ocaml/site-lib

If I delete the makefile in a snippet, the ocaml-build-system will not
pass "native=true" to the pkg/build.ml script, so it fails. That's why
there's a Makefile.

If I replace my install command with opam-install, I get that opam-
install does not exist (I have opam in inputs and native-inputs). Are
you sure that this program exists? I don't see it in the opam package.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-10 12:41             ` zimoun
@ 2020-12-10 12:49               ` divoplade
  0 siblings, 0 replies; 15+ messages in thread
From: divoplade @ 2020-12-10 12:49 UTC (permalink / raw)
  To: zimoun, Julien Lepiller; +Cc: 45133

Le jeudi 10 décembre 2020 à 13:41 +0100, zimoun a écrit :
> Therefore, instead of patching the Makefile, why not simple try to
> remove it see what happens? :-)

I tried to explain that in my previous email, if it's not clear please
excuse my english skills ^^ the build fails because pkg/build.ml needs
to be called with arguments (native=true or false) that ocaml-build-
system ignores.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-10 12:42             ` divoplade
@ 2020-12-10 13:53               ` Julien Lepiller
  2020-12-10 14:12                 ` divoplade
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Lepiller @ 2020-12-10 13:53 UTC (permalink / raw)
  To: divoplade, zimoun; +Cc: 45133



Le 10 décembre 2020 07:42:19 GMT-05:00, divoplade <d@divoplade.fr> a écrit :
>Hello,
>
>Le mercredi 09 décembre 2020 à 14:12 -0500, Julien Lepiller a écrit :
>> The ocaml-build-system will use the Makefile if it exists, 
>
>The Makefile exists, but it is only partial (no install command).
>
>> otherwise it runs opam-install -i --prefix=out --
>> libdir=out/lib/ocaml/site-lib
>
>If I delete the makefile in a snippet, the ocaml-build-system will not
>pass "native=true" to the pkg/build.ml script, so it fails. That's why
>there's a Makefile.
>
>If I replace my install command with opam-install, I get that opam-
>install does not exist (I have opam in inputs and native-inputs). Are
>you sure that this program exists? I don't see it in the opam package.

Sorry, opam-installer.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-10 13:53               ` Julien Lepiller
@ 2020-12-10 14:12                 ` divoplade
  2020-12-10 14:43                   ` zimoun
  0 siblings, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-10 14:12 UTC (permalink / raw)
  To: Julien Lepiller, zimoun; +Cc: 45133

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Le jeudi 10 décembre 2020 à 08:53 -0500, Julien Lepiller a écrit :
> > If I delete the makefile in a snippet, the ocaml-build-system will
> > not
> > pass "native=true" to the pkg/build.ml script, so it fails. That's
> > why
> > there's a Makefile.
> > 
> > If I replace my install command with opam-install, I get that opam-
> > install does not exist (I have opam in inputs and native-inputs).
> > Are
> > you sure that this program exists? I don't see it in the opam
> > package.
> 
> Sorry, opam-installer.

The solution was to delete the Makefile just before the install phase
^^

I've tried to reproduce the changes of simon but I'm not sure I
reproduced the indentation correctly (it's different from what
etc/indent.el does, but a lot of ocaml packages are not indented
according to that script).

So the last point is about url-fetch vs git-fetch: why do you want to
use git-fetch?

[-- Attachment #2: 0001-gnu-add-ocaml-reactivedata.patch --]
[-- Type: text/x-patch, Size: 2257 bytes --]

From 6b4627f6d40b61b60788480e353a4592542684a4 Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Thu, 10 Dec 2020 15:06:50 +0100
Subject: [PATCH] gnu: add ocaml-reactivedata

	* ocaml.scm (ocaml-reactivedata): add ocaml-reactivedata
---
 gnu/packages/ocaml.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2bfda7307e..4cd1e05464 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5859,3 +5859,44 @@ LablGL), gnomecanvas, gnomeui, gtksourceview, gtkspell, libglade (and it can
 generate OCaml code from .glade files), libpanel, librsvg and quartz.")
     ;; Version 2 only, with linking exception.
     (license license:lgpl2.0)))
+
+(define-public ocaml-reactivedata
+  ;; Future releases will use dune.
+  (package
+    (name "ocaml-reactivedata")
+    (version "0.2.2")
+    (source (origin
+              (method url-fetch)
+              (uri "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz")
+              (sha256
+               (base32
+                "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng"))))
+    (arguments
+     `(#:phases
+       (modify-phases
+           %standard-phases
+         (delete 'configure)
+         (add-before 'build 'fix-deprecated
+           (lambda _
+             (substitute*
+                 "src/reactiveData.ml"
+               (("Pervasives.compare") "compare"))
+             #t))
+         (add-before 'install 'forget-makefile
+           (lambda _
+             (delete-file "Makefile")
+             #t)))))
+    (build-system ocaml-build-system)
+    (native-inputs
+     `(("ocamlbuild" ,ocamlbuild)
+       ("opam" ,opam)))
+    (propagated-inputs
+     `(("ocaml-react" ,ocaml-react)))
+    (home-page "https://github.com/ocsigen/reactiveData")
+    (synopsis "Declarative events and signals for OCaml")
+    (description
+     "React is an OCaml module for functional reactive programming (FRP). It
+provides support to program with time varying values : declarative events and
+ signals. React doesn't define any primitive event or signal, it lets the
+client chooses the concrete timeline.")
+    (license license:lgpl2.1+)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-10 14:12                 ` divoplade
@ 2020-12-10 14:43                   ` zimoun
  2020-12-10 14:57                     ` divoplade
  0 siblings, 1 reply; 15+ messages in thread
From: zimoun @ 2020-12-10 14:43 UTC (permalink / raw)
  To: divoplade, Julien Lepiller; +Cc: 45133

Hi,

On Thu, 10 Dec 2020 at 15:12, divoplade <d@divoplade.fr> wrote:

> The solution was to delete the Makefile just before the install phase

Cool!  That’s what I proposed, sorry if I have not been clear. :-)


> I've tried to reproduce the changes of simon but I'm not sure I
> reproduced the indentation correctly (it's different from what
> etc/indent.el does, but a lot of ocaml packages are not indented
> according to that script).

Ahah!  Let use the one of etc/indent.el for the ocaml-reactivedata and
see the other ones later.


> So the last point is about url-fetch vs git-fetch: why do you want to
> use git-fetch?

Well, because OCaml packages currently uses more git-fetch than url-fetch:

--8<---------------cut here---------------start------------->8---
$ cat gnu/packages/ocaml.scm | grep url-fetch | wc -l
69

$ cat gnu/packages/ocaml.scm | grep git-fetch | wc -l
91
--8<---------------cut here---------------end--------------->8---

It is a matter of taste.  You can read the thread starting here:

<https://yhetil.org/guix-devel/CAJ3okZ0v3VvmT=eWAVeAQoFqZh4L3H4tUkEJn1-5EXcJgRB_tQ@mail.gmail.com>

The main advantages of git-fetch over url-fetch are, IMHO:

 - lint saves to SWH; no SWH fallback with url-fetch
 - easy to try any other commit (--with-commit)
 - with specified commit–as it is here– avoid the in-place upstream replacement annoyance

I was just sharing my opinion reading your patch after questions on IRC,
and I have no strong opinions since Julien is the one who will review
and push it. :-)

All the best,
simon





^ permalink raw reply	[flat|nested] 15+ messages in thread

* [bug#45133] Add ocaml reactiveData
  2020-12-10 14:43                   ` zimoun
@ 2020-12-10 14:57                     ` divoplade
  2020-12-15 14:49                       ` bug#45133: " Julien Lepiller
  0 siblings, 1 reply; 15+ messages in thread
From: divoplade @ 2020-12-10 14:57 UTC (permalink / raw)
  To: zimoun, Julien Lepiller; +Cc: 45133

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

Le jeudi 10 décembre 2020 à 15:43 +0100, zimoun a écrit :
> > I've tried to reproduce the changes of simon but I'm not sure I
> > reproduced the indentation correctly (it's different from what
> > etc/indent.el does, but a lot of ocaml packages are not indented
> > according to that script).
> 
> Ahah!  Let use the one of etc/indent.el for the ocaml-reactivedata
> and
> see the other ones later.

Weird, this indentation is still correct. Maybe etc/indent.el fails to
convert tabs? Anyway.

> It is a matter of taste.  You can read the thread starting here:
> 
> <
> https://yhetil.org/guix-devel/CAJ3okZ0v3VvmT=eWAVeAQoFqZh4L3H4tUkEJn1-5EXcJgRB_tQ@mail.gmail.com
> >
> 
> The main advantages of git-fetch over url-fetch are, IMHO:
> 
>  - lint saves to SWH; no SWH fallback with url-fetch
>  - easy to try any other commit (--with-commit)
>  - with specified commit–as it is here– avoid the in-place upstream
> replacement annoyance

I'm convinced, although we should keep in mind that future commits use
dune as a build system, so we wont be able to explore the future that
easily.

[-- Attachment #2: 0001-gnu-add-ocaml-reactivedata.patch --]
[-- Type: text/x-patch, Size: 2318 bytes --]

From 581f992d1e3172f39088913270b0f4ce314dbfad Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Thu, 10 Dec 2020 15:06:50 +0100
Subject: [PATCH] gnu: add ocaml-reactivedata

	* ocaml.scm (ocaml-reactivedata): add ocaml-reactivedata
---
 gnu/packages/ocaml.scm | 43 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2bfda7307e..fac4e31ce5 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5859,3 +5859,46 @@ LablGL), gnomecanvas, gnomeui, gtksourceview, gtkspell, libglade (and it can
 generate OCaml code from .glade files), libpanel, librsvg and quartz.")
     ;; Version 2 only, with linking exception.
     (license license:lgpl2.0)))
+
+(define-public ocaml-reactivedata
+  ;; Future releases will use dune.
+  (package
+    (name "ocaml-reactivedata")
+    (version "0.2.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ocsigen/reactiveData")
+                    (commit version)))
+              (sha256
+               (base32
+                "0l5z0fsckqkywjbn2nwy3s55h85yx8scc4hq9qzr9ig3hrq1mfb0"))))
+    (arguments
+     `(#:phases
+       (modify-phases
+           %standard-phases
+         (delete 'configure)
+         (add-before 'build 'fix-deprecated
+           (lambda _
+             (substitute*
+                 "src/reactiveData.ml"
+               (("Pervasives.compare") "compare"))
+             #t))
+         (add-before 'install 'forget-makefile
+           (lambda _
+             (delete-file "Makefile")
+             #t)))))
+    (build-system ocaml-build-system)
+    (native-inputs
+     `(("ocamlbuild" ,ocamlbuild)
+       ("opam" ,opam)))
+    (propagated-inputs
+     `(("ocaml-react" ,ocaml-react)))
+    (home-page "https://github.com/ocsigen/reactiveData")
+    (synopsis "Declarative events and signals for OCaml")
+    (description
+     "React is an OCaml module for functional reactive programming (FRP). It
+provides support to program with time varying values : declarative events and
+ signals. React doesn't define any primitive event or signal, it lets the
+client chooses the concrete timeline.")
+    (license license:lgpl2.1+)))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#45133: Add ocaml reactiveData
  2020-12-10 14:57                     ` divoplade
@ 2020-12-15 14:49                       ` Julien Lepiller
  0 siblings, 0 replies; 15+ messages in thread
From: Julien Lepiller @ 2020-12-15 14:49 UTC (permalink / raw)
  To: divoplade; +Cc: 45133-done

Pushed as 190187326ad7516dd6728eed7bb6ef2d4f92897a.

I made a small number of changes to your patch:

In the commit message, added capitalization (add -> Add) and full
stops, removed spaces at the beginning of the `*` line.

In the patch, added a copyright line for you, added a comment to the
phase where we delete the Makefile, fixed the description (guix lint
should have told you so), and added an upstream-name property so guix
refresh knows where to look for newer versions. In general, it's not
needed because guix-name->opam-name works well, but here we lost
capitalization, so we need to explicitely tell it which name it is.

Thank you!




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-12-15 14:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 14:58 [bug#45133] Add ocaml reactiveData divoplade
2020-12-09 15:40 ` Julien Lepiller
2020-12-09 17:03   ` divoplade
2020-12-09 17:59     ` zimoun
2020-12-09 18:05       ` divoplade
2020-12-09 18:35         ` zimoun
2020-12-09 19:12           ` Julien Lepiller
2020-12-10 12:41             ` zimoun
2020-12-10 12:49               ` divoplade
2020-12-10 12:42             ` divoplade
2020-12-10 13:53               ` Julien Lepiller
2020-12-10 14:12                 ` divoplade
2020-12-10 14:43                   ` zimoun
2020-12-10 14:57                     ` divoplade
2020-12-15 14:49                       ` bug#45133: " Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).