caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Preparing a project for opam
@ 2017-01-07 23:38 Helmut Brandl
  2017-01-07 23:46 ` Petter A. Urkedal
  2017-01-07 23:46 ` Anton Bachin
  0 siblings, 2 replies; 3+ messages in thread
From: Helmut Brandl @ 2017-01-07 23:38 UTC (permalink / raw)
  To: Caml List

Hello list,

I am trying to prepare my project to being published via opam. I have 
pinned my project to a local version on my harddisk and generated and 
opam file which opam can build successfully.

Now I am struggling with the "install" section of the opam file.

For building I use ocamlbuild which builds a native executable file in 
the source directory (to be precise in the _build subdirectory of the 
source directory). Installing just means copying this executable into a 
directory which is in the search path. I have achieved this by copying 
the executable directly to ".opam/system/bin". However I am not sure if 
this is the recommended way since somebody else might have chosen 
another directory name and path on where to store ".opam".

Is there a portable way to do this? Thanks for any hint.

Regards
Helmut

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Preparing a project for opam
  2017-01-07 23:38 [Caml-list] Preparing a project for opam Helmut Brandl
@ 2017-01-07 23:46 ` Petter A. Urkedal
  2017-01-07 23:46 ` Anton Bachin
  1 sibling, 0 replies; 3+ messages in thread
From: Petter A. Urkedal @ 2017-01-07 23:46 UTC (permalink / raw)
  To: Helmut Brandl; +Cc: Caml List

On 8 January 2017 at 00:38, Helmut Brandl <helmut.brandl@gmx.net> wrote:
> Hello list,
>
> I am trying to prepare my project to being published via opam. I have pinned
> my project to a local version on my harddisk and generated and opam file
> which opam can build successfully.
>
> Now I am struggling with the "install" section of the opam file.
>
> For building I use ocamlbuild which builds a native executable file in the
> source directory (to be precise in the _build subdirectory of the source
> directory). Installing just means copying this executable into a directory
> which is in the search path. I have achieved this by copying the executable
> directly to ".opam/system/bin". However I am not sure if this is the
> recommended way since somebody else might have chosen another directory name
> and path on where to store ".opam".
>
> Is there a portable way to do this? Thanks for any hint.

Yes, take a look at the "package-name.install" section in
http://opam.ocaml.org/doc/Manual.html.  You can then drop the install
section from the opam file, and it also saves you from maintaining a
corresponding removal script, as opam will keep track of what gets
installed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Preparing a project for opam
  2017-01-07 23:38 [Caml-list] Preparing a project for opam Helmut Brandl
  2017-01-07 23:46 ` Petter A. Urkedal
@ 2017-01-07 23:46 ` Anton Bachin
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Bachin @ 2017-01-07 23:46 UTC (permalink / raw)
  To: Helmut Brandl; +Cc: Caml List

Helmut,

When publishing to OPAM, you can create an install file that lists what should be installed. I am linking to the example from Bisect_ppx (the question marks mean “if the file exists,” don’t use them if your file will always be built). Bisect_ppx installs a binary called bisect-ppx-report:

  https://github.com/ocaml/opam-repository/blob/master/packages/bisect_ppx/bisect_ppx.1.2.0/files/bisect_ppx.install

The overall published structure looks like this:

  https://github.com/ocaml/opam-repository/tree/master/packages/bisect_ppx/bisect_ppx.1.2.0

If you are working locally, you can create your .install file next to the opam file.

In general, it is also possible to get various OPAM paths for the current switch:

  opam config var lib
  opam config var doc
  opam config var bin

Best,
Anton

> El ene 7, 2017, a las 17:38, Helmut Brandl <helmut.brandl@gmx.net> escribió:
> 
> Hello list,
> 
> I am trying to prepare my project to being published via opam. I have pinned my project to a local version on my harddisk and generated and opam file which opam can build successfully.
> 
> Now I am struggling with the "install" section of the opam file.
> 
> For building I use ocamlbuild which builds a native executable file in the source directory (to be precise in the _build subdirectory of the source directory). Installing just means copying this executable into a directory which is in the search path. I have achieved this by copying the executable directly to ".opam/system/bin". However I am not sure if this is the recommended way since somebody else might have chosen another directory name and path on where to store ".opam".
> 
> Is there a portable way to do this? Thanks for any hint.
> 
> Regards
> Helmut
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-07 23:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07 23:38 [Caml-list] Preparing a project for opam Helmut Brandl
2017-01-07 23:46 ` Petter A. Urkedal
2017-01-07 23:46 ` Anton Bachin

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