public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* how to use opam for package builds?
@ 2018-08-29 15:47 Andrew Schulman
  2018-08-29 17:19 ` Andy Li
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Schulman @ 2018-08-29 15:47 UTC (permalink / raw)
  To: cygwin-apps

orpie recently changed to an opam-based build system. So I want to use opam
to update it for Cygwin, but I've never used opam before and I have some
questions about how to use it.

The orpie build instructions say just to run "opam install orpie". When I
do that, opam complains that I haven't set it up yet:

    $ opam install orpie
    [ERROR] No OPAM root found at /home/andrew/.opam.
            Please run 'opam init' to initialize the state of OPAM, or
specify '--root'.
            See 'opam init --help' for details.

Now for packaging, what's the right thing to do here? For example I could
create the following install function for Cygport:

src_install()
{
    opam init
    opam install orpie
}

But this has two problems:

(1) I can't get "opam init" to complete. It hangs after "synchronized from
https://opam.ocaml.org", until I interrupt it:

    $ opam init
    Checking for available remotes: rsync and local, git, mercurial.
      - you won't be able to use darcs repositories unless you install the
darcs command on your system.
    
    [WARNING] Recommended external solver aspcud not found.

    =-=- Fetching repository information
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    [default] synchronized from https://opam.ocaml.org
    ### hangs here until I hit ctrl-C: ###
    [ERROR] Initialisation failed
    User interruption
    
    # opam-version    1.2.2
    # os              cygwin
    Cannot remove /home/andrew/.opam (error 255).

(2) Even if I get this to work, I don't think it's the right thing to do
because it's setting up persistent opam configuration in my home directory,
which I don't think is the right place for packaging. Should there be some
global opam configuration, that all packaging scripts that rely on opam
would use? If so, where should that go?

Tnanks,
Andrew

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

* Re: how to use opam for package builds?
  2018-08-29 15:47 how to use opam for package builds? Andrew Schulman
@ 2018-08-29 17:19 ` Andy Li
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Li @ 2018-08-29 17:19 UTC (permalink / raw)
  To: cygwin-apps

Hi,

On Wed, Aug 29, 2018 at 11:47 PM Andrew Schulman <schulman.andrew@epa.gov>
wrote:

> (1) I can't get "opam init" to complete. It hangs after "synchronized from
> https://opam.ocaml.org", until I interrupt it:
>

It should work, just wait a little longer. For me, it took a bit more than
three minutes to complete.
I'm not sure why it is that slow though.


> (2) Even if I get this to work, I don't think it's the right thing to do
> because it's setting up persistent opam configuration in my home directory,
> which I don't think is the right place for packaging. Should there be some
> global opam configuration, that all packaging scripts that rely on opam
> would use? If so, where should that go?


Indeed the proper way is to package each ocaml library as cygwin packages
and then the orpie package just build depends on them instead of calling
opam.
There are several already packaged ocaml libraries. You may study their
cygport files in
https://github.com/cygwinports?utf8=%E2%9C%93&q=ocaml&type=&language=

Hope it helps.

Best,
Andy

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

end of thread, other threads:[~2018-08-29 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 15:47 how to use opam for package builds? Andrew Schulman
2018-08-29 17:19 ` Andy Li

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 read-only IMAP folder(s) and NNTP newsgroup(s).