php8: fix compilation with musl 1.2.4
[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.2.5
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:=800738c359b7f1e67e40c22713d2d90276bc85ba1c21b43d99edd43c254c5f76
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
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
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
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 +libpcre2 +zlib
163 TITLE:=PHP8 module for Apache Web Server
164 endef
165
166 define Package/apache-mod-php8/description
167 $(call Package/php8/Default/description)
168 This package contains the PHP module for the Apache Web Server.
169 endef
170
171 # not everything groks --disable-nls
172 DISABLE_NLS:=
173
174 CONFIGURE_ARGS+= \
175 --enable-cli \
176 --enable-cgi \
177 --enable-fpm \
178 --enable-shared \
179 --disable-static \
180 --with-pic \
181 --disable-rpath \
182 --disable-debug \
183 --disable-phpdbg \
184 --without-pear \
185 \
186 --with-config-file-path=/etc \
187 --with-config-file-scan-dir=/etc/php8 \
188 --disable-short-tags \
189 \
190 --without-valgrind \
191 --with-external-pcre \
192 --with-zlib="$(STAGING_DIR)/usr"
193
194 ifeq ($(CONFIG_LIBC_USE_GLIBC),y)
195 TARGET_LDFLAGS += -ldl
196 endif
197 ifeq ($(CONFIG_USE_MUSL),y)
198 TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
199 endif
200
201 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-bcmath),)
202 CONFIGURE_ARGS+= --enable-bcmath=shared
203 else
204 CONFIGURE_ARGS+= --disable-bcmath
205 endif
206
207 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-calendar),)
208 CONFIGURE_ARGS+= --enable-calendar=shared
209 else
210 CONFIGURE_ARGS+= --disable-calendar
211 endif
212
213 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ctype),)
214 CONFIGURE_ARGS+= --enable-ctype=shared
215 else
216 CONFIGURE_ARGS+= --disable-ctype
217 endif
218
219 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-curl),)
220 CONFIGURE_ARGS+= --with-curl=shared
221 else
222 CONFIGURE_ARGS+= --without-curl
223 endif
224
225 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-dom),)
226 CONFIGURE_ARGS+= --enable-dom=shared
227 else
228 CONFIGURE_ARGS+= --disable-dom
229 endif
230
231 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-exif),)
232 CONFIGURE_ARGS+= --enable-exif=shared
233 else
234 CONFIGURE_ARGS+= --disable-exif
235 endif
236
237 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-fileinfo),)
238 CONFIGURE_ARGS+= --enable-fileinfo=shared,"$(STAGING_DIR)/usr"
239 else
240 CONFIGURE_ARGS+= --disable-fileinfo
241 endif
242
243 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-filter),)
244 CONFIGURE_ARGS+= --enable-filter=shared,"$(STAGING_DIR)/usr"
245 else
246 CONFIGURE_ARGS+= --disable-filter
247 endif
248
249 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ftp),)
250 CONFIGURE_ARGS+= --enable-ftp=shared
251 else
252 CONFIGURE_ARGS+= --disable-ftp
253 endif
254
255 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gd),)
256 CONFIGURE_ARGS+= \
257 --enable-gd=shared,"$(STAGING_DIR)/usr" \
258 --with-external-gd
259 else
260 CONFIGURE_ARGS+= --disable-gd
261 endif
262
263 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gettext),)
264 CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
265 else
266 CONFIGURE_ARGS+= --without-gettext
267 endif
268
269 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-gmp),)
270 CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
271 else
272 CONFIGURE_ARGS+= --without-gmp
273 endif
274
275 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-iconv),)
276 ifeq ($(CONFIG_BUILD_NLS),y)
277 CONFIGURE_VARS+= iconv_impl_name="gnu_libiconv"
278 CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
279 else
280 CONFIGURE_VARS+= ac_cv_func_iconv=yes
281 CONFIGURE_ARGS+= --with-iconv=shared
282 endif
283 else
284 CONFIGURE_ARGS+= --without-iconv
285 endif
286
287 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-imap),)
288 CONFIGURE_ARGS+= \
289 --with-imap=shared,"$(STAGING_DIR)/usr" \
290 --with-kerberos=no \
291 --with-imap-ssl="$(STAGING_DIR)/usr"
292 else
293 CONFIGURE_ARGS+= --without-imap
294 endif
295
296 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-intl),)
297 CONFIGURE_ARGS+= --enable-intl=shared
298 TARGET_CXXFLAGS+= -std=c++0x
299 else
300 CONFIGURE_ARGS+= --disable-intl
301 endif
302
303 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-ldap),)
304 CONFIGURE_ARGS+= \
305 --with-ldap=shared,"$(STAGING_DIR)/usr" \
306 --with-ldap-sasl
307 else
308 CONFIGURE_ARGS+= --without-ldap
309 endif
310
311 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mbstring),)
312 CONFIGURE_ARGS+= \
313 --enable-mbstring=shared \
314 --enable-mbregex
315 else
316 CONFIGURE_ARGS+= --disable-mbstring
317 endif
318
319 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mysqli),)
320 CONFIGURE_ARGS+= --with-mysqli=shared
321 else
322 CONFIGURE_ARGS+= --without-mysqli
323 endif
324
325 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-mysqlnd),)
326 CONFIGURE_ARGS+= --enable-mysqlnd=shared
327 else
328 CONFIGURE_ARGS+= --disable-mysqlnd
329 endif
330
331 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-opcache),)
332 CONFIGURE_ARGS+= --enable-opcache=shared
333 else
334 CONFIGURE_ARGS+= --disable-opcache
335 endif
336
337 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-openssl)$(CONFIG_PACKAGE_php8-mod-ftp)$(CONFIG_PACKAGE_php8-mod-imap)$(CONFIG_PACKAGE_php8-mod-snmp),)
338 CONFIGURE_ARGS+= \
339 --with-openssl=shared \
340 --with-kerberos=no \
341 --with-openssl-dir="$(STAGING_DIR)/usr"
342 else
343 CONFIGURE_ARGS+= --without-openssl
344 endif
345
346 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pcntl),)
347 CONFIGURE_ARGS+= --enable-pcntl=shared
348 else
349 CONFIGURE_ARGS+= --disable-pcntl
350 endif
351
352 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo),)
353 CONFIGURE_ARGS+= --enable-pdo=shared
354 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-mysql),)
355 CONFIGURE_ARGS+= --with-pdo-mysql=shared
356 else
357 CONFIGURE_ARGS+= --without-pdo-mysql
358 endif
359 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-pgsql),)
360 CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
361 else
362 CONFIGURE_ARGS+= --without-pdo-pgsql
363 endif
364 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pdo-sqlite),)
365 CONFIGURE_ARGS+= --with-pdo-sqlite=shared
366 else
367 CONFIGURE_ARGS+= --without-pdo-sqlite
368 endif
369 else
370 CONFIGURE_ARGS+= --disable-pdo
371 endif
372
373 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-pgsql),)
374 CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
375 else
376 CONFIGURE_ARGS+= --without-pgsql
377 endif
378
379 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-phar),)
380 CONFIGURE_ARGS+= --enable-phar=shared
381 else
382 CONFIGURE_ARGS+= --disable-phar
383 endif
384
385 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-session),)
386 CONFIGURE_ARGS+= --enable-session=shared
387 else
388 CONFIGURE_ARGS+= --disable-session
389 endif
390
391 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-shmop),)
392 CONFIGURE_ARGS+= --enable-shmop=shared
393 else
394 CONFIGURE_ARGS+= --disable-shmop
395 endif
396
397 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-simplexml),)
398 CONFIGURE_ARGS+= --enable-simplexml=shared
399 else
400 CONFIGURE_ARGS+= --disable-simplexml
401 endif
402
403 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-snmp),)
404 CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
405 else
406 CONFIGURE_ARGS+= --without-snmp
407 endif
408
409 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-soap),)
410 CONFIGURE_ARGS+= --enable-soap=shared
411 else
412 CONFIGURE_ARGS+= --disable-soap
413 endif
414
415 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sockets),)
416 CONFIGURE_ARGS+= --enable-sockets=shared
417 else
418 CONFIGURE_ARGS+= --disable-sockets
419 endif
420
421 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sodium),)
422 CONFIGURE_ARGS+= --with-sodium=shared,"$(STAGING_DIR)/usr"
423 else
424 CONFIGURE_ARGS+= --without-sodium
425 endif
426
427 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sqlite3),)
428 CONFIGURE_ARGS+= --with-sqlite3=shared
429 else
430 CONFIGURE_ARGS+= --without-sqlite3
431 endif
432
433 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvmsg),)
434 CONFIGURE_ARGS+= --enable-sysvmsg=shared
435 else
436 CONFIGURE_ARGS+= --disable-sysvmsg
437 endif
438
439 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvsem),)
440 CONFIGURE_ARGS+= --enable-sysvsem=shared
441 else
442 CONFIGURE_ARGS+= --disable-sysvsem
443 endif
444
445 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-sysvshm),)
446 CONFIGURE_ARGS+= --enable-sysvshm=shared
447 else
448 CONFIGURE_ARGS+= --disable-sysvshm
449 endif
450
451 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-tokenizer),)
452 CONFIGURE_ARGS+= --enable-tokenizer=shared
453 else
454 CONFIGURE_ARGS+= --disable-tokenizer
455 endif
456
457 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xml),)
458 CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
459 ifneq ($(CONFIG_PHP8_LIBXML),y)
460 CONFIGURE_ARGS+= --with-expat
461 endif
462 else
463 CONFIGURE_ARGS+= --disable-xml
464 endif
465
466 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xmlreader),)
467 CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
468 else
469 CONFIGURE_ARGS+= --disable-xmlreader
470 endif
471
472 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-xmlwriter),)
473 CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
474 else
475 CONFIGURE_ARGS+= --disable-xmlwriter
476 endif
477
478 ifneq ($(CONFIG_PACKAGE_php8-mod-zip),)
479 CONFIGURE_ARGS+= --with-zip=shared,"$(STAGING_DIR)/usr"
480 else
481 CONFIGURE_ARGS+= --without-zip
482 endif
483
484 ifneq ($(SDK)$(CONFIG_PHP8_LIBXML),)
485 CONFIGURE_ARGS+= --with-libxml
486 else
487 CONFIGURE_ARGS+= --without-libxml
488 endif
489
490 ifneq ($(CONFIG_PHP8_SYSTEMTZDATA),)
491 CONFIGURE_ARGS+= --with-system-tzdata
492 else
493 CONFIGURE_ARGS+= --without-system-tzdata
494 endif
495
496 ifneq ($(CONFIG_PACKAGE_apache-mod-php8),)
497 CONFIGURE_ARGS+= --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
498 endif
499
500 CONFIGURE_VARS+= \
501 ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
502 php_cv_cc_rpath="no" \
503 ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
504 ac_cv_u8t_decompose=yes \
505 ac_cv_have_pcre2_jit=no
506
507 define Package/php8/conffiles
508 /etc/php.ini
509 /etc/php8/
510 endef
511
512 define Package/php8/install
513 $(INSTALL_DIR) $(1)/etc
514 $(INSTALL_DATA) ./files/php.ini $(1)/etc/
515 endef
516
517 define Package/php8-cli/install
518 $(INSTALL_DIR) $(1)/usr/bin
519 $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php8-cli
520 ln -sf php8-cli $(1)/usr/bin/php-cli
521 endef
522
523 define Package/php8-cgi/install
524 $(INSTALL_DIR) $(1)/usr/bin
525 $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php8-cgi
526 ln -sf php8-cgi $(1)/usr/bin/php-cgi
527 ln -sf php8-cgi $(1)/usr/bin/php8-fcgi
528 endef
529
530 define Package/php8-fastcgi/install
531 $(INSTALL_DIR) $(1)/etc/config
532 $(INSTALL_DATA) ./files/php8-fastcgi.config $(1)/etc/config/php8-fastcgi
533
534 $(INSTALL_DIR) $(1)/etc/init.d
535 $(INSTALL_BIN) ./files/php8-fastcgi.init $(1)/etc/init.d/php8-fastcgi
536 endef
537
538 define Package/php8-fastcgi/conffiles
539 /etc/config/php8-fastcgi
540 endef
541
542 define Package/php8-fpm/install
543 $(INSTALL_DIR) $(1)/usr/bin
544 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php8-fpm
545
546 $(INSTALL_DIR) $(1)/etc
547 $(INSTALL_DATA) ./files/php8-fpm.conf $(1)/etc/php8-fpm.conf
548
549 $(INSTALL_DIR) $(1)/etc/config
550 $(INSTALL_DATA) ./files/php8-fpm.config $(1)/etc/config/php8-fpm
551
552 $(INSTALL_DIR) $(1)/etc/php8-fpm.d
553 $(INSTALL_DATA) ./files/php8-fpm-www.conf $(1)/etc/php8-fpm.d/www.conf
554
555 $(INSTALL_DIR) $(1)/etc/init.d
556 $(INSTALL_BIN) ./files/php8-fpm.init $(1)/etc/init.d/php8-fpm
557 endef
558
559 define Package/php8-fpm/conffiles
560 /etc/php8-fpm.conf
561 /etc/php8-fpm.d/
562 /etc/config/php8-fpm
563 endef
564
565 define Package/apache-mod-php8/install
566 $(INSTALL_DIR) $(1)/usr/lib/apache2
567 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libs/libphp.so $(1)/usr/lib/apache2
568 endef
569
570 define Build/Prepare
571 $(call Build/Prepare/Default)
572 $(if $(QUILT),,( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
573 endef
574
575 define Build/Configure
576 $(if $(QUILT),( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
577 $(call Build/Configure/Default)
578 endef
579
580 define Build/InstallDev
581 rm -rf $(PKG_BUILD_DIR)/staging
582 make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
583 rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
584 rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
585 mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize8
586 mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php8-config
587 mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php8
588 mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php8
589
590 $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
591
592 sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize8
593 sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize8
594 sed -i -e "s#/include\`/php\"#/include\`/php8\"#" $(STAGING_DIR)/usr/bin/phpize8
595 sed -i -e "s#/lib/php\`/build\"#/lib/php8\`/build\"#" $(STAGING_DIR)/usr/bin/phpize8
596
597 sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php8-config
598 sed -i -e "s#/include/php\"#/include/php8\"#" $(STAGING_DIR)/usr/bin/php8-config
599 endef
600
601 define BuildModule
602
603 define Package/php8-mod-$(1)
604 $(call Package/php8/Default)
605
606 ifneq ($(3),)
607 DEPENDS+=$(3)
608 endif
609
610 TITLE:=$(2) shared module
611 endef
612
613 define Package/php8-mod-$(1)/install
614 $(INSTALL_DIR) $$(1)/usr/lib/php8
615 $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php8/
616 $(INSTALL_DIR) $$(1)/etc/php8
617 ifeq ($(5),zend)
618 echo "zend_extension=/usr/lib/php8/$(subst -,_,$(1)).so" > $$(1)/etc/php8/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
619 else
620 echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php8/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
621 endif
622 endef
623
624 $$(eval $$(call BuildPackage,php8-mod-$(1)))
625
626 endef
627
628 $(eval $(call BuildPackage,php8))
629 $(eval $(call BuildPackage,php8-cgi))
630 $(eval $(call BuildPackage,php8-cli))
631 $(eval $(call BuildPackage,php8-fastcgi))
632 $(eval $(call BuildPackage,php8-fpm))
633 $(eval $(call BuildPackage,apache-mod-php8))
634
635 #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
636 $(eval $(call BuildModule,bcmath,Bcmath))
637 $(eval $(call BuildModule,calendar,Calendar))
638 $(eval $(call BuildModule,ctype,Ctype))
639 $(eval $(call BuildModule,curl,cURL,+PACKAGE_php8-mod-curl:libcurl))
640 $(eval $(call BuildModule,dom,DOM,+@PHP8_LIBXML +PACKAGE_php8-mod-dom:libxml2))
641 $(eval $(call BuildModule,exif,EXIF))
642 $(eval $(call BuildModule,fileinfo,Fileinfo))
643 $(eval $(call BuildModule,filter,Filter))
644 $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php8-mod-ftp:libopenssl))
645 $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php8-mod-gd:libgd-full))
646 $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php8-mod-gettext:libintl-full))
647 $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php8-mod-gmp:libgmp))
648 $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
649 $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php8-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php8-mod-imap:uw-imap))
650 $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php8-mod-intl:icu +PHP8_FULLICUDATA:icu-full-data))
651 $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php8-mod-ldap:libopenldap +PACKAGE_php8-mod-ldap:libsasl2))
652 $(eval $(call BuildModule,mbstring,MBString,+PACKAGE_php8-mod-mbstring:oniguruma))
653 $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php8-mod-mysqli:php8-mod-mysqlnd,30))
654 $(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+PACKAGE_php8-mod-openssl:php8-mod-openssl))
655 $(eval $(call BuildModule,opcache,OPcache,,,zend))
656 $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php8-mod-openssl:libopenssl,15))
657 $(eval $(call BuildModule,pcntl,PCNTL))
658 $(eval $(call BuildModule,pdo,PHP Data Objects))
659 $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php8-mod-pdo +PACKAGE_php8-mod-pdo-mysql:php8-mod-mysqlnd))
660 $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php8-mod-pdo +PACKAGE_php8-mod-pdo-pgsql:libpq))
661 $(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))
662 $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php8-mod-pgsql:libpq))
663 $(eval $(call BuildModule,phar,Phar Archives))
664 $(eval $(call BuildModule,session,Session))
665 $(eval $(call BuildModule,shmop,Shared Memory))
666 $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP8_LIBXML +PACKAGE_php8-mod-simplexml:libxml2))
667 $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php8-mod-snmp:libnetsnmp +PACKAGE_php8-mod-snmp:libopenssl))
668 $(eval $(call BuildModule,soap,SOAP,+@PHP8_LIBXML +PACKAGE_php8-mod-soap:libxml2))
669 $(eval $(call BuildModule,sockets,Sockets))
670 $(eval $(call BuildModule,sodium,Sodium,+PACKAGE_php8-mod-sodium:libsodium,30))
671 $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php8-mod-sqlite3:libsqlite3))
672 $(eval $(call BuildModule,sysvmsg,System V messages))
673 $(eval $(call BuildModule,sysvsem,System V shared memory))
674 $(eval $(call BuildModule,sysvshm,System V semaphore))
675 $(eval $(call BuildModule,tokenizer,Tokenizer))
676 $(eval $(call BuildModule,xml,XML,+PHP8_LIBXML:libxml2 +!PHP8_LIBXML:libexpat))
677 $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP8_LIBXML +PACKAGE_php8-mod-dom:php8-mod-dom +PACKAGE_php8-mod-xmlreader:libxml2))
678 $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP8_LIBXML +PACKAGE_php8-mod-xmlwriter:libxml2))
679 $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php8-mod-zip:libzip))