Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2006 13:46:30 -0500
From:      "Scot Hetzel" <swhetzel@gmail.com>
To:        "John E Hein" <jhein@timing.com>
Cc:        ports@freebsd.org
Subject:   Re: conflicting dependency
Message-ID:  <790a9fff0607201146w377e92f4x798797feff6c8b21@mail.gmail.com>
In-Reply-To: <17598.52872.765184.211253@gromit.timing.com>
References:  <17598.52872.765184.211253@gromit.timing.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7/19/06, John E Hein <jhein@timing.com> wrote:
> Let's say there are two ports A & B.
> They both provide libfoo.so.1 (and so register CONFLICTS with each other).
>
> Now port C wants to use libfoo (and doesn't care if it gets it
> from A or B).
>
> What does port C list in it's LIB_DEPENDS?
>
> What if it lists A and someone installs B... does A get registered as
> the dependency when C is installed even though A is not installed?
>

In the port Cs Makefile, you add:

.if exists(${PREFIX}/bin/file found only in Port B)
PORTA_STAT= OFF
PORTB_STAT= ON
.else
PORTA_STAT= ON
PORTB_STAT= OFF
.endif

OPTIONS = PORTA "Depends on libfoo from port A" ${PORTA_STAT} \
                  PORTB "Depends on libfoo from port B" ${PORTB_STAT}

.if defined(WITH_PORTA) || !defined(WITHOUT_PORTA)
LIB_DEPENDS+= foo.1:${PORTSDIR}/dependancy on Port A
.elif defined(WITH_PORTB)
LIB_DEPENDS+= foo.1:${PORTSDIR}/dependancy on Port B
.else
IGNORE= Must choose either port A or B
.endif

This allows the admin to install either port A or B, and port C will
automatically detect which port is installed, as well as allowing the
admin to choose which to install.

Scot
--
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0607201146w377e92f4x798797feff6c8b21>