Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 2018 10:31:03 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: Package depending on any one of multiple FLAVORS
Message-ID:  <80f97518-b6db-3cbe-b426-1356e2a196eb@FreeBSD.org>
In-Reply-To: <a68dd627-9ead-67db-411e-d3686bb1e250@weboutsourcing.cz>
References:  <a68dd627-9ead-67db-411e-d3686bb1e250@weboutsourcing.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--HSuD5kGoYUWtchvlgA28pAcDeAasNJRsm
Content-Type: multipart/mixed; boundary="sVlp5daUctBiHQE3OnXY2AU4Cw1FDTZB0";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
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: <a68dd627-9ead-67db-411e-d3686bb1e250@weboutsourcing.cz>
In-Reply-To: <a68dd627-9ead-67db-411e-d3686bb1e250@weboutsourcing.cz>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80f97518-b6db-3cbe-b426-1356e2a196eb>