1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-20 15:48:40 +02:00
openwrt-packages/lang/php7/pecl.mk
Eneas U de Queiroz 3476816cc8
php7: fix pecl build with QUILT
Commit d741a64b7 ("lang/php7: Don't run phpize7 with QUILT") changed
pecl.mk to not run phpize7 during Package/prepare if QUILT is set.  The
intention was to allow prepare, refresh and update targets to run
without building dependencies.

As a side-effect, Package/configure and Package/compile fail when QUILT
is defined because they can't find ./configure or a Makefile.  It also
impacts the github tests run with pull requests, because QUILT is
defined there.

To avoid that failure and still keep the prepare, refresh, and update
speedup, call phpize7 before Package/Configure if QUILT is defined.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-02-26 11:23:07 -03:00

53 lines
1.3 KiB
Makefile

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Package/php7-pecl/Default
SUBMENU:=PHP7
SECTION:=lang
CATEGORY:=Languages
URL:=http://pecl.php.net/
DEPENDS:=php7
endef
define Build/Prepare
$(Build/Prepare/Default)
$(if $(QUILT),,( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/usr/bin/phpize7 ))
endef
define Build/Configure
$(if $(QUILT),( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/usr/bin/phpize7 ))
$(Build/Configure/Default)
endef
CONFIGURE_VARS+= \
ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no)
CONFIGURE_ARGS+= \
--with-php-config=$(STAGING_DIR)/usr/bin/php7-config
define PHP7PECLPackage
define Package/php7-pecl-$(1)
$(call Package/php7-pecl/Default)
TITLE:=$(2)
ifneq ($(3),)
DEPENDS+=$(3)
endif
endef
define Package/php7-pecl-$(1)/install
$(INSTALL_DIR) $$(1)/usr/lib/php
$(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
$(INSTALL_DIR) $$(1)/etc/php7
ifeq ($(5),zend)
echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
else
echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
endif
endef
endef