You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

628 lines
18 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=php
  7. PKG_VERSION:=7.2.5
  8. PKG_RELEASE:=3
  9. PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
  10. PKG_LICENSE:=PHPv3.01
  11. PKG_LICENSE_FILES:=LICENSE
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=http://www.php.net/distributions/
  14. PKG_HASH:=af70a33b3f7a51510467199b39af151333fbbe4cc21923bad9c7cf64268cddb2
  15. PKG_FIXUP:=libtool autoreconf
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_USE_MIPS16:=0
  18. PHP7_MODULES = \
  19. calendar ctype curl \
  20. fileinfo \
  21. dom \
  22. exif \
  23. ftp \
  24. gettext gd gmp \
  25. hash \
  26. iconv imap intl \
  27. json \
  28. ldap \
  29. mbstring mysqli \
  30. opcache openssl \
  31. pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
  32. session shmop simplexml snmp soap sockets sqlite3 sysvmsg sysvsem sysvshm \
  33. tokenizer \
  34. xml xmlreader xmlwriter zip \
  35. PKG_CONFIG_DEPENDS:= \
  36. $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \
  37. CONFIG_PHP7_FILTER CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA CONFIG_PHP7_LIBFREETYPE
  38. include $(INCLUDE_DIR)/package.mk
  39. include $(INCLUDE_DIR)/nls.mk
  40. define Package/php7/Default
  41. SUBMENU:=PHP
  42. SECTION:=lang
  43. CATEGORY:=Languages
  44. TITLE:=PHP7 Hypertext preprocessor
  45. URL:=http://www.php.net/
  46. DEPENDS:=php7
  47. endef
  48. define Package/php7/Default/description
  49. PHP is a widely-used general-purpose scripting language that is especially
  50. suited for Web development and can be embedded into HTML.
  51. endef
  52. define Package/php7/config
  53. config PHP7_FILTER
  54. bool "PHP7 Filter support"
  55. depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
  56. default y
  57. config PHP7_LIBXML
  58. bool "PHP7 LIBXML support"
  59. depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
  60. config PHP7_SYSTEMTZDATA
  61. bool "Use system timezone data instead of php's built-in database"
  62. depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
  63. select PACKAGE_zoneinfo-core
  64. default y
  65. help
  66. Enabling this feature automatically selects the zoneinfo-core package
  67. which contains data for UTC timezone. To use other timezones you have
  68. to install the corresponding zoneinfo-... package(s).
  69. endef
  70. define Package/php7
  71. $(call Package/php7/Default)
  72. DEPENDS:=+libpcre +zlib \
  73. +PHP7_LIBXML:libxml2
  74. endef
  75. define Package/php7/description
  76. $(call Package/php7/Default/description)
  77. This package contains only the PHP config file. You must actually choose
  78. your PHP flavour (cli, cgi or fastcgi).
  79. Please note, that installing php5 and php7 in parallel on the same target
  80. is not supported in OpenWrt/LEDE.
  81. endef
  82. define Package/php7-cli
  83. $(call Package/php7/Default)
  84. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  85. TITLE+= (CLI)
  86. endef
  87. define Package/php7-cli/description
  88. $(call Package/php7/Default/description)
  89. This package contains the CLI version of the PHP7 interpreter.
  90. endef
  91. define Package/php7-cgi
  92. $(call Package/php7/Default)
  93. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  94. TITLE+= (CGI & FastCGI)
  95. endef
  96. define Package/php7-cgi/description
  97. $(call Package/php7/Default/description)
  98. This package contains the CGI version of the PHP7 interpreter.
  99. endef
  100. define Package/php7-fastcgi
  101. $(call Package/php7/Default)
  102. DEPENDS+= +php7-cgi
  103. TITLE:=FastCGI startup script
  104. endef
  105. define Package/php7-fastcgi/description
  106. As FastCGI support is now a core feature the php7-fastcgi package now depends
  107. on the php7-cgi package, containing just the startup script.
  108. endef
  109. define Package/php7-fpm
  110. $(call Package/php7/Default)
  111. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  112. TITLE+= (FPM)
  113. endef
  114. define Package/php7-fpm/description
  115. $(call Package/php7/Default/description)
  116. This package contains the FastCGI Process Manager of the PHP7 interpreter.
  117. endef
  118. define Package/php7-mod-gd/config
  119. config PHP7_LIBFREETYPE
  120. bool "Enable Freetype 2 support in php7-mod-gd"
  121. depends on PACKAGE_php7-mod-gd
  122. default y
  123. endef
  124. # not everything groks --disable-nls
  125. DISABLE_NLS:=
  126. CONFIGURE_ARGS+= \
  127. --enable-cli \
  128. --enable-cgi \
  129. --enable-fpm \
  130. --enable-shared \
  131. --disable-static \
  132. --disable-rpath \
  133. --disable-debug \
  134. --disable-phpdbg \
  135. --without-pear \
  136. \
  137. --with-config-file-path=/etc \
  138. --with-config-file-scan-dir=/etc/php7 \
  139. --disable-short-tags \
  140. \
  141. --without-valgrind \
  142. --with-pcre-regex="$(STAGING_DIR)/usr" \
  143. --with-zlib="$(STAGING_DIR)/usr" \
  144. --with-zlib-dir="$(STAGING_DIR)/usr"
  145. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
  146. CONFIGURE_ARGS+= --enable-calendar=shared
  147. else
  148. CONFIGURE_ARGS+= --disable-calendar
  149. endif
  150. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),)
  151. CONFIGURE_ARGS+= --enable-ctype=shared
  152. else
  153. CONFIGURE_ARGS+= --disable-ctype
  154. endif
  155. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),)
  156. CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
  157. else
  158. CONFIGURE_ARGS+= --without-curl
  159. endif
  160. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-fileinfo),)
  161. CONFIGURE_ARGS+= --enable-fileinfo=shared
  162. else
  163. CONFIGURE_ARGS+= --disable-fileinfo
  164. endif
  165. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),)
  166. CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
  167. else
  168. CONFIGURE_ARGS+= --without-gettext
  169. endif
  170. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-dom),)
  171. CONFIGURE_ARGS+= --enable-dom=shared
  172. else
  173. CONFIGURE_ARGS+= --disable-dom
  174. endif
  175. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-exif),)
  176. CONFIGURE_ARGS+= --enable-exif=shared
  177. else
  178. CONFIGURE_ARGS+= --disable-exif
  179. endif
  180. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),)
  181. CONFIGURE_ARGS+= --enable-ftp=shared
  182. else
  183. CONFIGURE_ARGS+= --disable-ftp
  184. endif
  185. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),)
  186. CONFIGURE_ARGS+= \
  187. --with-gd=shared \
  188. --with-jpeg-dir="$(STAGING_DIR)/usr" \
  189. --with-png-dir="$(STAGING_DIR)/usr" \
  190. --without-xpm-dir \
  191. --enable-gd-native-ttf \
  192. --disable-gd-jis-conv
  193. else
  194. CONFIGURE_ARGS+= --without-gd
  195. endif
  196. ifneq ($(CONFIG_PHP7_LIBFREETYPE),)
  197. CONFIGURE_ARGS+= --with-freetype-dir="$(STAGING_DIR)"
  198. else
  199. CONFIGURE_ARGS+= --without-freetype-dir
  200. endif
  201. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
  202. CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
  203. else
  204. CONFIGURE_ARGS+= --without-gmp
  205. endif
  206. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-hash),)
  207. CONFIGURE_ARGS+= --enable-hash=shared
  208. else
  209. CONFIGURE_ARGS+= --disable-hash
  210. endif
  211. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),)
  212. CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
  213. else
  214. CONFIGURE_ARGS+= --without-iconv
  215. endif
  216. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-imap),)
  217. CONFIGURE_ARGS+= \
  218. --with-imap=shared,"$(STAGING_DIR)/usr" \
  219. --with-imap-kerberos=no \
  220. --with-imap-ssl="$(STAGING_DIR)/usr"
  221. else
  222. CONFIGURE_ARGS+= --without-imap
  223. endif
  224. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
  225. CONFIGURE_ARGS+= --enable-intl=shared
  226. TARGET_CXXFLAGS+= -std=c++0x
  227. else
  228. CONFIGURE_ARGS+= --disable-intl
  229. endif
  230. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),)
  231. CONFIGURE_ARGS+= --enable-json=shared
  232. else
  233. CONFIGURE_ARGS+= --disable-json
  234. endif
  235. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),)
  236. CONFIGURE_ARGS+= \
  237. --with-ldap=shared,"$(STAGING_DIR)/usr" \
  238. --with-ldap-sasl="$(STAGING_DIR)/usr"
  239. else
  240. CONFIGURE_ARGS+= --without-ldap
  241. endif
  242. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),)
  243. CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
  244. else
  245. CONFIGURE_ARGS+= --disable-mbstring
  246. endif
  247. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),)
  248. CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config"
  249. else
  250. CONFIGURE_ARGS+= --without-mysqli
  251. endif
  252. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
  253. CONFIGURE_ARGS+= --enable-opcache=shared
  254. else
  255. CONFIGURE_ARGS+= --disable-opcache
  256. endif
  257. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),)
  258. CONFIGURE_ARGS+= \
  259. --with-openssl=shared,"$(STAGING_DIR)/usr" \
  260. --with-kerberos=no \
  261. --with-openssl-dir="$(STAGING_DIR)/usr"
  262. else
  263. CONFIGURE_ARGS+= --without-openssl
  264. endif
  265. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
  266. CONFIGURE_ARGS+= --enable-pcntl=shared
  267. else
  268. CONFIGURE_ARGS+= --disable-pcntl
  269. endif
  270. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
  271. CONFIGURE_ARGS+= --enable-pdo=shared
  272. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
  273. CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
  274. else
  275. CONFIGURE_ARGS+= --without-pdo-mysql
  276. endif
  277. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
  278. CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
  279. else
  280. CONFIGURE_ARGS+= --without-pdo-pgsql
  281. endif
  282. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
  283. CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
  284. else
  285. CONFIGURE_ARGS+= --without-pdo-sqlite
  286. endif
  287. else
  288. CONFIGURE_ARGS+= --disable-pdo
  289. endif
  290. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
  291. CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  292. else
  293. CONFIGURE_ARGS+= --without-pgsql
  294. endif
  295. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
  296. CONFIGURE_ARGS+= --enable-phar=shared
  297. else
  298. CONFIGURE_ARGS+= --disable-phar
  299. endif
  300. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
  301. CONFIGURE_ARGS+= --enable-session=shared
  302. else
  303. CONFIGURE_ARGS+= --disable-session
  304. endif
  305. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
  306. CONFIGURE_ARGS+= --enable-shmop=shared
  307. else
  308. CONFIGURE_ARGS+= --disable-shmop
  309. endif
  310. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
  311. CONFIGURE_ARGS+= --enable-simplexml=shared
  312. else
  313. CONFIGURE_ARGS+= --disable-simplexml
  314. endif
  315. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),)
  316. CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
  317. else
  318. CONFIGURE_ARGS+= --without-snmp
  319. endif
  320. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
  321. CONFIGURE_ARGS+= --enable-soap=shared
  322. else
  323. CONFIGURE_ARGS+= --disable-soap
  324. endif
  325. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
  326. CONFIGURE_ARGS+= --enable-sockets=shared
  327. else
  328. CONFIGURE_ARGS+= --disable-sockets
  329. endif
  330. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
  331. CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
  332. else
  333. CONFIGURE_ARGS+= --without-sqlite3
  334. endif
  335. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
  336. CONFIGURE_ARGS+= --enable-sysvmsg=shared
  337. else
  338. CONFIGURE_ARGS+= --disable-sysvmsg
  339. endif
  340. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
  341. CONFIGURE_ARGS+= --enable-sysvsem=shared
  342. else
  343. CONFIGURE_ARGS+= --disable-sysvsem
  344. endif
  345. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
  346. CONFIGURE_ARGS+= --enable-sysvshm=shared
  347. else
  348. CONFIGURE_ARGS+= --disable-sysvshm
  349. endif
  350. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
  351. CONFIGURE_ARGS+= --enable-tokenizer=shared
  352. else
  353. CONFIGURE_ARGS+= --disable-tokenizer
  354. endif
  355. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
  356. CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
  357. ifneq ($(CONFIG_PHP7_LIBXML),)
  358. CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
  359. else
  360. CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
  361. endif
  362. else
  363. CONFIGURE_ARGS+= --disable-xml
  364. endif
  365. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
  366. CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
  367. else
  368. CONFIGURE_ARGS+= --disable-xmlreader
  369. endif
  370. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
  371. CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
  372. else
  373. CONFIGURE_ARGS+= --disable-xmlwriter
  374. endif
  375. ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
  376. CONFIGURE_ARGS+= --enable-zip=shared
  377. else
  378. CONFIGURE_ARGS+= --disable-zip
  379. endif
  380. ifneq ($(SDK)$(CONFIG_PHP7_FILTER),)
  381. CONFIGURE_ARGS+= --enable-filter
  382. else
  383. CONFIGURE_ARGS+= --disable-filter
  384. endif
  385. ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
  386. CONFIGURE_ARGS+= --enable-libxml
  387. CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
  388. else
  389. CONFIGURE_ARGS+= --disable-libxml
  390. endif
  391. ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
  392. CONFIGURE_ARGS+= --with-system-tzdata
  393. else
  394. CONFIGURE_ARGS+= --without-system-tzdata
  395. endif
  396. CONFIGURE_VARS+= \
  397. ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
  398. php_cv_cc_rpath="no" \
  399. iconv_impl_name="gnu_libiconv" \
  400. ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
  401. ac_cv_u8t_decompose=yes
  402. define Package/php7/conffiles
  403. /etc/php.ini
  404. /etc/php7/
  405. endef
  406. define Package/php7/install
  407. $(INSTALL_DIR) $(1)/etc
  408. $(INSTALL_DATA) ./files/php.ini $(1)/etc/
  409. endef
  410. define Package/php7-cli/install
  411. $(INSTALL_DIR) $(1)/usr/bin
  412. $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
  413. endef
  414. define Package/php7-cgi/install
  415. $(INSTALL_DIR) $(1)/usr/bin
  416. $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
  417. ln -sf php-cgi $(1)/usr/bin/php-fcgi
  418. endef
  419. define Package/php7-fastcgi/install
  420. $(INSTALL_DIR) $(1)/etc/config
  421. $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi
  422. $(INSTALL_DIR) $(1)/etc/init.d
  423. $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi
  424. endef
  425. define Package/php7-fpm/install
  426. $(INSTALL_DIR) $(1)/usr/bin
  427. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
  428. $(INSTALL_DIR) $(1)/etc
  429. $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf
  430. $(INSTALL_DIR) $(1)/etc/config
  431. $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm
  432. $(INSTALL_DIR) $(1)/etc/php7-fpm.d
  433. $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf
  434. $(INSTALL_DIR) $(1)/etc/init.d
  435. $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
  436. endef
  437. define Package/php7-fpm/conffiles
  438. /etc/php7-fpm.conf
  439. /etc/php7-fpm.d/
  440. /etc/config/php7-fpm
  441. endef
  442. define Build/Prepare
  443. $(call Build/Prepare/Default)
  444. ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
  445. endef
  446. define Build/InstallDev
  447. rm -rf $(PKG_BUILD_DIR)/staging
  448. make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
  449. rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
  450. rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
  451. mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
  452. mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
  453. mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
  454. mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
  455. $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
  456. sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  457. sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  458. sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
  459. sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
  460. sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
  461. sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
  462. endef
  463. define BuildModule
  464. define Package/php7-mod-$(1)
  465. $(call Package/php7/Default)
  466. ifneq ($(3),)
  467. DEPENDS+=$(3)
  468. endif
  469. TITLE:=$(2) shared module
  470. endef
  471. define Package/php7-mod-$(1)/install
  472. $(INSTALL_DIR) $$(1)/usr/lib/php
  473. $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
  474. $(INSTALL_DIR) $$(1)/etc/php7
  475. ifeq ($(5),zend)
  476. echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  477. else
  478. echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  479. endif
  480. endef
  481. $$(eval $$(call BuildPackage,php7-mod-$(1)))
  482. endef
  483. $(eval $(call BuildPackage,php7))
  484. $(eval $(call BuildPackage,php7-cgi))
  485. $(eval $(call BuildPackage,php7-cli))
  486. $(eval $(call BuildPackage,php7-fastcgi))
  487. $(eval $(call BuildPackage,php7-fpm))
  488. #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
  489. $(eval $(call BuildModule,calendar,Calendar))
  490. $(eval $(call BuildModule,ctype,Ctype))
  491. $(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
  492. $(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
  493. $(eval $(call BuildModule,exif,EXIF))
  494. $(eval $(call BuildModule,fileinfo,Fileinfo))
  495. $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
  496. $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng +PHP7_LIBFREETYPE:libfreetype))
  497. $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
  498. $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
  499. $(eval $(call BuildModule,hash,Hash))
  500. $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
  501. $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
  502. $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu))
  503. $(eval $(call BuildModule,json,JSON))
  504. $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
  505. $(eval $(call BuildModule,mbstring,MBString))
  506. $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:libmariadbclient))
  507. $(eval $(call BuildModule,opcache,OPcache,,,zend))
  508. $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl))
  509. $(eval $(call BuildModule,pcntl,PCNTL))
  510. $(eval $(call BuildModule,pdo,PHP Data Objects))
  511. $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:libmariadbclient))
  512. $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
  513. $(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php7-mod-pdo +PACKAGE_php7-mod-pdo-sqlite:libsqlite3 +PACKAGE_php7-mod-pdo-sqlite:librt))
  514. $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
  515. $(eval $(call BuildModule,phar,Phar Archives,+php7-mod-hash))
  516. $(eval $(call BuildModule,session,Session))
  517. $(eval $(call BuildModule,shmop,Shared Memory))
  518. $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
  519. $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl))
  520. $(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
  521. $(eval $(call BuildModule,sockets,Sockets))
  522. $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
  523. $(eval $(call BuildModule,sysvmsg,System V messages))
  524. $(eval $(call BuildModule,sysvsem,System V shared memory))
  525. $(eval $(call BuildModule,sysvshm,System V semaphore))
  526. $(eval $(call BuildModule,tokenizer,Tokenizer))
  527. $(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
  528. $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlreader:libxml2))
  529. $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
  530. $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:zlib))