From owner-freebsd-ports@FreeBSD.ORG Sun Nov 20 09:24:01 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCCAE106566B for ; Sun, 20 Nov 2011 09:24:01 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3fd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE3C8FC19 for ; Sun, 20 Nov 2011 09:24:01 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id pAK9Nl6c052659 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 20 Nov 2011 09:23:47 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: OpenDKIM Filter v2.4.1 smtp.infracaninophile.co.uk pAK9Nl6c052659 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1321781028; bh=3yPk4qwA/MhZ1a4jv9rELzskzpnjnBKxN77kuWAlviM=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=SGz3ckxkq1TFKahkwM9YsvfUzB9uqtBZBma/k0TUDsEwLH4smw/r3Nh68ROFYw8HV CmD4GVx5IBAvWq5UJMJxjkEioUWLujH2ZDe8PIt01wig2QP0n+Tng1jovEAZWdtXBT Rq0exhiWghhiDAG26U7Kkns4t9LSUZ/lEj9PpQ7I= Message-ID: <4EC8C71B.4070405@infracaninophile.co.uk> Date: Sun, 20 Nov 2011 09:23:39 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Be=F1at_Gonzalez_Etxepare?= References: <20111108180947.288e9a42.bbtruk@users.sourceforge.net> <4EB9771C.5080006@cassiba.com> <20111119234758.e4a46127.bbtruk@users.sourceforge.net> In-Reply-To: <20111119234758.e4a46127.bbtruk@users.sourceforge.net> X-Enigmail-Version: 1.3.3 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig66B76970DD41A6DEE6305BA5" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_FAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Cc: sam@cassiba.com, freebsd-ports@freebsd.org Subject: Re: Slave ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 09:24:01 -0000 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--