Project:PHP/Php-ext-source-r3 migration guide

From Gentoo Wiki
Jump to:navigation Jump to:search


The latest revision php-ext-source-r3.eclass of the php-ext-source eclass offer some improvements but requires a few small changes from the previous revision. These changes also affect php-ext-pecl-r3.eclass which inherits php-ext-source-r3.eclass. Changes specific to the latter are mentioned at the end.

EAPI support

The biggest change in the new revision is that only EAPI=6 is supported. To use php-ext-source-r3.eclass, your ebuild will need to be migrated to EAPI=6.

PATCHES array/variable support

Our php-ext-source-r3_src_prepare function now comes with support for the PATCHES array and eapply_user support. All patches in the PATCHES array/variable will be applied to each PHP slot's working directory automatically, and then eapply_user will be called (in the same directory, one per slot).

That means that functions like this:

FILE pecl-gnupg-1.3.6.ebuild
src_prepare() {
	for slot in $(php_get_slots); do
		php_init_slot_env ${slot}
		epatch "${FILESDIR}"/1.3.2/01-large_file_system.patch


are now redundant and can be removed in favor of PATCHES=( "${FILESDIR}"/1.3.2/01-large_file_system.patch ).

Update DOCS variable

In the previous revision, invalid DOCS were silently ignored. In the new revision, it is an error to include non-existent files in DOCS. Ensure that DOCS is accurate for your ebuild before upgrading. Note: the php-ext-pecl-r2.eclass used to install package.xml automatically as part of its DOCS handling. The new revision of that eclass does not; it used the standard einstalldocs list of docs.

Rename my_conf variable

The my_conf variable was being used to pass extra configuration to the build system. That lowercase and un-namespaced variable has been changed to PHP_EXT_ECONF_ARGS. No other changes were made to that aspect of the build system, so a find/replace from my_conf to PHP_EXT_ECONF_ARGS should suffice.

Rename PHPSAPILIST variable

The PHPSAPILIST variable limits the PHP SAPIs for which an extension is built/enabled. The variable name was not namespaced, however, so it has been renamed to PHP_EXT_SAPIS. A simple find/replace from PHPSAPILIST to PHP_EXT_SAPIS should suffice.

Internal functions

The php-ext-source-r3_addextension and php-ext-source-r3_addtoinifile functions have been marked @INTERNAL. They are not used anywhere in the tree, so please let us know if you have a use case for these in an ebuild.

Changes for php-ext-pecl-r3.eclass

These changes apply only to the PECL extension eclass.

PHP_EXT_PECL_FILENAME variable now requires a filename

In the previous revision, the PHP_EXT_PECL_FILENAME variable was supposed to be set to something like "imagick" if you wanted SRC_URI to point to "imagick-3.4.1.tgz". Now, the PHP_EXT_PECL_FILENAME variable should contain the actual full filename "imagick-3.4.1.tgz".

MY_PV no longer implicitly respected

The MY_PV variable was implicitly used in previous revisions when setting S and SRC_URI. In the new revision, you will need to modify those variables yourself and not rely on your value of MY_PV being used by the eclass.