diff mbox series

[bug#45133] Add ocaml reactiveData

Message ID 874kkuoo75.fsf@gmail.com
State Accepted
Headers show
Series [bug#45133] Add ocaml reactiveData | expand

Checks

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

Commit Message

Simon Tournier Dec. 9, 2020, 5:59 p.m. UTC
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

Comments

divoplade Dec. 9, 2020, 6:05 p.m. UTC | #1
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.
Simon Tournier Dec. 9, 2020, 6:35 p.m. UTC | #2
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
Julien Lepiller Dec. 9, 2020, 7:12 p.m. UTC | #3
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
Simon Tournier Dec. 10, 2020, 12:41 p.m. UTC | #4
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
divoplade Dec. 10, 2020, 12:42 p.m. UTC | #5
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.
divoplade Dec. 10, 2020, 12:49 p.m. UTC | #6
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.
Julien Lepiller Dec. 10, 2020, 1:53 p.m. UTC | #7
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.
diff mbox series

Patch

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+)))