caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: mads379@gmail.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Creating an OPAM package that wraps c functions that can be used in a non-custom utop
Date: Fri, 21 Feb 2014 12:11:18 +0100	[thread overview]
Message-ID: <1BFC6E68C5814BADBDE735FACE53E815@erratique.ch> (raw)
In-Reply-To: <sympa.1392979560.16254.260@inria.fr>

Le vendredi, 21 février 2014 à 11:46, mads379@gmail.com a écrit :
> The next thing I want to do is create an OPAM package for it that my co-
> workers and I can use. My question is, will I be able to create the package in
> such a way that the library can be loaded into utop using topfind so we don't
> have to build a custom top-level in the projects that use this library?

Yes.

> If it is possible, do you have any pointers to where I might find some
> information about how to do it?

First for generating the correct artefacts with ocamlbuild you can refer to these instructions:

    https://github.com/ocamllabs/ocaml-ctypes/issues/51#issuecomment-30729675

It uses ctypes so the stub C files is empty but ignore that, it also uses pkg-config for getting the cflags but you should be able to read through and simplify the myocamlbuild.ml if you don't need that.  

For the opam package use or generate a .install file at the toplevel of your distribution that will more or less look like this [1].

Feel free to ask further questions if you need to.  

Best,

Daniel

[1]
lib: [
"_build/META" {"META"}
"_build/geolocalisation.mli" {"geolocalisation.mli"}
"?_build/geolocalisation.cmti" {"geolocalisation.cmti"}
"_build/geolocalisation.cmi" {"geolocalisation.cmi"}
"_build/geolocalisation.cmx" {"geolocalisation.cmx"}
"_build/geolocalisation.cma" {"geolocalisation.cma"}
"_build/geolocalisation.a" {"geolocalisation.a"}
"_build/geolocalisation.cmxa" {"geolocalisation.cmxa"}
"_build/geolocalisation.cmxs" {"geolocalisation.cmxs"}
]
stublibs: [
"_build/dllgeolocalisation.so" {"dllgeolocalisation.so"}
]


  reply	other threads:[~2014-02-21 11:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 10:46 mads379
2014-02-21 11:11 ` Daniel Bünzli [this message]
2014-02-26 21:49   ` Mads Hartmann Jensen
2014-02-26 22:33     ` Daniel Bünzli
2014-02-26 22:50     ` 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=1BFC6E68C5814BADBDE735FACE53E815@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=mads379@gmail.com \
    /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).