[v2,1/1] package/php-xdebug: new package
diff mbox series

Message ID 20190925114456.16388-1-nicolas.carrier@orolia.com
State New
Headers show
Series
  • [v2,1/1] package/php-xdebug: new package
Related show

Commit Message

Nicolas Carrier Sept. 25, 2019, 11:45 a.m. UTC
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

Comments

Nicolas Carrier Sept. 25, 2019, 12:37 p.m. UTC | #1
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.
Arnout Vandecappelle Sept. 25, 2019, 1:02 p.m. UTC | #2
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
Nicolas Carrier Oct. 2, 2019, 10:31 a.m. UTC | #3
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.

Patch
diff mbox series

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))