caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: OCaml Mailing List <caml-list@inria.fr>,
	pgocaml-general <pgocaml-general@lists.forge.ocamlcore.org>
Subject: Re: [Caml-list] Conditional BuildDepends in OASIS
Date: Thu, 25 Oct 2012 13:12:52 -0700	[thread overview]
Message-ID: <58E915E9-0BD4-4F0B-9581-B446C93A4EB8@recoil.org> (raw)
In-Reply-To: <1351173429.15638.YahooMailNeo@web111503.mail.gq1.yahoo.com>

The Cohttp library generates sub-libraries which can be conditional
based on a flag (which has a portable functorised core, and then an
Async, Mirage or Lwt instance depending on what's available)
https://github.com/avsm/ocaml-cohttp/blob/master/_oasis

However, your use case seems a little different, as I presume the
external interface of pgocaml doesn't vary by your choice of Extlib
or Batteries?

Despite this, it might be easier just to define a "pgocaml.batteries"
and "pgocaml.extlib" and leave the choice with the user as to which
one they would like to select.  You can make the dependency optional
at compile time so the package doesn't generated; e.g.

Library cohttp_lwt_unix
  Build$: flag(lwt)
  Install$: flag(lwt)
  Path: lwt
  Findlibname: lwt
  FindlibParent: cohttp
  BuildDepends: lwt.unix, uri, cohttp, lwt.ssl, lwt.syntax
  Modules: Cohttp_lwt_unix, (etc...)


-anil

On 25 Oct 2012, at 06:57, Dario Teixeira <darioteixeira@yahoo.com> wrote:

> Hi,
> 
> I'm in the process of oasifying PG'OCaml, and I've hit a snag.
> By default PG'OCaml depends on ExtLib, but it's possible to
> use Batteries instead.  Below is a fragment of my (naïve) first
> attempt at telling OASIS about this configuration option:
> 
> 
> Flag "use_batteries"
>   Description: Use Batteries instead of ExtLib
>   Default: false
> 
> Library "pgocaml"
>   Path:                 src
>   Modules:              PGOCaml
>   BuildTools:           ocamlbuild, camlp4
>   BuildDepends:         calendar
>   if flag(use_batteries)
>     BuildDepends+:      batteries
>     ByteOpt+:           -ppopt -DUSE_BATTERIES
>     NativeOpt+:         -ppopt -DUSE_BATTERIES
>   else
>     BuildDepends+:      extlib
> 
> The problem is that OASIS complains about BuildDepends being
> 
> placed inside a conditional.  Is this an oversight, or are there good
> reasons (and hopefully a standard workaround) for this limitation?
> 
> Thanks in advance!
> Cheers,
> Dario Teixeira
> 
> 
> -- 
> 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


  reply	other threads:[~2012-10-25 20:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 13:57 Dario Teixeira
2012-10-25 20:12 ` Anil Madhavapeddy [this message]
2012-10-26 17:56   ` Dario Teixeira
2012-10-26 21:34     ` Anil Madhavapeddy
2012-10-30 22:57     ` [Caml-list] " Sylvain Le Gall
2012-11-01 15:18       ` Dario Teixeira
2012-11-02  0:56         ` Anil Madhavapeddy
2012-11-02 18:08           ` Dario Teixeira

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=58E915E9-0BD4-4F0B-9581-B446C93A4EB8@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=darioteixeira@yahoo.com \
    --cc=pgocaml-general@lists.forge.ocamlcore.org \
    /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).