Slave ports

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Nov 21 23:17:51 UTC 2011


On 21/11/2011 22:21, Beñat Gonzalez Etxepare wrote:
>> This works, but has an important deficiency:
>> > 
>> >    * If the user already has lazarus (of any variety) installed, that
>> >      would generally fulfil the dependency requirement irrespective
>> >      of which toolkit option was chosen when building Double
>> >      Commander.  Unless there is some sort of detectable filename
>> >      change in lazarus depending on the toolkit, you can't tell the
>> >      difference.

> This part I don't know if I understand correctly... do slave ports act
> as if they were the same port? so although lazarus-qt is listed as
> dependency an installed lazarus-gtk2 fulfills the requirement? In that
> case, using the above mentioned file (lazbuild.cfg) would be enough
> to differentiate them? Or it has to be different in the filename, not
> its contents?

Lets suppose you want the gtk2 version of lazarus, and lets further
suppose that the two slave ports discussed previously have been created.

You would write dependency lines in the port Makefile eg. like this:

BUILD_DEPENDS =	lazarus:${PORTSDIR}/editors/lazarus-gtk2

This says "test and see if there is an executable on $PATH called
'lazarus'.  If not, install the editors/lazarus-gtk2 port.

This is fine if no variant of lazarus is already installed: lazarus-gtk2
will be built and installed and everything is happy.

However, suppose the user had already come along and installed
lazarus-qt4?  What happens then?  Well, lazarus-qt4 also installs a
binary executable called 'lazarus'.  The ports system will find this and
go 'hey, everything I need to build this port is already installed' and
plough heedlessly on with compiling Double Commander.  Eventually either
the compilation will break, or even worse: you'll end up with a Double
Commander installed that falls over when you try and run it.

This only affects building from ports -- if you install a .pkg, then the
dependency checking is done on what other packages are installed.

The fact that the dependency resolution is done by checking on the
existence of an executable means that you aren't tied to installing
everything from ports.  You can in principle compile various components
by hand, and the ports should be able to conform to that.  This is an
example of the unix philosophy of enabling you to do clever things by
not preventing you from doing stupid ones.

	Cheers,

	Matthew

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20111121/6a729826/signature.pgp


More information about the freebsd-ports mailing list