[opam-devel] [MirageOS-devel] Managing $PKG_CONFIG_PATH in opam

Tim Cuthbertson tim at gfxmonk.net
Tue Sep 15 12:50:11 BST 2015


On Tue, Sep 15, 2015 at 12:08 PM, Louis Gesbert
<louis.gesbert at ocamlpro.com> wrote:
>
>> I think we could definitely use an answer to pkg-config management,
>> but not one that's entwined into the core of OPAM itself. If something
>> could be figured out that fits in with the compilers-as-packages
>> feature so that packages could extend the environment, this would
>> make cross-OS portability much easier.
>
> I don't want to promise too much, as the design is mostly unwritten yet, but that's part of my plans.
> Note that compiler descriptions already have an `env:` field:
>
>     env: [[CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"]]
>
> that propagates to the user environment (i.e. `opam config env`)
>
> We also already have some specific operators to dictate environment variable updates, documented at http://opam.ocaml.org/doc/Manual.html#Environmentupdates

I'm not quite clear on what's done here and what remains - it sounds
like this already works for compilers, and you're considering adding
it for packages too? If that's true, then that sounds great, as then
all packages providing .pc files could depend on some `pkgconfig`
opampackage which defines:

env: [[PKG_CONFIG_PATH += "%{lib}%"]]

And hopefully some way of dealing with the default pkg-config, for
when $PKG_CONFIG_PATH is not set. It sounds like := will be able to
cover that, but the exact syntax is not obvious to me from those docs.

Cheers,
 - Tim.


More information about the opam-devel mailing list