[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: nevermind.Re: how do you specify a minimum lib version? Matthew Seaman Fri Feb 24 06:00:42 2012

On 24/02/2012 12:54, Michael Scheidell wrote:
> On 2/24/12 6:57 AM, Michael Scheidell wrote:
>> it won't take anything like:
>> = boost_serialization>=.4
> I googled.
> all other _DEPENDS uses >=
> LIB_DEPENDS uses .[4-9]
> (i assume .(1[0-9]|[4-9]))

Saying 'all other _DEPENDS' is slightly misleading.  LIB_DEPENDS is
itself conceptually different to all the other
dependencies that are required at a specific stage of building a port
(LIB_DEPENDS is added to both BUILD_DEPENDS and RUN_DEPENDS), and it
also implies a different way of testing that a dependency is fulfilled.

So, there are four different styles for dependency lines:

1)   ${LOCALBASE}/bin/foo:${PORTSDIR}/bar/baz

Says 'unless the file ${LOCALBASE}/bin/foo exists, install the bar/baz
port'  (All dependency variables except LIB_DEPENDS)

2)  foo:${PORTSDIR}/bar/baz

Says 'unless there is an executable program foo on $PATH, install the
bar/baz port' *for anything except LIB_DEPENDS* where it means 'unless
there is a shared library -lfoo listed in the output of 'ldconfig -r',
install the bar/baz port'

3)  foo>=1.0:${PORTSDIR}/bar/baz

Says 'unless a package foo-1.0 (or any higher version) is installed,
install the bar/baz port' (All dependency variables except LIB_DEPENDS)

4) foo.[1-3]:${PORTSDIR}/bar/baz

Says 'unless foo.[1-3] is matched in the output of 'ldconfig -r',
install the bar/baz port' (Only for LIB_DEPENDS)

ie. do: ldconfig -r | grep '-lfoo.[1-3]'

This somewhat irritates my inner pedant, who would prefer it if _DEPENDS
variables referred strictly to the different phases of building and
installing ports, and there was some other syntax to indicate what test
should be done to decide if a dependency had been fulfilled.  Maybe
something like:

   @shlib(foo) or @shlib(foo>=1)

which implies the possibility of adding other sorts of tests, say:


equivalent to testing that

   perl -M'Foo::Bar 1.0' -e ''

exits successfully.  (Meaning you could install modules from CPAN and
have them fulfil versioned dependencies in the ports.)



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: [EMAIL PROTECTED]               Kent, CT11 9PW