I am currently creating a recipe with which I want to provide a web project. The web project is maintained in a Git repository and requires further dependencies on the target system which are maintained with Composer.
Now my approach was to install these in the do_compile() task. However, PHP and Composer do not seem to be available there, although I have included them as build time dependencies (DEPENDS).
What am I doing wrong?
SUMMARY = "Web project based on Laravel"
# [...]
DEPENDS = "php composer-php84"
# [...]
do_compile() {
# Test for PHP
php --version # The first error message already appears here
# Install Composer dependencies
composer-php install
# ... some more PHP calls
}
do_install() {
# Copy files to webserver root.
}
The error message clearly shows that my dependencies (here PHP as an example) are not available:
run.do_compile.38482: line 143: php: command not found
do_compileis executed on the host, butDEPENDSis for cross compiled dependencies. Do you need the composer-installed dependencies on the target at runtime or on the host during build?DEPENDS = "php-native composer-php84-native"should install the host binaries