Skip to content

new host-composer package patches series

[email protected] buildroot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3package/oniguruma/oniguruma.mk: add a host packagepackage/oniguruma/oniguruma.mk+1 -01 reply
2/3package/php/php.mk: add host-phppackage/php/php.mk+19 -01 reply
3/3package/composer: new packagepackage/composer/composer.hash package/composer/composer.mk+34 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Buildroot] [PATCH 0/3] new host-composer package patches series

From: Nicolas Carrier <[email protected]>

This patch series introduces a new host package for composer. This package requires the creation of a host-php package, which in turn, needs a host-oniguruma package.

Composer is a tool used to deploy and handle dependencies of php web sites and is used in particular, by the CakePHP framework.

In order to test this patch series up to the creation of a working minimal system, able to serve a test CakePHP website, a hello-world can be created this way:

################################################################################
#

# hello-world
#
################################################################################
HELLO_WORLD_DEPENDENCIES += \
	php \
	host-php \
	host-composer

define HELLO_WORLD_INSTALL_TARGET_CMDS

	cd $(@D) && rm -rf hello-world && \
		$(HOST_DIR)/bin/php $(HOST_DIR)/bin/composer create-project \
		--ignore-platform-reqs \
		--no-interaction \
		--no-dev \
		--prefer-dist cakephp/app:4.* hello-world
	mkdir -p $(TARGET_DIR)/srv/www2/
	rsync --exclude resources \
		--exclude composer.json \
		--exclude composer.lock \
		-a $(@D)/hello-world/ \
		$(TARGET_DIR)/srv/www2/hello-world/
# we disable the loading of DebugKit which isn't available and disabling the
# debug instead just won't work with such a minimal application
	sed -i "s/.*'DebugKit');//g" \
		$(TARGET_DIR)/srv/www2/hello-world/src/Application.php
endef

$(eval $(generic-package))

Then select the qemu_x86 default config:
make qemu_x86_defconfig

And the following configurations must be set:

BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_HELLO_WORLD=y
BR2_PACKAGE_PHP_SAPI_CGI=y
BR2_PACKAGE_PHP_EXT_PDO=y
BR2_PACKAGE_PHP_EXT_INTL=y
BR2_PACKAGE_PHP_EXT_MBSTRING=y
BR2_PACKAGE_PHP_EXT_FILTER=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"

Then build the image, execute it with:

qemu-system-i386 -M pc -kernel output/images/bzImage \
	-drive file=output/images/rootfs.ext2,if=virtio,format=raw \
	-append "rootwait root=/dev/vda console=tty1 console=ttyS0" \
	-serial stdio -net nic,model=virtio -net user

Once booted in the system, enter 'root' as the password and then:

cd /srv/www2/hello-world/
bin/cake server &
wget -O - http://localhost:8765

wget should be able to dump the landing page of the test web site.

Nicolas Carrier (3):
package/oniguruma/oniguruma.mk: add a host package package/php/php.mk: add host-php package/composer: new package

 package/composer/composer.hash |  3 +++
 package/composer/composer.mk   | 31 +++++++++++++++++++++++++++++++
 package/oniguruma/oniguruma.mk |  1 +
 package/php/php.mk             | 19 +++++++++++++++++++
 4 files changed, 54 insertions(+)
 create mode 100644 package/composer/composer.hash
 create mode 100644 package/composer/composer.mk
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot