Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2011 09:23:39 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        =?ISO-8859-1?Q?Be=F1at_Gonzalez_Etxepare?= <bbtruk@users.sourceforge.net>
Cc:        sam@cassiba.com, freebsd-ports@freebsd.org
Subject:   Re: Slave ports
Message-ID:  <4EC8C71B.4070405@infracaninophile.co.uk>
In-Reply-To: <20111119234758.e4a46127.bbtruk@users.sourceforge.net>
References:  <20111108180947.288e9a42.bbtruk@users.sourceforge.net> <4EB9771C.5080006@cassiba.com> <20111119234758.e4a46127.bbtruk@users.sourceforge.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig66B76970DD41A6DEE6305BA5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 19/11/2011 22:47, Be=F1at Gonzalez Etxepare wrote:
> In my case, I need to compile a new port (Double Commander, a file
> manager) which depends in some other totally different port (Lazarus,
> an IDE).
>=20
> With Lazarus you are able to compile applications for the toolkit you
> choose: QT or GTK2. Lazarus itself is compiled using one of them
> (which can be selected using Makefile's options). All programs compiled=

> with Lazarus should use the same toolkit as the IDE. For this, I can
> get the selected option from a configuration file (written by Lazarus
> port) using the !=3D assignment, but it is discouraged. So I need to do=
 it
> some other way.
>=20
> Are slave ports suited for this (getting a chosen option from some
> other port)? or is there some other way to solve this?

The way you'ld use slave ports for this is to create lazarus-qt and
lazarus-gtk2 slave ports which enabled the respective toolkit in each.
Then in your Double Commander port, you could have an OPTION setting to
choose between qt or gtk2 -- depending on the value selected, that would
flip the dependency between lazarus-qt or lazarus-gtk2.

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.

Also, you've got the hassle of coordinating with the lazarus maintainer
to get the required slave ports created.

The other style of dealing with this sort of problem is where there are
several different versions of a common port available -- eg. all of the
apache or mysql or php flavours in the tree.  In this case the response
boils down to having a common Makefile that all concerned ports can
include (eg bsd.apache.mk, bsd.database.mk, ${LOCALBASE}/php.conf)

Hmmm... I can't think of any examples of this being done elsewhere in
the ports tree, so it might not be an approved practice.  However, you
could pull in the OPTIONS settings from the lazarus port:

OPTIONS=3D        DCGTK2    "Use gtk20 interface instead of gtk12"  on \
                DCQT4     "Use qt4 interface" off

=2Eif exists(${PORT_DBDIR}/lazarus/options)
=2Einclude "${PORT_DBDIR}/lazarus/options"
=2Eendif

=2Eif defined(WITH_DCGTK2) && defined(WITH_DCQT4)
IGNORE=3D         Please select only one of the DCQT4 or DCGTK2 options
=2Eendif

=2Eif ( defined(WITH_GTK2) && defined(WITH_DCQT4) ) || \
    ( defined(WITH_QT4) && defined(WITH_DCGTK2) )
IGNORE=3D	Your choice of GTK2 or QT4 options conflicts with the existing
editors/lazarus port"
=2Eendif

Note the use of DCGTK2 as the local choice of option so it doesn't
collide with the option setting from editors/lazarus.  It might be
tempting to just use the OPTIONS result from editors/lazarus directly,
but you can't guarantee that editors/lazarus has been installed at the
point you run this options dialogue, and moreover, if lazarus is
installed from a package, there won't be an options file in any case.

This is all completely untested, and as I said, I can't find any
precedent for doing something like this in the ports: opinions as to
whether it is a good idea or not would be appreciated.

	Cheers,

	Matthew

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


--------------enig66B76970DD41A6DEE6305BA5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7IxyIACgkQ8Mjk52CukIyMMQCfa757U8gt3EYrULEFG8Qjn8EP
kZEAnjB3Kn/qO3CxxSqV4c+2mwLRQQ1W
=MSOe
-----END PGP SIGNATURE-----

--------------enig66B76970DD41A6DEE6305BA5--



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