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.

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