* [Buildroot] [PATCH 1/1] package/php-apcu: new package
@ 2021-10-11 11:07 Herve Codina
2021-12-17 21:49 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Herve Codina @ 2021-10-11 11:07 UTC (permalink / raw)
To: buildroot; +Cc: Bernd Kuhls, Herve Codina, Thomas Petazzoni
APCu is an in-memory key-value store for PHP.
Keys are of type string and values can be any PHP variables.
APCu only supports userland caching of variables
https://pecl.php.net/package/APCU
Based on initial work from Nicolas Carrier <nicolas.carrier@orolia.com>
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 6 ++++
package/Config.in | 1 +
package/php-apcu/Config.in | 6 ++++
package/php-apcu/php-apcu.hash | 2 ++
package/php-apcu/php-apcu.mk | 25 +++++++++++++
.../testing/tests/package/test_php_apcu.py | 35 +++++++++++++++++++
6 files changed, 75 insertions(+)
create mode 100644 package/php-apcu/Config.in
create mode 100644 package/php-apcu/php-apcu.hash
create mode 100644 package/php-apcu/php-apcu.mk
create mode 100644 support/testing/tests/package/test_php_apcu.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 7ebfc9234b..6a16dcc824 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1149,6 +1149,10 @@ F: package/sysrepo/
N: Henrique Camargo <henrique@henriquecamargo.com>
F: package/json-glib/
+N: Hervé Codina <herve.codina@bootlin.com>
+F: package/php-apcu/
+F: support/testing/tests/package/test_php_apcu.py
+
N: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp>
F: package/gauche/
F: package/gmrender-resurrect/
@@ -1982,6 +1986,7 @@ F: configs/galileo_defconfig
N: Nicolas Carrier <nicolas.carrier@orolia.com>
F: package/bmap-tools/
+F: package/php-apcu/
F: package/php-xdebug/
F: package/python-augeas/
F: package/python-flask-expects-json/
@@ -1991,6 +1996,7 @@ F: support/testing/tests/package/sample_python_augeas.py
F: support/testing/tests/package/sample_python_flask_expects_json.py
F: support/testing/tests/package/sample_python_git.py
F: support/testing/tests/package/test_bmap_tools.py
+F: support/testing/tests/package/test_php_apcu.py
F: support/testing/tests/package/test_python_augeas.py
F: support/testing/tests/package/test_python_flask_expects_json.py
F: support/testing/tests/package/test_python_git.py
diff --git a/package/Config.in b/package/Config.in
index 9fed0ab4cb..f041fe43bf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -862,6 +862,7 @@ if BR2_PACKAGE_PHP
if !BR2_STATIC_LIBS
menu "External php extensions"
source "package/php-amqp/Config.in"
+ source "package/php-apcu/Config.in"
source "package/php-geoip/Config.in"
source "package/php-gnupg/Config.in"
source "package/php-imagick/Config.in"
diff --git a/package/php-apcu/Config.in b/package/php-apcu/Config.in
new file mode 100644
index 0000000000..6338980222
--- /dev/null
+++ b/package/php-apcu/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PHP_APCU
+ bool "php-apcu"
+ help
+ APCu is an in-memory key-value store for PHP.
+
+ https://pecl.php.net/package/APCu
diff --git a/package/php-apcu/php-apcu.hash b/package/php-apcu/php-apcu.hash
new file mode 100644
index 0000000000..8b286d5ae3
--- /dev/null
+++ b/package/php-apcu/php-apcu.hash
@@ -0,0 +1,2 @@
+sha256 b99d40fafec06f4d132fcee53e7526ddbfc1d041ea6e04e17389dfad28f9c390 apcu-5.1.20.tgz
+sha256 c48761c645c6fa42b57af0e65d893217dc69bcd8d879ace74d6abbf1c5f73a8f LICENSE
diff --git a/package/php-apcu/php-apcu.mk b/package/php-apcu/php-apcu.mk
new file mode 100644
index 0000000000..ce59611d8f
--- /dev/null
+++ b/package/php-apcu/php-apcu.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# php-apcu
+#
+################################################################################
+
+PHP_APCU_VERSION = 5.1.20
+PHP_APCU_SITE = http://pecl.php.net/get
+PHP_APCU_SOURCE = apcu-$(PHP_APCU_VERSION).tgz
+PHP_APCU_LICENSE = PHP-3.01
+PHP_APCU_LICENSE_FILES = LICENSE
+PHP_APCU_DEPENDENCIES = php host-autoconf
+
+PHP_APCU_CONF_OPTS = \
+ --with-php-config=$(STAGING_DIR)/usr/bin/php-config
+
+define PHP_APCU_PHPIZE
+ (cd $(@D); \
+ PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
+ PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+ $(STAGING_DIR)/usr/bin/phpize)
+endef
+PHP_APCU_PRE_CONFIGURE_HOOKS += PHP_APCU_PHPIZE
+
+$(eval $(autotools-package))
diff --git a/support/testing/tests/package/test_php_apcu.py b/support/testing/tests/package/test_php_apcu.py
new file mode 100644
index 0000000000..7c149a5e47
--- /dev/null
+++ b/support/testing/tests/package/test_php_apcu.py
@@ -0,0 +1,35 @@
+import os
+
+import infra.basetest
+
+
+class TestPhpApcu(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_PHP=y
+ BR2_PACKAGE_PHP_SAPI_CLI=y
+ BR2_PACKAGE_PHP_APCU=y
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ """
+
+ def test_run(self):
+ img = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv5",
+ kernel="builtin",
+ options=["-initrd", img])
+ self.emulator.login()
+
+ self.assertRunOk("mkdir /etc/php.d")
+ self.assertRunOk("echo 'extension=apcu.so' > /etc/php.d/apcu.ini")
+ # enable_cli enables APC for the CLI version of PHP, which is what we
+ # use in this test case.
+ self.assertRunOk("echo 'apc.enable_cli=1' >> /etc/php.d/apcu.ini")
+
+ output, exit_code = self.emulator.run("php --ri apcu | sed '/^$/d'")
+ self.assertEqual(exit_code, 0)
+ self.assertEqual(output[0], "apcu")
+ self.assertEqual(output[1], "APCu Support => Enabled")
+ # Do not check the version value in order to avoid a test failure when
+ # bumping package version.
+ self.assertEqual(output[2][0:11], "Version => ")
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/php-apcu: new package
2021-10-11 11:07 [Buildroot] [PATCH 1/1] package/php-apcu: new package Herve Codina
@ 2021-12-17 21:49 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-12-17 21:49 UTC (permalink / raw)
To: Herve Codina; +Cc: Bernd Kuhls, buildroot
On Mon, 11 Oct 2021 13:07:56 +0200
Herve Codina <herve.codina@bootlin.com> wrote:
> APCu is an in-memory key-value store for PHP.
> Keys are of type string and values can be any PHP variables.
> APCu only supports userland caching of variables
>
> https://pecl.php.net/package/APCU
>
> Based on initial work from Nicolas Carrier <nicolas.carrier@orolia.com>
>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
> DEVELOPERS | 6 ++++
> package/Config.in | 1 +
> package/php-apcu/Config.in | 6 ++++
> package/php-apcu/php-apcu.hash | 2 ++
> package/php-apcu/php-apcu.mk | 25 +++++++++++++
> .../testing/tests/package/test_php_apcu.py | 35 +++++++++++++++++++
> 6 files changed, 75 insertions(+)
> create mode 100644 package/php-apcu/Config.in
> create mode 100644 package/php-apcu/php-apcu.hash
> create mode 100644 package/php-apcu/php-apcu.mk
> create mode 100644 support/testing/tests/package/test_php_apcu.py
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-17 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 11:07 [Buildroot] [PATCH 1/1] package/php-apcu: new package Herve Codina
2021-12-17 21:49 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.