Skip to contentSkip to conversation

package/owfs: enable back php

PATCH In review Fabrice Fontaine 2 participants 3 messages Mar 15, 2020 – Dec 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/owfs: enable back php

owfs supports PHP7 since version 3.2p3 and
https://github.com/owfs/owfs/commit/a9a79b330e334ba80c305905b51e8886b40772d9

---
 package/owfs/owfs.mk | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
package/owfs/owfs.mk +21 -4
index ffc0b3098d..4e9a3f5c28 100644
@@ -14,10 +14,6 @@ OWFS_LICENSE = GPL-2.0+, LGPL-2.0 (owtcl)
 OWFS_LICENSE_FILES = COPYING COPYING.LIB
 OWFS_INSTALL_STAGING = YES
 
-# owfs PHP support is not PHP 7 compliant
-# https://sourceforge.net/p/owfs/support-requests/32/
-OWFS_CONF_OPTS += --disable-owphp --without-php
-
 # Skip man pages processing
 OWFS_CONF_ENV += ac_cv_path_SOELIM=true
 
@@ -67,6 +63,27 @@ else
 OWFS_CONF_OPTS += --disable-avahi
 endif
 
+ifeq ($(BR2_PACKAGE_PHP),y)
+OWFS_CONF_OPTS += \
+	--enable-owphp \
+	--with-php \
+	--with-phpconfig=$(STAGING_DIR)/usr/bin/php-config
+OWFS_DEPENDENCIES += php host-swig
+
+# $(libdir) is set to $(EXTENSION_DIR) which is patched in php.mk to add
+# $(TARGET_DIR) so remove $(DESTDIR) to avoid an install failure
+define OWFS_PHP_EXTENSION_FIXUP
+	$(SED) 's/$$(DESTDIR)$$(libdir)/$$(libdir)/g' \
+		$(@D)/module/swig/php/Makefile
+endef
+
+OWFS_POST_CONFIGURE_HOOKS += OWFS_PHP_EXTENSION_FIXUP
+else
+OWFS_CONF_OPTS += \
+	--disable-owphp \
+	--without-php
+endif
+
 # setup.py isn't python3 compliant
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 OWFS_CONF_OPTS += \
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/owfs: enable back php

package/owfs/owfs.mk else · line 74

Quoted 2 lines · On Sun, 15 Mar 2020 11:21:11 +0100 Fabrice Fontaine…
package/owfs/owfs.mk +2 -0
+# $(libdir) is set to $(EXTENSION_DIR) which is patched in php.mk to add
+# $(TARGET_DIR) so remove $(DESTDIR) to avoid an install failure

I guess you're referring to:

+ $(SED) "/extension_dir/ s:/usr:$(TARGET_DIR)/usr:" \
+ $(STAGING_DIR)/usr/bin/php-config

in php.mk ?

Is this the correct thing to do ? Do we have a better solution ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
In reply to Fabrice Fontaine
Quoted 7 lines · On Sun, 15 Mar 2020 11:21:11 +0100 Fabrice Fontaine…

owfs supports PHP7 since version 3.2p3 and
https://github.com/owfs/owfs/commit/a9a79b330e334ba80c305905b51e8886b40772d9

---
 package/owfs/owfs.mk | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

I'm afraid this no longer works: we have switched to PHP 8.x, and OWFS doesn't have PHP 8.x support for now. See
https://github.com/owfs/owfs/issues/89.

However, while looking into this, I noticed a 3.2p4 release is out, which includes the gcc 10.x fix for which we have a patch. So perhaps a version bump would be useful.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot