caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Mads Hartmann Jensen <mhj@issuu.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: Wed, 26 Feb 2014 23:33:23 +0100	[thread overview]
Message-ID: <1293A504B1F543729B76D6716F128155@erratique.ch> (raw)
In-Reply-To: <E67A9E51-8D51-4369-9E57-4E826492569E@gmail.com>



Le mercredi, 26 février 2014 à 22:49, Mads Hartmann Jensen a écrit :

> Thanks for your help so far. I think I've gotten further but I'm not
> quite there yet. I've followed the instructions that were outlined in  
> the ocaml-ctypes issue and I've also created a META and .install file.

First if your opam package name is called ocaml-geoip that file must be called `ocaml-geoip.install` not `.install`. What you need to build is everything you want to install through the .install file. So just make a target `pkg` in your Makefile as follows:

    pkg:
        ocamlbuild -use-ocamlfind tgeoip.{mli,cmi,cmx,cma,a,cmxa,cmxs} dlltgeoip.so META

you may need to add `<src> : include` to your `_tags` file and I'm no longer sure if Makefile supports globbing as above. Verify that after a `make pkg` you have all the build artefacts mentioned in the .install file build at that place.

I don't see your `opam` file (add one at the toplevel of the project, this allows opam to use this opam file when you pin the package which can be useful when you want people to test for fixes and that your deps or build procedure has changed) but the build section should then read:

    build:  
    [
    [ "make" "pkg"]
    ]

That's all, no need to have a `remove` section, since you are using a .install file. After having executed this make invocation, opam will use the file ocaml-geoip.install to copy the files you built at the right places. See the opam developer manual [1] for more information about .install files.  
  
> I tried running `ocamlfind install tgeoip META` to install the package
> but that just copied the meta file to  
> /Users/hartmann/.opam/issuu/lib/tgeoip/META.

If you run ocamlfind by yourself you need to specify each file you want to install (basically those that are in the .install file) so that would be:

ocamlfind install tgeoip META _build/tgeoip.{mli,cmi,cmx,cma,a,cmxa,cmxs} _build/dlltgeoip.so  

See `man ocamlfind`,

Best,

Daniel

[1] https://github.com/OCamlPro/opam/raw/master/doc/dev-manual/dev-manual.pdf

  reply	other threads:[~2014-02-26 22:33 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
2014-02-26 21:49   ` Mads Hartmann Jensen
2014-02-26 22:33     ` Daniel Bünzli [this message]
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=1293A504B1F543729B76D6716F128155@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=mhj@issuu.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).