Page MenuHomeFreeBSD

PHP_FLAVORS
AbandonedPublic

Authored by tz on Dec 8 2017, 10:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 12:16 PM
Unknown Object (File)
Feb 27 2024, 9:00 AM
Unknown Object (File)
Jan 6 2024, 8:52 AM
Unknown Object (File)
Jan 1 2024, 7:27 AM
Unknown Object (File)
Sep 22 2023, 7:07 PM
Unknown Object (File)
Sep 6 2023, 9:56 AM
Unknown Object (File)
Aug 24 2023, 1:45 AM
Unknown Object (File)
Aug 2 2023, 3:47 AM
Subscribers

Details

Reviewers
None
Group Reviewers
portmgr
Summary

I want to realize a shortcut for all the PHP software and came up with the idea of the variable PHP_FLAVORS.

The idea is, that the maintainer get set a list of supported PHP versions in PHP_FLAVORS and the Uses/php.mk will do the rest. The "rest" is setting PHP_VER, PKGNAMEPREFIX and IGNORE_WITH_PHP accordingly to the selected FLAVOR.

I came up with the attached draft. Its just a guess since i'm not very experienced with the framework. While there are no syntax errors left, it doesn't work like wanted. :D

An example with "make FLAVOR=56 install" compiles, pulls in the correct PHP version but in installation stage it errors out with:
pkg-static: manifest parsing-error: error while parsing <unknown>: line: 1, column 8 - 'delimiter is missing', character: 'p'

So i request some help and feedback to the idea. Thanks

Test Plan

Add to an PHP-port the following line before .include <bsd.port.mk>:
PHP_FLAVORS= 56 70 71 72

Than install the port with for example:
make FLAVOR=70 install

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bapt added inline comments.
Mk/Uses/php.mk
447

This can be replaced by:

.if ! ${ALLOWED_PHP_FLAVORS:M${FLAVOR}}
.    error "Flavor $FLAVOR is not in list of allowed flavors $ALLOWED_PHP_FLAVORS"
.endif
457

This can be replaced with

IGNORE_WITH_PHP=${ALLOWED_PHP_FLAVORS:N${FLAVOR}}

I think you are doing the wrong way. A port should say USES=php:flavors (for example) and set IGNORE_WITH_PHP if applicable, and the framework should generate the FLAVORS list accordingly.

Mk/Uses/php.mk
432

The flavors should include php, like the python ones are py27/py34/...

Or this should be called SUPPORTED_PHP_VERSIONS or something.

445

NEVER, EVER, EVER, USE .error

452–455

This looks like it should be the other way around. Ports set IGNORE_WITH_PHP and the framework only generates the flavors the port supports.