Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] new host-composer package patches series
@ 2023-01-19 13:28 carrier.nicolas0
  2023-01-19 13:28 ` [Buildroot] [PATCH 1/3] package/oniguruma/oniguruma.mk: add a host package carrier.nicolas0
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: carrier.nicolas0 @ 2023-01-19 13:28 UTC (permalink / raw)
  To: buildroot
  Cc: Bernd Kuhls, Nicolas Carrier, Fabrice Fontaine, Thomas Petazzoni

From: Nicolas Carrier <carrier.nicolas0@gmail.com>

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

-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-01 21:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19 13:28 [Buildroot] [PATCH 0/3] new host-composer package patches series carrier.nicolas0
2023-01-19 13:28 ` [Buildroot] [PATCH 1/3] package/oniguruma/oniguruma.mk: add a host package carrier.nicolas0
2023-08-01 21:05   ` Thomas Petazzoni via buildroot
2023-01-19 13:28 ` [Buildroot] [PATCH 2/3] package/php/php.mk: add host-php carrier.nicolas0
2023-08-01 21:09   ` Thomas Petazzoni via buildroot
2023-01-19 13:28 ` [Buildroot] [PATCH 3/3] package/composer: new package carrier.nicolas0
2023-08-01 21:11   ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox