[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using graphivz's bindings

On Mon, Sep 10, 2007 at 11:48:21AM +0200, Cyril Brulebois wrote:
> graphviz ships with a certain number of bindings (thanks to swig), but
> the ocaml one isn't documented (see libgv-$lang packages' gv_$lang.3
> manpage). Could someone please explain how one is supposed to load a .so
> extension, and eventually check libgv-ocaml is working OK, so that I can
> document it and push it upstream? I'd like to get that done before
> doing a sourceful upload to solve #441494.

Some premises before answering. OCaml executables come in 2 flavours:
native code executables (i.e. standard ELF) and bytecode executables to
be run by an interpreter.

Native code executables are usually static linked and bindings to C
libraries are statically linked in as well (of course the bound library
is not). .so come into play when a bytecode executable uses a binding to
a C library; the interpreter upon loading the bytecode will load
automatically the .so (a reference to it is embedded in the executable
file together with the ocaml bytecode).  So there is no need to document
how the .so should be loaded, since it is transparent.

On the other hand, to develop an OCaml application which will use at
runtime the .so one needs the -dev part of an OCaml library. Such
libraries usually come as directories /usr/lib/ocaml/*/FOO containing
files like .cmi, .cma, .cmo and stuff like that.

AFAICT from my diagnostic below you are now mixing inside libgv-ocaml
both kind of stuff: the .so and the development files

  zack@aquarium:/tmp$ dpkg -c libgv-ocaml_2.12-4_i386.deb |grep -v usr/share
  drwxr-xr-x root/root         0 2007-08-24 03:33 ./
  drwxr-xr-x root/root         0 2007-08-24 03:33 ./usr/
  drwxr-xr-x root/root         0 2007-08-24 03:33 ./usr/lib/
  drwxr-xr-x root/root         0 2007-08-24 03:33 ./usr/lib/graphviz/
  drwxr-xr-x root/root         0 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/
  -rw-r--r-- root/root     22672 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/gv.ml
  -rw-r--r-- root/root      3015 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/gv.mli
  -rw-r--r-- root/root     80580 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/libgv_ocaml.so.0.0.0
  -rw-r--r-- root/root      1003 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/libgv_ocaml.la
  lrwxrwxrwx root/root         0 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/libgv_ocaml.so -> libgv_ocaml.so.0.0.0
  lrwxrwxrwx root/root         0 2007-08-24 03:33 ./usr/lib/graphviz/ocaml/libgv_ocaml.so.0 -> libgv_ocaml.so.0.0.0

You should create 2 packages: "libgv-ocaml" should contain only the .so,
but should ship it under /usr/lib/ocaml/3.10/stublibs/; the other (a new
one) "libgv-ocaml-dev" should contain the compiled version of gv.ml{,i}
and ship it under /usr/lib/ocaml/3.10/graphviz/.  More details on how to
do that can be found in the policy.

If you are maintaining graphviz collaboratively on some repository I
guess we can find some of us willing to do the work directly on the
graphviz package. Just let us know.


Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48)  Zack: e la demo dema ?    /\    All one has to do is hit the
(15:57:15)  Bac: no, la demo scema    \/    right keys at the right time

Attachment: signature.asc
Description: Digital signature

Reply to: