From owner-freebsd-ports@freebsd.org Tue Feb 6 10:31:06 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B77EEEC336 for ; Tue, 6 Feb 2018 10:31:06 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C321381ABC for ; Tue, 6 Feb 2018 10:31:05 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:b1f9:b671:5194:b48a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id D45F413A66 for ; Tue, 6 Feb 2018 10:31:04 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/D45F413A66; dkim=none; dkim-atps=neutral Subject: Re: Package depending on any one of multiple FLAVORS To: freebsd-ports@freebsd.org References: From: Matthew Seaman Message-ID: <80f97518-b6db-3cbe-b426-1356e2a196eb@FreeBSD.org> Date: Tue, 6 Feb 2018 10:31:03 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HSuD5kGoYUWtchvlgA28pAcDeAasNJRsm" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 10:31:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HSuD5kGoYUWtchvlgA28pAcDeAasNJRsm Content-Type: multipart/mixed; boundary="sVlp5daUctBiHQE3OnXY2AU4Cw1FDTZB0"; protected-headers="v1" From: Matthew Seaman To: freebsd-ports@freebsd.org Message-ID: <80f97518-b6db-3cbe-b426-1356e2a196eb@FreeBSD.org> Subject: Re: Package depending on any one of multiple FLAVORS References: In-Reply-To: --sVlp5daUctBiHQE3OnXY2AU4Cw1FDTZB0 Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 06/02/2018 09:51, Ondra Knezour wrote: > Hi gang, >=20 > documentation is little sparse yet (found only mention in the Porters > handbook, created PR for "end user" doc) and I am unsure, if we can > handle this. Best way I can describe my question is probably via > examples, so consider following: >=20 > We have multiple PHP versions in ports (php56, php70, php71, php72) > which may get flavored in future. Now there is also some simple PHP > application, let say php-composer, which would work with any of those > PHP runtimes. Can we handle it in some generic way or should one create= > also multiple flavors for given application? >=20 > Another example would be some really simple C program, which can have > any C compiler as build time dependency. Here making multiple flavors > doesn't have any sense, but author knows that any compiler will suffice= =2E > This one is more general, because it is not only about flavors, but may= > lead to something like from [clang4-5, gcc4-6, intel, whatever we have]= > take one, but you got the point. >=20 > Same can be asked probably for all interpreted/scripting languages like= > Ruby and Python and many simple scripts in ports which doesn't have > other dependencies beside those interpreters. Simple Java applications > may also run with all or most available Java ports etc. No, unfortunately at the moment you'ld need to create a different package for each of the different flavours of PHP you wanted to depend on. The good news is that it takes relatively little code in the port's Makefile to do that. Assuming it grows FLAVOR support, the minimum you'll need is eg.: USES+=3D php:7.1+ In many cases where there is an explicit dependency line you need something like: RUN_DEPENDS+=3D ${PHP_PKGNAMEPREFIX}foo>0:something/php-foo@${FLAVOR} (or possibly ...@${PHP_FLAVOR}) This is down to a deficiency in pkg(8) -- it can't handle having a number of alternate packages or ranges of different package versions to fulfil a dependency. The dependencies "baked into" each package are on exactly the dependency package and version used at compilation time. Cheers, Matthew --sVlp5daUctBiHQE3OnXY2AU4Cw1FDTZB0-- --HSuD5kGoYUWtchvlgA28pAcDeAasNJRsm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKoBAEBCgCSFiEEGfFU7L8RLlBUTj8wAFE/EOCp5OcFAlp5g+hfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDE5 RjE1NEVDQkYxMTJFNTA1NDRFM0YzMDAwNTEzRjEwRTBBOUU0RTcUHG1hdHRoZXdA ZnJlZWJzZC5vcmcACgkQAFE/EOCp5OcBxA//b2DLGbGQfiUWtUzoajy+xG41x/xf SYPveIjHJ66H3zsPzBnWOCsgqTkB+7HBQjdvGlMRVi0kuBf8Or+qRDUx1L3Ri7Bh kENREohaQke6Xw/IPDS8o8YxK4KCIou7YXLhP4rvrCq2H2fUiFLwqyAY7yCByyKQ VZwE6DUpAPOektuF26rnvaXPsm0IuWVAHcKHkvdVKXrvNl3p7x3AZNHfT8TmGAC3 ZBO/fDZjS5pEWgBtFfwK3SwMxTljfPYuwA1CN8GyMu12X/cQzMz31MB61pauWD9r Rj1RaOCQ2rtV9OHeiaCkdsgO9DFXTD4pThgkr7wRjktFjxWE7/qATqPF1bMM9HwY 4aPaHG5fV7hyXJ+BQMAyNomgEQA6LtpfYPzbFajZYJ6X9o/0xbkgmRAKMNCofs05 FwpjZTS/asI/N+vYaWqgFM5jni637AiPi4iiiVghVP77kKf19hCkGrOV7I7TwS/D NkyoB6UpM7WmYKPRQtYV5AjkEO9XuY4UwmXhtXwSfWLYVLA18Y5FzGd2lGG3ILYK X+yu41mUjR45VwmZC9aaILOp1Dwxv5EbcuQQdq1qfIBObO39lhXzbyEnK8ovHOCd Rp3NRxP5Y8DsxqJ6HANUgdh0iBUnIk9B3isGOpviOl/8lDGTxmv5+4RSNUbYk+Wb UnXE9SR9xbogghw= =BqfI -----END PGP SIGNATURE----- --HSuD5kGoYUWtchvlgA28pAcDeAasNJRsm--