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.

664 lines
19 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.1.9
  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:=53477e73e6254dc942b68913a58d815ffdbf6946baf61a1f8ef854de524c27bf
  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 CONFIG_PACKAGE_apache-mod-php8
  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 || PACKAGE_apache-mod-php8
  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. define Package/apache-mod-php8
  129. $(call Package/php8/Default)
  130. SUBMENU:=Web Servers/Proxies
  131. SECTION:=net
  132. CATEGORY:=Network
  133. DEPENDS+=PACKAGE_apache-mod-php8:apache \
  134. +PACKAGE_php8-mod-intl:libstdcpp \
  135. +libpcre2 +zlib
  136. TITLE:=PHP8 module for Apache Web Server
  137. endef
  138. define Package/apache-mod-php8/description
  139. $(call Package/php8/Default/description)
  140. This package contains the PHP module for the Apache Web Server.
  141. endef
  142. # not everything groks --disable-nls
  143. DISABLE_NLS:=
  144. CONFIGURE_ARGS+= \
  145. --enable-cli \
  146. --enable-cgi \
  147. --enable-fpm \
  148. --enable-shared \
  149. --disable-static \
  150. --with-pic \
  151. --disable-rpath \
  152. --disable-debug \
  153. --disable-phpdbg \
  154. --without-pear \
  155. \
  156. --with-config-file-path=/etc \
  157. --with-config-file-scan-dir=/etc/php8 \
  158. --disable-short-tags \
  159. \
  160. --without-valgrind \
  161. --with-external-pcre \
  162. --with-zlib="$(STAGING_DIR)/usr"
  163. ifeq ($(CONFIG_LIBC_USE_GLIBC),y)
  164. TARGET_LDFLAGS += -ldl
  165. endif
  166. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-bcmath),)
  167. CONFIGURE_ARGS+= --enable-bcmath=shared
  168. else
  169. CONFIGURE_ARGS+= --disable-bcmath
  170. endif
  171. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-calendar),)
  172. CONFIGURE_ARGS+= --enable-calendar=shared
  173. else
  174. CONFIGURE_ARGS+= --disable-calendar
  175. endif
  176. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ctype),)
  177. CONFIGURE_ARGS+= --enable-ctype=shared
  178. else
  179. CONFIGURE_ARGS+= --disable-ctype
  180. endif
  181. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-curl),)
  182. CONFIGURE_ARGS+= --with-curl=shared
  183. else
  184. CONFIGURE_ARGS+= --without-curl
  185. endif
  186. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-dom),)
  187. CONFIGURE_ARGS+= --enable-dom=shared
  188. else
  189. CONFIGURE_ARGS+= --disable-dom
  190. endif
  191. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-exif),)
  192. CONFIGURE_ARGS+= --enable-exif=shared
  193. else
  194. CONFIGURE_ARGS+= --disable-exif
  195. endif
  196. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-fileinfo),)
  197. CONFIGURE_ARGS+= --enable-fileinfo=shared,"$(STAGING_DIR)/usr"
  198. else
  199. CONFIGURE_ARGS+= --disable-fileinfo
  200. endif
  201. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-filter),)
  202. CONFIGURE_ARGS+= --enable-filter=shared,"$(STAGING_DIR)/usr"
  203. else
  204. CONFIGURE_ARGS+= --disable-filter
  205. endif
  206. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ftp),)
  207. CONFIGURE_ARGS+= --enable-ftp=shared
  208. else
  209. CONFIGURE_ARGS+= --disable-ftp
  210. endif
  211. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gd),)
  212. CONFIGURE_ARGS+= \
  213. --enable-gd=shared,"$(STAGING_DIR)/usr" \
  214. --with-external-gd
  215. else
  216. CONFIGURE_ARGS+= --disable-gd
  217. endif
  218. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gettext),)
  219. CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
  220. else
  221. CONFIGURE_ARGS+= --without-gettext
  222. endif
  223. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gmp),)
  224. CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
  225. else
  226. CONFIGURE_ARGS+= --without-gmp
  227. endif
  228. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-iconv),)
  229. CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
  230. else
  231. CONFIGURE_ARGS+= --without-iconv
  232. endif
  233. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-imap),)
  234. CONFIGURE_ARGS+= \
  235. --with-imap=shared,"$(STAGING_DIR)/usr" \
  236. --with-kerberos=no \
  237. --with-imap-ssl="$(STAGING_DIR)/usr"
  238. else
  239. CONFIGURE_ARGS+= --without-imap
  240. endif
  241. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-intl),)
  242. CONFIGURE_ARGS+= --enable-intl=shared
  243. TARGET_CXXFLAGS+= -std=c++0x
  244. else
  245. CONFIGURE_ARGS+= --disable-intl
  246. endif
  247. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ldap),)
  248. CONFIGURE_ARGS+= \
  249. --with-ldap=shared,"$(STAGING_DIR)/usr" \
  250. --with-ldap-sasl
  251. else
  252. CONFIGURE_ARGS+= --without-ldap
  253. endif
  254. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mbstring),)
  255. CONFIGURE_ARGS+= \
  256. --enable-mbstring=shared \
  257. --enable-mbregex
  258. else
  259. CONFIGURE_ARGS+= --disable-mbstring
  260. endif
  261. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mysqli),)
  262. CONFIGURE_ARGS+= --with-mysqli=shared
  263. else
  264. CONFIGURE_ARGS+= --without-mysqli
  265. endif
  266. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mysqlnd),)
  267. CONFIGURE_ARGS+= --enable-mysqlnd=shared
  268. else
  269. CONFIGURE_ARGS+= --disable-mysqlnd
  270. endif
  271. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-opcache),)
  272. CONFIGURE_ARGS+= --enable-opcache=shared
  273. else
  274. CONFIGURE_ARGS+= --disable-opcache
  275. endif
  276. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-openssl)$(CONFIG_PACKAGE_php8-mod-ftp)$(CONFIG_PACKAGE_php8-mod-imap)$(CONFIG_PACKAGE_php8-mod-snmp),)
  277. CONFIGURE_ARGS+= \
  278. --with-openssl=shared \
  279. --with-kerberos=no \
  280. --with-openssl-dir="$(STAGING_DIR)/usr"
  281. else
  282. CONFIGURE_ARGS+= --without-openssl
  283. endif
  284. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pcntl),)
  285. CONFIGURE_ARGS+= --enable-pcntl=shared
  286. else
  287. CONFIGURE_ARGS+= --disable-pcntl
  288. endif
  289. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo),)
  290. CONFIGURE_ARGS+= --enable-pdo=shared
  291. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-mysql),)
  292. CONFIGURE_ARGS+= --with-pdo-mysql=shared
  293. else
  294. CONFIGURE_ARGS+= --without-pdo-mysql
  295. endif
  296. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-pgsql),)
  297. CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
  298. else
  299. CONFIGURE_ARGS+= --without-pdo-pgsql
  300. endif
  301. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-sqlite),)
  302. CONFIGURE_ARGS+= --with-pdo-sqlite=shared
  303. else
  304. CONFIGURE_ARGS+= --without-pdo-sqlite
  305. endif
  306. else
  307. CONFIGURE_ARGS+= --disable-pdo
  308. endif
  309. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pgsql),)
  310. CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  311. else
  312. CONFIGURE_ARGS+= --without-pgsql
  313. endif
  314. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-phar),)
  315. CONFIGURE_ARGS+= --enable-phar=shared
  316. else
  317. CONFIGURE_ARGS+= --disable-phar
  318. endif
  319. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-session),)
  320. CONFIGURE_ARGS+= --enable-session=shared
  321. else
  322. CONFIGURE_ARGS+= --disable-session
  323. endif
  324. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-shmop),)
  325. CONFIGURE_ARGS+= --enable-shmop=shared
  326. else
  327. CONFIGURE_ARGS+= --disable-shmop
  328. endif
  329. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-simplexml),)
  330. CONFIGURE_ARGS+= --enable-simplexml=shared
  331. else
  332. CONFIGURE_ARGS+= --disable-simplexml
  333. endif
  334. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-snmp),)
  335. CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
  336. else
  337. CONFIGURE_ARGS+= --without-snmp
  338. endif
  339. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-soap),)
  340. CONFIGURE_ARGS+= --enable-soap=shared
  341. else
  342. CONFIGURE_ARGS+= --disable-soap
  343. endif
  344. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sockets),)
  345. CONFIGURE_ARGS+= --enable-sockets=shared
  346. else
  347. CONFIGURE_ARGS+= --disable-sockets
  348. endif
  349. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sqlite3),)
  350. CONFIGURE_ARGS+= --with-sqlite3=shared
  351. else
  352. CONFIGURE_ARGS+= --without-sqlite3
  353. endif
  354. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvmsg),)
  355. CONFIGURE_ARGS+= --enable-sysvmsg=shared
  356. else
  357. CONFIGURE_ARGS+= --disable-sysvmsg
  358. endif
  359. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvsem),)
  360. CONFIGURE_ARGS+= --enable-sysvsem=shared
  361. else
  362. CONFIGURE_ARGS+= --disable-sysvsem
  363. endif
  364. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvshm),)
  365. CONFIGURE_ARGS+= --enable-sysvshm=shared
  366. else
  367. CONFIGURE_ARGS+= --disable-sysvshm
  368. endif
  369. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-tokenizer),)
  370. CONFIGURE_ARGS+= --enable-tokenizer=shared
  371. else
  372. CONFIGURE_ARGS+= --disable-tokenizer
  373. endif
  374. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xml),)
  375. CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
  376. ifneq ($(CONFIG_PHP8_LIBXML),y)
  377. CONFIGURE_ARGS+= --with-expat
  378. endif
  379. else
  380. CONFIGURE_ARGS+= --disable-xml
  381. endif
  382. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xmlreader),)
  383. CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
  384. else
  385. CONFIGURE_ARGS+= --disable-xmlreader
  386. endif
  387. ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xmlwriter),)
  388. CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
  389. else
  390. CONFIGURE_ARGS+= --disable-xmlwriter
  391. endif
  392. ifneq ($(CONFIG_PACKAGE_php8-mod-zip),)
  393. CONFIGURE_ARGS+= --with-zip=shared,"$(STAGING_DIR)/usr"
  394. else
  395. CONFIGURE_ARGS+= --without-zip
  396. endif
  397. ifneq ($(SDK)$(CONFIG_PHP8_LIBXML),)
  398. CONFIGURE_ARGS+= --with-libxml
  399. else
  400. CONFIGURE_ARGS+= --without-libxml
  401. endif
  402. ifneq ($(CONFIG_PHP8_SYSTEMTZDATA),)
  403. CONFIGURE_ARGS+= --with-system-tzdata
  404. else
  405. CONFIGURE_ARGS+= --without-system-tzdata
  406. endif
  407. ifneq ($(CONFIG_PACKAGE_apache-mod-php8),)
  408. CONFIGURE_ARGS+= --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
  409. endif
  410. CONFIGURE_VARS+= \
  411. ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
  412. php_cv_cc_rpath="no" \
  413. iconv_impl_name="gnu_libiconv" \
  414. ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
  415. ac_cv_u8t_decompose=yes \
  416. ac_cv_have_pcre2_jit=no
  417. define Package/php8/conffiles
  418. /etc/php.ini
  419. /etc/php8/
  420. endef
  421. define Package/php8/install
  422. $(INSTALL_DIR) $(1)/etc
  423. $(INSTALL_DATA) ./files/php.ini $(1)/etc/
  424. endef
  425. define Package/php8-cli/install
  426. $(INSTALL_DIR) $(1)/usr/bin
  427. $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php8-cli
  428. ln -sf php8-cli $(1)/usr/bin/php-cli
  429. endef
  430. define Package/php8-cgi/install
  431. $(INSTALL_DIR) $(1)/usr/bin
  432. $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php8-cgi
  433. ln -sf php8-cgi $(1)/usr/bin/php-cgi
  434. ln -sf php8-cgi $(1)/usr/bin/php8-fcgi
  435. endef
  436. define Package/php8-fastcgi/install
  437. $(INSTALL_DIR) $(1)/etc/config
  438. $(INSTALL_DATA) ./files/php8-fastcgi.config $(1)/etc/config/php8-fastcgi
  439. $(INSTALL_DIR) $(1)/etc/init.d
  440. $(INSTALL_BIN) ./files/php8-fastcgi.init $(1)/etc/init.d/php8-fastcgi
  441. endef
  442. define Package/php8-fastcgi/conffiles
  443. /etc/config/php8-fastcgi
  444. endef
  445. define Package/php8-fpm/install
  446. $(INSTALL_DIR) $(1)/usr/bin
  447. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php8-fpm
  448. $(INSTALL_DIR) $(1)/etc
  449. $(INSTALL_DATA) ./files/php8-fpm.conf $(1)/etc/php8-fpm.conf
  450. $(INSTALL_DIR) $(1)/etc/config
  451. $(INSTALL_DATA) ./files/php8-fpm.config $(1)/etc/config/php8-fpm
  452. $(INSTALL_DIR) $(1)/etc/php8-fpm.d
  453. $(INSTALL_DATA) ./files/php8-fpm-www.conf $(1)/etc/php8-fpm.d/www.conf
  454. $(INSTALL_DIR) $(1)/etc/init.d
  455. $(INSTALL_BIN) ./files/php8-fpm.init $(1)/etc/init.d/php8-fpm
  456. endef
  457. define Package/php8-fpm/conffiles
  458. /etc/php8-fpm.conf
  459. /etc/php8-fpm.d/
  460. /etc/config/php8-fpm
  461. endef
  462. define Package/apache-mod-php8/install
  463. $(INSTALL_DIR) $(1)/usr/lib/apache2
  464. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libs/libphp.so $(1)/usr/lib/apache2
  465. endef
  466. define Build/Prepare
  467. $(call Build/Prepare/Default)
  468. $(if $(QUILT),,( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
  469. endef
  470. define Build/Configure
  471. $(if $(QUILT),( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
  472. $(call Build/Configure/Default)
  473. endef
  474. define Build/InstallDev
  475. rm -rf $(PKG_BUILD_DIR)/staging
  476. make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
  477. rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
  478. rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
  479. mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize8
  480. mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php8-config
  481. mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php8
  482. mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php8
  483. $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
  484. sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize8
  485. sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize8
  486. sed -i -e "s#/include\`/php\"#/include\`/php8\"#" $(STAGING_DIR)/usr/bin/phpize8
  487. sed -i -e "s#/lib/php\`/build\"#/lib/php8\`/build\"#" $(STAGING_DIR)/usr/bin/phpize8
  488. sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php8-config
  489. sed -i -e "s#/include/php\"#/include/php8\"#" $(STAGING_DIR)/usr/bin/php8-config
  490. endef
  491. define BuildModule
  492. define Package/php8-mod-$(1)
  493. $(call Package/php8/Default)
  494. ifneq ($(3),)
  495. DEPENDS+=$(3)
  496. endif
  497. TITLE:=$(2) shared module
  498. endef
  499. define Package/php8-mod-$(1)/install
  500. $(INSTALL_DIR) $$(1)/usr/lib/php8
  501. $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php8/
  502. $(INSTALL_DIR) $$(1)/etc/php8
  503. ifeq ($(5),zend)
  504. echo "zend_extension=/usr/lib/php8/$(subst -,_,$(1)).so" > $$(1)/etc/php8/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  505. else
  506. echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php8/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  507. endif
  508. endef
  509. $$(eval $$(call BuildPackage,php8-mod-$(1)))
  510. endef
  511. $(eval $(call BuildPackage,php8))
  512. $(eval $(call BuildPackage,php8-cgi))
  513. $(eval $(call BuildPackage,php8-cli))
  514. $(eval $(call BuildPackage,php8-fastcgi))
  515. $(eval $(call BuildPackage,php8-fpm))
  516. $(eval $(call BuildPackage,apache-mod-php8))
  517. #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
  518. $(eval $(call BuildModule,bcmath,Bcmath))
  519. $(eval $(call BuildModule,calendar,Calendar))
  520. $(eval $(call BuildModule,ctype,Ctype))
  521. $(eval $(call BuildModule,curl,cURL,+PACKAGE_php8-mod-curl:libcurl))
  522. $(eval $(call BuildModule,dom,DOM,+@PHP8_LIBXML +PACKAGE_php8-mod-dom:libxml2))
  523. $(eval $(call BuildModule,exif,EXIF))
  524. $(eval $(call BuildModule,fileinfo,Fileinfo))
  525. $(eval $(call BuildModule,filter,Filter))
  526. $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php8-mod-ftp:libopenssl))
  527. $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php8-mod-gd:libgd-full))
  528. $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php8-mod-gettext:libintl-full))
  529. $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php8-mod-gmp:libgmp))
  530. $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
  531. $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php8-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php8-mod-imap:uw-imap))
  532. $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php8-mod-intl:icu +PHP8_FULLICUDATA:icu-full-data))
  533. $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php8-mod-ldap:libopenldap +PACKAGE_php8-mod-ldap:libsasl2))
  534. $(eval $(call BuildModule,mbstring,MBString,+PACKAGE_php8-mod-mbstring:oniguruma))
  535. $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php8-mod-mysqli:php8-mod-mysqlnd,30))
  536. $(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+PACKAGE_php8-mod-openssl:php8-mod-openssl))
  537. $(eval $(call BuildModule,opcache,OPcache,,,zend))
  538. $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php8-mod-openssl:libopenssl,15))
  539. $(eval $(call BuildModule,pcntl,PCNTL))
  540. $(eval $(call BuildModule,pdo,PHP Data Objects))
  541. $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php8-mod-pdo +PACKAGE_php8-mod-pdo-mysql:php8-mod-mysqlnd))
  542. $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php8-mod-pdo +PACKAGE_php8-mod-pdo-pgsql:libpq))
  543. $(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))
  544. $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php8-mod-pgsql:libpq))
  545. $(eval $(call BuildModule,phar,Phar Archives))
  546. $(eval $(call BuildModule,session,Session))
  547. $(eval $(call BuildModule,shmop,Shared Memory))
  548. $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP8_LIBXML +PACKAGE_php8-mod-simplexml:libxml2))
  549. $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php8-mod-snmp:libnetsnmp +PACKAGE_php8-mod-snmp:libopenssl))
  550. $(eval $(call BuildModule,soap,SOAP,+@PHP8_LIBXML +PACKAGE_php8-mod-soap:libxml2))
  551. $(eval $(call BuildModule,sockets,Sockets))
  552. $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php8-mod-sqlite3:libsqlite3))
  553. $(eval $(call BuildModule,sysvmsg,System V messages))
  554. $(eval $(call BuildModule,sysvsem,System V shared memory))
  555. $(eval $(call BuildModule,sysvshm,System V semaphore))
  556. $(eval $(call BuildModule,tokenizer,Tokenizer))
  557. $(eval $(call BuildModule,xml,XML,+PHP8_LIBXML:libxml2 +!PHP8_LIBXML:libexpat))
  558. $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP8_LIBXML +PACKAGE_php8-mod-dom:php8-mod-dom +PACKAGE_php8-mod-xmlreader:libxml2))
  559. $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP8_LIBXML +PACKAGE_php8-mod-xmlwriter:libxml2))
  560. $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php8-mod-zip:libzip))