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