diff mbox series

[2/3] package/php/php.mk: add host-php

Message ID 20230119132856.1801425-3-carrier.nicolas0@gmail.com
State Accepted
Headers show
Series new host-composer package patches series | expand

Commit Message

Nicolas Carrier Jan. 19, 2023, 1:28 p.m. UTC
From: Nicolas Carrier <carrier.nicolas0@gmail.com>

having a working PHP with the correct version, is mandatory for executing
some PHP tools, such as composer, when building packages.

Signed-off-by: Nicolas Carrier <carrier.nicolas0@gmail.com>
---
 package/php/php.mk | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Thomas Petazzoni Aug. 1, 2023, 9:09 p.m. UTC | #1
Hello,

On Thu, 19 Jan 2023 14:28:55 +0100
carrier.nicolas0@gmail.com wrote:

> From: Nicolas Carrier <carrier.nicolas0@gmail.com>
> 
> having a working PHP with the correct version, is mandatory for executing
> some PHP tools, such as composer, when building packages.
> 
> Signed-off-by: Nicolas Carrier <carrier.nicolas0@gmail.com>

Tweaked commit title as:

	package/php/php: add a host variant

and it should have been:

	package/php: add a host variant

but I messed up.

> diff --git a/package/php/php.mk b/package/php/php.mk
> index 23dd4ba96f..bd301254d4 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -14,6 +14,24 @@ PHP_DEPENDENCIES = host-pkgconf pcre2
>  PHP_LICENSE = PHP-3.01
>  PHP_LICENSE_FILES = LICENSE
>  PHP_CPE_ID_VENDOR = php
> +
> +# This host php is installed in $(HOST_DIR), as it is needed
> +# to use composer.

This comment was not really useful: all host packages are installed in
$(HOST_DIR). So I dropped this comment.

> +
> +HOST_PHP_CONF_OPTS += \
> +	--disable-all \
> +	--without-pear \
> +	--with-config-file-path=/etc \
> +	--disable-phpdbg \
> +	--enable-phar \
> +	--enable-json \
> +	--enable-filter \
> +	--enable-mbstring \
> +	--enable-tokenizer \
> +	--with-openssl=$(HOST_DIR)/usr
> +
> +HOST_PHP_DEPENDENCIES += host-oniguruma host-openssl host-pkgconf

I moved both of these to the bottom of the file, to have first all the
stuff related to target PHP, and the all the stuff related to host PHP.

I replaced the += by = signs, since these assignments are not within
conditions.

I was also puzzled by the discrepancy in dependencies between target
and host PHP:

- target PHP depends on host-pkgconf and pcre2
- your host PHP proposal depends on host-onigurama host-openssl and host-pkgconf

So I added host-pcre2 in the dependencies, and added the option
--with-external-pcre to be on par with what we're doing for the target
PHP. host-onigurama is needed for --enable-mbstring, and host-openssl
for --with-openssl.

--with-openssl=$(HOST_DIR)/usr had to be changed to
--with-openssl=$(HOST_DIR) (we no longer used a usr/ subdir, and this
line was causing a check-package warning).

--with-config-file-path=/etc was changed to
--with-config-file-path=$(HOST_DIR)/etc.

Applied with those changes. Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/php/php.mk b/package/php/php.mk
index 23dd4ba96f..bd301254d4 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -14,6 +14,24 @@  PHP_DEPENDENCIES = host-pkgconf pcre2
 PHP_LICENSE = PHP-3.01
 PHP_LICENSE_FILES = LICENSE
 PHP_CPE_ID_VENDOR = php
+
+# This host php is installed in $(HOST_DIR), as it is needed
+# to use composer.
+
+HOST_PHP_CONF_OPTS += \
+	--disable-all \
+	--without-pear \
+	--with-config-file-path=/etc \
+	--disable-phpdbg \
+	--enable-phar \
+	--enable-json \
+	--enable-filter \
+	--enable-mbstring \
+	--enable-tokenizer \
+	--with-openssl=$(HOST_DIR)/usr
+
+HOST_PHP_DEPENDENCIES += host-oniguruma host-openssl host-pkgconf
+
 PHP_CONF_OPTS = \
 	--mandir=/usr/share/man \
 	--infodir=/usr/share/info \
@@ -344,3 +362,4 @@  PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
 PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(PHP_CXXFLAGS)"
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))