Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
@ 2019-09-25 11:45 Nicolas Carrier
  2019-09-25 12:00 ` Nicolas Carrier
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Carrier @ 2019-09-25 11:45 UTC (permalink / raw)
  To: buildroot

Extension for PHP to assist with debugging and development.

Signed-off-by: Nicolas Carrier <nicolas.carrier@orolia.com>
---

Changes v1 -> v2:
  - move xdebug to php extensions submenu, with the following two consequences:
        - makes it dependent on php
        - makes it wrapped inside !STATIC test
  - removed empty line in Config.in
  - removed Web page: prefix in help string
  - one option per line in PHP_XDEBUG_CONF_OPTS
  - renamed to php-xdebug
  - changed license to `Xdebug License (PHP-3.0-like)`


 package/Config.in                  |  1 +
 package/php-xdebug/Config.in       |  6 ++++++
 package/php-xdebug/php-xdebug.hash |  3 +++
 package/php-xdebug/php-xdebug.mk   | 27 +++++++++++++++++++++++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/php-xdebug/Config.in
 create mode 100644 package/php-xdebug/php-xdebug.hash
 create mode 100644 package/php-xdebug/php-xdebug.mk

diff --git a/package/Config.in b/package/Config.in
index 10b441c6e1..1ddc82644f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -801,6 +801,7 @@ menu "External php extensions"
 	source "package/php-memcached/Config.in"
 	source "package/php-ssh2/Config.in"
 	source "package/php-yaml/Config.in"
+	source "package/php-xdebug/Config.in"
 	source "package/php-zmq/Config.in"
 endmenu
 endif
diff --git a/package/php-xdebug/Config.in b/package/php-xdebug/Config.in
new file mode 100644
index 0000000000..b5919e06cd
--- /dev/null
+++ b/package/php-xdebug/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PHP_XDEBUG
+	bool "php-xdebug"
+	help
+	  Extension for PHP to assist with debugging and development.
+
+	  http://xdebug.org
diff --git a/package/php-xdebug/php-xdebug.hash b/package/php-xdebug/php-xdebug.hash
new file mode 100644
index 0000000000..d645142efc
--- /dev/null
+++ b/package/php-xdebug/php-xdebug.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 ef479ee1a3da3f933e0d046ca8cd0c14601f29b2c0c41cc60c9388546a4e0272  LICENSE
+sha256 b2aeb55335c5649034fe936abb90f61df175c4f0a0f0b97a219b3559541edfbd  php-xdebug-2.7.2.tar.gz
diff --git a/package/php-xdebug/php-xdebug.mk b/package/php-xdebug/php-xdebug.mk
new file mode 100644
index 0000000000..d63bc9f8ce
--- /dev/null
+++ b/package/php-xdebug/php-xdebug.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# php-xdebug
+#
+################################################################################
+
+PHP_XDEBUG_VERSION = 2.7.2
+PHP_XDEBUG_SITE = $(call github,xdebug,xdebug,$(PHP_XDEBUG_VERSION))
+PHP_XDEBUG_INSTALL_STAGING = YES
+PHP_XDEBUG_LICENSE = Xdebug License (PHP-3.0-like)
+PHP_XDEBUG_LICENSE_FILES = LICENSE
+PHP_XDEBUG_DEPENDENCIES = php host-autoconf
+PHP_XDEBUG_CONF_OPTS = \
+	--enable-xdebug \
+	--with-php-config=$(STAGING_DIR)/usr/bin/php-config \
+	--with-xdebug=$(STAGING_DIR)/usr
+
+define PHP_XDEBUG_PHPIZE
+	(cd $(@D); \
+		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		$(STAGING_DIR)/usr/bin/phpize)
+endef
+
+PHP_XDEBUG_PRE_CONFIGURE_HOOKS += PHP_XDEBUG_PHPIZE
+
+$(eval $(autotools-package))
-- 
2.20.1

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

* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
  2019-09-25 11:45 [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package Nicolas Carrier
@ 2019-09-25 12:00 ` Nicolas Carrier
  2019-09-25 12:02   ` Thomas Petazzoni
  2019-09-25 13:02   ` Arnout Vandecappelle
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Carrier @ 2019-09-25 12:00 UTC (permalink / raw)
  To: buildroot

Hello,
I tried to address all your comments, but:
 * I didn't manage to use test-pkg, I ran:
       ./utils/test-pkg -p php-xdebug -c php-xdebug.config
   but only got a bunch of [...] SKIPPED messages
   (same with -a).
   php-xdebug.config's content was:
       BR2_PACKAGE_PHP_XDEBUG=y
 * I didn't manage either to use check-package. I ran:
       $ ./utils/check-package package/php-xdebug/*
   _before_ fixing the two errors Arnout mentioned in the Config.in,
   but just got:
       36 lines processed
       0 warnings generated

I bet I'm doing things wrong, but couldn't figure out how ^^


Anyway, I fixed all, I think, then tested that the php-xdebug extension
could be loaded and called one of its functions in one of our product
using php's CLI.
I also ran a test build with a qemu defconfig (x86_amd64 if I'm
correct) and the build went fine too.

On Wed, 2019-09-25 at 13:45 +0200, Nicolas Carrier wrote:
> Extension for PHP to assist with debugging and development.
> 
> Signed-off-by: Nicolas Carrier <nicolas.carrier@orolia.com>
> ---
> 
> Changes v1 -> v2:
>   - move xdebug to php extensions submenu, with the following two
> consequences:
>         - makes it dependent on php
>         - makes it wrapped inside !STATIC test
>   - removed empty line in Config.in
>   - removed Web page: prefix in help string
>   - one option per line in PHP_XDEBUG_CONF_OPTS
>   - renamed to php-xdebug
>   - changed license to `Xdebug License (PHP-3.0-like)`
> 
> 
>  package/Config.in                  |  1 +
>  package/php-xdebug/Config.in       |  6 ++++++
>  package/php-xdebug/php-xdebug.hash |  3 +++
>  package/php-xdebug/php-xdebug.mk   | 27 +++++++++++++++++++++++++++
>  4 files changed, 37 insertions(+)
>  create mode 100644 package/php-xdebug/Config.in
>  create mode 100644 package/php-xdebug/php-xdebug.hash
>  create mode 100644 package/php-xdebug/php-xdebug.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 10b441c6e1..1ddc82644f 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -801,6 +801,7 @@ menu "External php extensions"
>  	source "package/php-memcached/Config.in"
>  	source "package/php-ssh2/Config.in"
>  	source "package/php-yaml/Config.in"
> +	source "package/php-xdebug/Config.in"
>  	source "package/php-zmq/Config.in"
>  endmenu
>  endif
> diff --git a/package/php-xdebug/Config.in b/package/php-
> xdebug/Config.in
> new file mode 100644
> index 0000000000..b5919e06cd
> --- /dev/null
> +++ b/package/php-xdebug/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PHP_XDEBUG
> +	bool "php-xdebug"
> +	help
> +	  Extension for PHP to assist with debugging and development.
> +
> +	  http://xdebug.org
> diff --git a/package/php-xdebug/php-xdebug.hash b/package/php-
> xdebug/php-xdebug.hash
> new file mode 100644
> index 0000000000..d645142efc
> --- /dev/null
> +++ b/package/php-xdebug/php-xdebug.hash
> @@ -0,0 +1,3 @@
> +# Locally computed
> +sha256
> ef479ee1a3da3f933e0d046ca8cd0c14601f29b2c0c41cc60c9388546a4e0272  LIC
> ENSE
> +sha256
> b2aeb55335c5649034fe936abb90f61df175c4f0a0f0b97a219b3559541edfbd  php
> -xdebug-2.7.2.tar.gz
> diff --git a/package/php-xdebug/php-xdebug.mk b/package/php-
> xdebug/php-xdebug.mk
> new file mode 100644
> index 0000000000..d63bc9f8ce
> --- /dev/null
> +++ b/package/php-xdebug/php-xdebug.mk
> @@ -0,0 +1,27 @@
> +####################################################################
> ############
> +#
> +# php-xdebug
> +#
> +####################################################################
> ############
> +
> +PHP_XDEBUG_VERSION = 2.7.2
> +PHP_XDEBUG_SITE = $(call github,xdebug,xdebug,$(PHP_XDEBUG_VERSION))
> +PHP_XDEBUG_INSTALL_STAGING = YES
> +PHP_XDEBUG_LICENSE = Xdebug License (PHP-3.0-like)
> +PHP_XDEBUG_LICENSE_FILES = LICENSE
> +PHP_XDEBUG_DEPENDENCIES = php host-autoconf
> +PHP_XDEBUG_CONF_OPTS = \
> +	--enable-xdebug \
> +	--with-php-config=$(STAGING_DIR)/usr/bin/php-config \
> +	--with-xdebug=$(STAGING_DIR)/usr
> +
> +define PHP_XDEBUG_PHPIZE
> +	(cd $(@D); \
> +		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
> +		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
> +		$(STAGING_DIR)/usr/bin/phpize)
> +endef
> +
> +PHP_XDEBUG_PRE_CONFIGURE_HOOKS += PHP_XDEBUG_PHPIZE
> +
> +$(eval $(autotools-package))

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

* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
  2019-09-25 12:00 ` Nicolas Carrier
@ 2019-09-25 12:02   ` Thomas Petazzoni
  2019-09-25 12:37     ` Nicolas Carrier
  2019-09-25 13:02   ` Arnout Vandecappelle
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2019-09-25 12:02 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 25 Sep 2019 12:00:19 +0000
Nicolas Carrier <nicolas.carrier@orolia.com> wrote:

> I tried to address all your comments, but:
>  * I didn't manage to use test-pkg, I ran:
>        ./utils/test-pkg -p php-xdebug -c php-xdebug.config
>    but only got a bunch of [...] SKIPPED messages
>    (same with -a).
>    php-xdebug.config's content was:
>        BR2_PACKAGE_PHP_XDEBUG=y

You also need:

BR2_PACKAGE_PHP=y

Because PHP_XDEBUG=y has a depends on BR2_PACKAGE_PHP, if you don't
also enable BR2_PACKAGE_PHP in your config fragment,
BR2_PACKAGE_PHP_XDEBUG=y will be discarded as it has an unmet
dependency.

>  * I didn't manage either to use check-package. I ran:
>        $ ./utils/check-package package/php-xdebug/*
>    _before_ fixing the two errors Arnout mentioned in the Config.in,
>    but just got:
>        36 lines processed
>        0 warnings generated

Well, 36 lines were processed, and no warnings were generated, so
you're all good.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
  2019-09-25 12:02   ` Thomas Petazzoni
@ 2019-09-25 12:37     ` Nicolas Carrier
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Carrier @ 2019-09-25 12:37 UTC (permalink / raw)
  To: buildroot

On Wed, 2019-09-25 at 14:02 +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 25 Sep 2019 12:00:19 +0000
> Nicolas Carrier <nicolas.carrier@orolia.com> wrote:
> 
> > I tried to address all your comments, but:
> >  * I didn't manage to use test-pkg, I ran:
> >        ./utils/test-pkg -p php-xdebug -c php-xdebug.config
> >    but only got a bunch of [...] SKIPPED messages
> >    (same with -a).
> >    php-xdebug.config's content was:
> >        BR2_PACKAGE_PHP_XDEBUG=y
> 
> You also need:
> 
> BR2_PACKAGE_PHP=y

Ha! Thank you, that was it, now the tests ran and gave:

                             br-arm-full [1/6]: OK
                  br-arm-cortex-a9-glibc [2/6]: OK
                   br-arm-cortex-m4-full [3/6]: SKIPPED
                          br-x86-64-musl [4/6]: OK
                      br-arm-full-static [5/6]: SKIPPED
                            sourcery-arm [6/6]: OK
6 builds, 2 skipped, 0 build failed, 0 legal-info failed

> Because PHP_XDEBUG=y has a depends on BR2_PACKAGE_PHP, if you don't
> also enable BR2_PACKAGE_PHP in your config fragment,
> BR2_PACKAGE_PHP_XDEBUG=y will be discarded as it has an unmet
> dependency.
> 
> >  * I didn't manage either to use check-package. I ran:
> >        $ ./utils/check-package package/php-xdebug/*
> >    _before_ fixing the two errors Arnout mentioned in the
> > Config.in,
> >    but just got:
> >        36 lines processed
> >        0 warnings generated
> 
> Well, 36 lines were processed, and no warnings were generated, so
> you're all good.

Ok, I voluntarily spoiled the .mk file by removing its header comments
and got warnings this time.
I was surprised since the two mistakes I had made should have triggered
warnings according to Arnout's saying.

(Note that this doesn't excuse me for not having ran check -package
initially ^^)

> 
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> ATTENTION: This email came from an external source.
> Do not open attachments or click on links from unknown senders or
> unexpected emails.

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

* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
  2019-09-25 12:00 ` Nicolas Carrier
  2019-09-25 12:02   ` Thomas Petazzoni
@ 2019-09-25 13:02   ` Arnout Vandecappelle
  2019-10-02 10:31     ` Nicolas Carrier
  1 sibling, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2019-09-25 13:02 UTC (permalink / raw)
  To: buildroot

 Hi Nicolas,


On 25/09/2019 14:00, Nicolas Carrier wrote:
> Hello,
> I tried to address all your comments, but:
[snip]
>  * I didn't manage either to use check-package. I ran:
>        $ ./utils/check-package package/php-xdebug/*
>    _before_ fixing the two errors Arnout mentioned in the Config.in,
>    but just got:
>        36 lines processed
>        0 warnings generated

 Indeed, it looks like the checking of Config.in is more limited than I thought.
I'll put it on my todo list :-)


 Regards,
 Arnout

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

* [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package
  2019-09-25 13:02   ` Arnout Vandecappelle
@ 2019-10-02 10:31     ` Nicolas Carrier
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Carrier @ 2019-10-02 10:31 UTC (permalink / raw)
  To: buildroot

Hello,
Are there still some defects in this patch, preventing it from being
merged?
Thank you


On Wed, 2019-09-25 at 15:02 +0200, Arnout Vandecappelle wrote:
>  Hi Nicolas,
> 
> 
> On 25/09/2019 14:00, Nicolas Carrier wrote:
> > Hello,
> > I tried to address all your comments, but:
> [snip]
> >  * I didn't manage either to use check-package. I ran:
> >        $ ./utils/check-package package/php-xdebug/*
> >    _before_ fixing the two errors Arnout mentioned in the
> > Config.in,
> >    but just got:
> >        36 lines processed
> >        0 warnings generated
> 
>  Indeed, it looks like the checking of Config.in is more limited than
> I thought.
> I'll put it on my todo list :-)
> 
> 
>  Regards,
>  Arnout
> ATTENTION: This email came from an external source.
> Do not open attachments or click on links from unknown senders or
> unexpected emails.

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

end of thread, other threads:[~2019-10-02 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 11:45 [Buildroot] [PATCH v2 1/1] package/php-xdebug: new package Nicolas Carrier
2019-09-25 12:00 ` Nicolas Carrier
2019-09-25 12:02   ` Thomas Petazzoni
2019-09-25 12:37     ` Nicolas Carrier
2019-09-25 13:02   ` Arnout Vandecappelle
2019-10-02 10:31     ` Nicolas Carrier

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