caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Florent Monnier <monnier.florent@gmail.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: caml list <caml-list@inria.fr>
Subject: Re: [Caml-list] SDL2 bindings, testers and feedback welcome
Date: Thu, 19 Dec 2013 06:20:45 +0100	[thread overview]
Message-ID: <CAE1DttAreRmH+18o4K27x37Ao+oCQ0X96+C+Z0Cry45BEwaPqg@mail.gmail.com> (raw)
In-Reply-To: <4DDEBB7487B641C0834F09D522EA9918@erratique.ch>

2013/12/17, Daniel Bünzli wrote:
> Hello,
Hi again,

> I have written thin bindings to SDL 2 using ocaml-ctypes. The binding
> is finished but should be considered unstable: it was not thoroughly
> tested and may still change as it has not been *used* yet. The purpose
> of this unstable release is to:
>
> 1) Iron out the install procedure and test on a variety of platforms.

and your "README.md" file contains:

> Installation
[...]
> If you don't use `opam` consult the [`opam`](opam) file for
> build instructions and a complete specification of the dependencies.

$ ./pkg/pkg-git
$ ./pkg/build true
ocamlfind ocamlopt unix.cmxa -I /usr/lib/ocaml/ocamlbuild
/usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml
/usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamlfind ocamldep -package ctypes -modules src/tsdl.mli > src/tsdl.mli.depends
+ ocamlfind ocamldep -package ctypes -modules src/tsdl.mli >
src/tsdl.mli.depends
ocamlfind: Package `ctypes' not found
Command exited with code 2.

In your README file there is a section contains a section
"Installation" and the dependencies are listed there but in the first
paragraph that should be the introduciton of what is the project.
I would suggest to migrate the dependencies listing into either the
"Installation" paragraph or  into a new section called "Dependencies".

Another small detail is that for people getting components through
packages, the "Installation" paragraph is usually not usefull. At the
Mageia project of software distribution, it is recommanded that when
the compilation/installation are provided in a separated file than the
README file, to not provide it. So if the compilation / installation
informations was in an "INSTALL.txt" file then the Mageia users would
escape from how such a piece of software component is compiled,
installed (and optionally packaged, but this is another story).

Another very small detail is that in the "README.md" file it is written:

> ## Installation
[...]
> If you don't use `opam` consult the [`opam`](opam) file for
> build instructions and a complete specification of the dependencies.

so I opened the "opam" file and found these build instructions:

> build:
> [
>   ["./pkg/pkg-git" ]
>   ["./pkg/build" "true" ]
> ]

i then half blindly trusted these commands:

./pkg/pkg-git
./pkg/build true

which did "compiled" the lib but not "installed" it (the poor joke
that i'm attempting to make is that the paragraph is called
"Installation", and that following it doesn't lead me to a point where
I get something installed.)

So if some early beginners are reading this email, installation can be
achieved in this following way:

after the compilation step done by:
./pkg/pkg-git
./pkg/build true

Then go in the build directory:
_build/src/

Log into admin user, for those using the ocamlfind installer:
ocamlfind install tsdl ../pkg/META *.a *.cm[iatx] *.cmx[as] *.cmti *.mli *.so

For people not using ocamlfind:
OCAMLDIR=`ocamlc -where`
DESTDIR="$OCAMLDIR/tsdl"
mkdir $DESTDIR
cp *.a *.cm[iatx] *.cmx[as] *.cmti *.mli *.so $DESTDIR/

Then I'm able to run the samples in the test directory:

ocaml unix.cma bigarray.cma -I +ctypes ctypes.cma
ctypes-foreign-base.cma ctypes-foreign-unthreaded.cma -I +tsdl
tsdl.cma tsdl.cma min.ml

min.ml produces the expected result (on mageia linux) (by expected I
mean the same than minc.c)

ocamlc -c -I +tsdl fmts.ml
ocaml unix.cma bigarray.cma -I +ctypes ctypes.cma
ctypes-foreign-base.cma ctypes-foreign-unthreaded.cma -I +tsdl
tsdl.cma tsdl.cma fmts.cmo sdlevents.ml

while running sdlevents.ml I can see logs in the console about key
strokes events and mouse events, but nothing for the joypad.

When I'm launching an equivalent example through another project that
also relays sdl2 function calls from ocaml:

https://github.com/blue-prawn/OCamlSDL2/blob/master/examples/ex_event.ml

https://github.com/blue-prawn/OCamlSDL2/blob/1c9608cd4b473e8b7e60ada1fa1402c0504e56c2/examples/ex_event.ml

I can see the joypad events correctly.

-- 
Florent

  parent reply	other threads:[~2013-12-19  5:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  6:11 Daniel Bünzli
2013-12-17  7:02 ` Anthony Tavener
2013-12-17 14:17 ` Florent Monnier
2013-12-17 15:14   ` Daniel Bünzli
2013-12-18  6:54   ` Erkki Seppala
2013-12-18  8:05     ` Anthony Tavener
2013-12-18  9:24       ` Daniel Bünzli
2013-12-18  8:18     ` Florent Monnier
2013-12-22 10:01       ` Kakadu
2013-12-30 13:28         ` Vu Ngoc San
2013-12-17 17:05 ` Ashish Agarwal
2013-12-17 17:47   ` Daniel Bünzli
2013-12-17 18:57     ` Ashish Agarwal
2013-12-17 19:45       ` Anthony Tavener
2013-12-18 15:40         ` Ashish Agarwal
2013-12-18 18:02           ` Yotam Barnoy
2013-12-18 19:53             ` Daniel Bünzli
2013-12-18 22:29               ` Ashish Agarwal
2013-12-18 22:45                 ` Daniel Bünzli
2013-12-17 20:26       ` Daniel Bünzli
2013-12-18  1:13         ` Francois Berenger
2013-12-18  6:44           ` Erkki Seppala
2013-12-18  9:21           ` Daniel Bünzli
2013-12-19  1:11             ` Florent Monnier
2013-12-19  6:39       ` Florent Monnier
2013-12-17 19:29     ` Erkki Seppala
2013-12-19  5:20 ` Florent Monnier [this message]
2013-12-19  5:27   ` Florent Monnier
2013-12-19  7:13   ` Daniel Bünzli
2013-12-19 12:38     ` Florent Monnier
2014-02-12 10:43 ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE1DttAreRmH+18o4K27x37Ao+oCQ0X96+C+Z0Cry45BEwaPqg@mail.gmail.com \
    --to=monnier.florent@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).