caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* findlib help: how to specify dependencies against non-findlib packages ?
@ 2006-10-02  9:24 Guillaume Rousse
  2006-10-02 10:33 ` [Caml-list] " Gerd Stolpmann
  0 siblings, 1 reply; 5+ messages in thread
From: Guillaume Rousse @ 2006-10-02  9:24 UTC (permalink / raw)
  To: caml-list

I'm trying to add findlibsupport for camlimages.

It has a dependency on graphics, which is easily handled by adding a
require variable in META file, as graphics provides findlib support.

However, camlimages can also get compiled with either lablgtk or
lablgtk2 support (not both of them, as they have conflicting symbols),
but none of those packages have findlib support. It means I can't
ressort to smart dependency computation. I may eventually use the
linkopts variable to add explicit linking flags (such as -I
place/to/lablgtk2 lablgtk.cma), but this seem to be only possible for
linking, not for compiling, whereas I also need to pass -I
place/to/lablgtk2 option during compilation.

So, is this just not possible at all ?
-- 
Guillaume Rousse
Projet Estime, INRIA
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex - France


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

* Re: [Caml-list] findlib help: how to specify dependencies against non-findlib packages ?
  2006-10-02  9:24 findlib help: how to specify dependencies against non-findlib packages ? Guillaume Rousse
@ 2006-10-02 10:33 ` Gerd Stolpmann
  2006-10-02 13:30   ` Guillaume Rousse
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Stolpmann @ 2006-10-02 10:33 UTC (permalink / raw)
  To: Guillaume Rousse; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

Am Montag, den 02.10.2006, 11:24 +0200 schrieb Guillaume Rousse:
> I'm trying to add findlibsupport for camlimages.
> 
> It has a dependency on graphics, which is easily handled by adding a
> require variable in META file, as graphics provides findlib support.
> 
> However, camlimages can also get compiled with either lablgtk or
> lablgtk2 support (not both of them, as they have conflicting symbols),
> but none of those packages have findlib support. It means I can't
> ressort to smart dependency computation. I may eventually use the
> linkopts variable to add explicit linking flags (such as -I
> place/to/lablgtk2 lablgtk.cma), but this seem to be only possible for
> linking, not for compiling, whereas I also need to pass -I
> place/to/lablgtk2 option during compilation.
> 
> So, is this just not possible at all ?

Of course, it is possible: Just write your own META file for
lablgtk/lablgtk2 - this is what distros like GODI and Debian do. The
META file need not to be in the same directory as the library if you add
a line

directory="/path/where/the/library/really/is"

to the META file, so you can easily unify lablgtk's installation scheme
with the findlib requirements.

For your convenience, I attached the (generated) META file GODI uses for
lablgtk and lablgtk2.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------

[-- Attachment #2: META for lablgtk --]
[-- Type: text/plain, Size: 301 bytes --]

description = "Bindings for gtk"
requires=""
requires(lablGL)="lablGL"
version="1.2.6"
archive(byte)="lablgtk.cma  gtkInit.cmo"
archive(native)="lablgtk.cmxa  gtkInit.cmx"
archive(byte,lablGL)="lablgtk.cma lablgtkgl.cma  gtkInit.cmo"
archive(native,lablGL)="lablgtk.cmxa lablgtkgl.cmxa  gtkInit.cmx"


[-- Attachment #3: META for lablgtk2 --]
[-- Type: text/plain, Size: 823 bytes --]

description = "Bindings for gtk2"
requires=""
requires(lablGL)="lablGL"
version="20051028"
archive(byte)="lablgtk.cma  lablglade.cma lablrsvg.cma lablgnomecanvas.cma lablgnomeui.cma lablpanel.cma gtkInit.cmo"
archive(native)="lablgtk.cmxa  lablglade.cmxa lablrsvg.cmxa lablgnomecanvas.cmxa lablgnomeui.cmxa lablpanel.cmxa gtkInit.cmx"
archive(byte,lablGL)="lablgtk.cma lablgtkgl.cma  lablglade.cma lablrsvg.cma lablgnomecanvas.cma lablgnomeui.cma lablpanel.cma gtkInit.cmo"
archive(native,lablGL)="lablgtk.cmxa lablgtkgl.cmxa  lablglade.cmxa lablrsvg.cmxa lablgnomecanvas.cmxa lablgnomeui.cmxa lablpanel.cmxa gtkInit.cmx"
archive(byte,mt) += "gtkThread.cmo"
archive(native,mt) += "gtkThread.cmx"
archive(byte,lablGL,mt) += "gtkThread.cmo"
archive(native,lablGL,mt) += "gtkThread.cmx"
archive(toploop,mt) += "gtkThInit.cmo"

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

* Re: [Caml-list] findlib help: how to specify dependencies against non-findlib packages ?
  2006-10-02 10:33 ` [Caml-list] " Gerd Stolpmann
@ 2006-10-02 13:30   ` Guillaume Rousse
  2006-10-02 14:52     ` Gerd Stolpmann
  0 siblings, 1 reply; 5+ messages in thread
From: Guillaume Rousse @ 2006-10-02 13:30 UTC (permalink / raw)
  Cc: caml-list

Gerd Stolpmann wrote:
> Am Montag, den 02.10.2006, 11:24 +0200 schrieb Guillaume Rousse:
>> I'm trying to add findlibsupport for camlimages.
>>
>> It has a dependency on graphics, which is easily handled by adding a
>> require variable in META file, as graphics provides findlib support.
>>
>> However, camlimages can also get compiled with either lablgtk or
>> lablgtk2 support (not both of them, as they have conflicting symbols),
>> but none of those packages have findlib support. It means I can't
>> ressort to smart dependency computation. I may eventually use the
>> linkopts variable to add explicit linking flags (such as -I
>> place/to/lablgtk2 lablgtk.cma), but this seem to be only possible for
>> linking, not for compiling, whereas I also need to pass -I
>> place/to/lablgtk2 option during compilation.
>>
>> So, is this just not possible at all ?
> 
> Of course, it is possible: Just write your own META file for
> lablgtk/lablgtk2 - this is what distros like GODI and Debian do. The
> META file need not to be in the same directory as the library if you add
> a line
> 
> directory="/path/where/the/library/really/is"
> 
> to the META file, so you can easily unify lablgtk's installation scheme
> with the findlib requirements.
I'm speaking of incoming camlimages 3.0.0 release, not of camlimages
packages in some distribution. I can't interfere with already existing
lablgtk/lablgtk2 installation, unless there is a way to do it privately
to camlimages itself.

-- 
Guillaume Rousse
Projet Estime, INRIA
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex - France


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

* Re: [Caml-list] findlib help: how to specify dependencies against non-findlib packages ?
  2006-10-02 13:30   ` Guillaume Rousse
@ 2006-10-02 14:52     ` Gerd Stolpmann
  2006-10-02 15:39       ` Guillaume Rousse
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Stolpmann @ 2006-10-02 14:52 UTC (permalink / raw)
  To: Guillaume Rousse; +Cc: caml-list

Am Montag, den 02.10.2006, 15:30 +0200 schrieb Guillaume Rousse:
> Gerd Stolpmann wrote:
> > Am Montag, den 02.10.2006, 11:24 +0200 schrieb Guillaume Rousse:
> >> I'm trying to add findlibsupport for camlimages.
> >>
> >> It has a dependency on graphics, which is easily handled by adding a
> >> require variable in META file, as graphics provides findlib support.
> >>
> >> However, camlimages can also get compiled with either lablgtk or
> >> lablgtk2 support (not both of them, as they have conflicting symbols),
> >> but none of those packages have findlib support. It means I can't
> >> ressort to smart dependency computation. I may eventually use the
> >> linkopts variable to add explicit linking flags (such as -I
> >> place/to/lablgtk2 lablgtk.cma), but this seem to be only possible for
> >> linking, not for compiling, whereas I also need to pass -I
> >> place/to/lablgtk2 option during compilation.
> >>
> >> So, is this just not possible at all ?
> > 
> > Of course, it is possible: ...

> I'm speaking of incoming camlimages 3.0.0 release, not of camlimages
> packages in some distribution. I can't interfere with already existing
> lablgtk/lablgtk2 installation, unless there is a way to do it privately
> to camlimages itself.

Sorry, I misunderstood you.

In general, findlib assumes that prerequisite packages already have
findlib support. There is no clean built-in way to cope with the
situation, simply because if several packages depended on lablgtk and
fixed the missing META file in their own way it would not be possible to
resolve dependencies cleanly anymore.

What you can still do is to define a subpackage
camlimages.lablgtk_substitute (syntax see below) and to depend on this
subpackage if you see that lablgtk is installed without META file
(otherwise just depend on lablgtk). This subpackage contains the
substitute for the missing META file. However, as said this is no really
clean solution but probably the best you can do.

You can define subpackages in META files with this syntax:

<this is the META file for camlimages>
package "lablgtk_substitute" (
  <META directives>
)

The subpackage can then be referred to as camlimages.lablgtk_substitute.
For a complete example see the camlp4 META file coming with findlib. 

As lablgtk is usually installed below the standard library directory,
you can refer to this directory using

directory = "+lablgtk"

Hope this helps. You might also be interested in how GODI generates a
META file for the current version of camlimages (it assumes, however,
that lablgtk is installed _with_ META file):

https://gps.dynxs.de/svn/godi-build/trunk/godi/godi-camlimages/create-META

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


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

* Re: [Caml-list] findlib help: how to specify dependencies against non-findlib packages ?
  2006-10-02 14:52     ` Gerd Stolpmann
@ 2006-10-02 15:39       ` Guillaume Rousse
  0 siblings, 0 replies; 5+ messages in thread
From: Guillaume Rousse @ 2006-10-02 15:39 UTC (permalink / raw)
  Cc: caml-list

Gerd Stolpmann wrote:
> Am Montag, den 02.10.2006, 15:30 +0200 schrieb Guillaume Rousse:
>> Gerd Stolpmann wrote:
>>> Am Montag, den 02.10.2006, 11:24 +0200 schrieb Guillaume Rousse:
>>>> I'm trying to add findlibsupport for camlimages.
>>>>
>>>> It has a dependency on graphics, which is easily handled by adding a
>>>> require variable in META file, as graphics provides findlib support.
>>>>
>>>> However, camlimages can also get compiled with either lablgtk or
>>>> lablgtk2 support (not both of them, as they have conflicting symbols),
>>>> but none of those packages have findlib support. It means I can't
>>>> ressort to smart dependency computation. I may eventually use the
>>>> linkopts variable to add explicit linking flags (such as -I
>>>> place/to/lablgtk2 lablgtk.cma), but this seem to be only possible for
>>>> linking, not for compiling, whereas I also need to pass -I
>>>> place/to/lablgtk2 option during compilation.
>>>>
>>>> So, is this just not possible at all ?
>>> Of course, it is possible: ...
> 
>> I'm speaking of incoming camlimages 3.0.0 release, not of camlimages
>> packages in some distribution. I can't interfere with already existing
>> lablgtk/lablgtk2 installation, unless there is a way to do it privately
>> to camlimages itself.
> 
> Sorry, I misunderstood you.
> 
> In general, findlib assumes that prerequisite packages already have
> findlib support. There is no clean built-in way to cope with the
> situation, simply because if several packages depended on lablgtk and
> fixed the missing META file in their own way it would not be possible to
> resolve dependencies cleanly anymore.
> 
> What you can still do is to define a subpackage
> camlimages.lablgtk_substitute (syntax see below) and to depend on this
> subpackage if you see that lablgtk is installed without META file
> (otherwise just depend on lablgtk). This subpackage contains the
> substitute for the missing META file. However, as said this is no really
> clean solution but probably the best you can do.
The cleaner solution would be to push META support to lablgtk maintainer
directly. Does anyone already tried ?

> You can define subpackages in META files with this syntax:
> 
> <this is the META file for camlimages>
> package "lablgtk_substitute" (
>   <META directives>
> )
> 
> The subpackage can then be referred to as camlimages.lablgtk_substitute.
> For a complete example see the camlp4 META file coming with findlib. 
> 
> As lablgtk is usually installed below the standard library directory,
> you can refer to this directory using
> 
> directory = "+lablgtk"
> 
> Hope this helps.
That was exactly what I needed, thanks. I just have to handle the
conditional META support in lablgtk now.

> You might also be interested in how GODI generates a
> META file for the current version of camlimages (it assumes, however,
> that lablgtk is installed _with_ META file):
> 
> https://gps.dynxs.de/svn/godi-build/trunk/godi/godi-camlimages/create-META
Well, I hope this won't be necessary anymore with next release, if I
understood correctly how to generate it myself.

You're welcome to checkout current CVS version of camlimages to check.
-- 
Guillaume Rousse
Projet Estime, INRIA
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex - France


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

end of thread, other threads:[~2006-10-02 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-02  9:24 findlib help: how to specify dependencies against non-findlib packages ? Guillaume Rousse
2006-10-02 10:33 ` [Caml-list] " Gerd Stolpmann
2006-10-02 13:30   ` Guillaume Rousse
2006-10-02 14:52     ` Gerd Stolpmann
2006-10-02 15:39       ` Guillaume Rousse

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